JSPM

@limecooler/yt-info-mcp

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q50723F
  • License MIT

MCP server for retrieving YouTube video information and transcripts

Package Exports

  • @limecooler/yt-info-mcp
  • @limecooler/yt-info-mcp/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@limecooler/yt-info-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

YouTube Info MCP Server

A lightweight MCP server that extracts YouTube video metadata and transcripts through web scraping, featuring robust error handling, caching, and retry logic without requiring API keys or external dependencies.

Features

  • Fetches video metadata (title, author, duration, views, description)
  • Downloads available transcripts/captions
  • No API key required
  • No external dependencies (like yt-dlp)
  • Fast startup time for Claude Desktop integration
  • Comprehensive error handling with specific error codes
  • Input validation using Zod schemas
  • Retry logic with exponential backoff for network resilience
  • In-memory caching for improved performance
  • Debug logging support (set MCP_DEBUG=true)
  • TypeScript with full type safety

Installation

No installation needed! You can run the server directly using npx.

Option 2: Local Installation

  1. Clone this repository:
git clone https://github.com/Limecooler/yt-video-info.git
cd yt-video-info
  1. Install dependencies:
npm install
  1. Build the TypeScript code:
npm run build

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

Configuration File Locations

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "youtube-info": {
      "command": "npx",
      "args": ["-y", "@limecooler/yt-info-mcp"]
    }
  }
}

Option 2: Local Installation

{
  "mcpServers": {
    "youtube-info": {
      "command": "node",
      "args": ["/absolute/path/to/yt-video-info/dist/index.js"]
    }
  }
}

Usage

Once configured, you can use the tool in Claude Desktop:

Please get information from YouTube video dQw4w9WgXcQ

The tool will return:

  • Video metadata (title, author, duration, view count, description)
  • Transcript with timestamps (if available)
  • Error details if the video is unavailable or has no transcript

Response Format

{
  "metadata": {
    "title": "Video Title",
    "author": "Channel Name",
    "lengthSeconds": 215,
    "viewCount": 1234567,
    "description": "Video description..."
  },
  "transcript": {
    "text": "Full transcript text...",
    "segments": [
      {
        "start": 0.0,
        "text": "First segment"
      },
      {
        "start": 2.5,
        "text": "Second segment"
      }
    ]
  },
  "error": "Error message if transcript unavailable"
}

Error Handling

The server handles various error cases:

  • Invalid video ID format
  • Video not found (404)
  • Private or age-restricted videos
  • Videos without transcripts
  • Network errors

Development

Run in development mode with auto-reload:

npm run dev

Testing

Run comprehensive tests:

npm test

Test MCP protocol communication:

npm run test:mcp

Enable debug logging:

MCP_DEBUG=true npm start

Limitations

  • Relies on YouTube's web interface structure, which may change
  • Cannot access transcripts for videos that don't have captions
  • May be rate-limited by YouTube if used excessively
  • Does not transcribe audio - only downloads existing captions

License

MIT