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
Option 1: Direct Usage with npx (Recommended)
No installation needed! You can run the server directly using npx.
Option 2: Local Installation
- Clone this repository:
git clone https://github.com/Limecooler/yt-video-info.git
cd yt-video-info- Install dependencies:
npm install- Build the TypeScript code:
npm run buildClaude 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
Option 1: Using npx (Recommended - No Installation Required)
{
"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 dQw4w9WgXcQThe 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 devTesting
Run comprehensive tests:
npm testTest MCP protocol communication:
npm run test:mcpEnable debug logging:
MCP_DEBUG=true npm startLimitations
- 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