使用说明
YouTube Transcripts MCP Server
A self-contained MCP server for downloading, cleaning, and summarizing YouTube video captions.
Features
- 🎥 Download YouTube captions using yt-dlp
- 🧹 Clean VTT format (remove timestamps, HTML tags, duplicates)
- 📝 Generate summaries with reading time and key topics
- 🚀 Simple command-line interface
- 📦 Self-contained (no external MCP server dependencies)
Prerequisites
Required Tools
| Tool | Purpose | Installation |
|---|---|---|
| Node.js | Runtime environment | Download from nodejs.org (v18 or higher) |
| yt-dlp | Download YouTube captions | pip install yt-dlp |
Installing yt-dlp
# Using pip
pip install yt-dlp
# Using pip3
pip3 install yt-dlp
# On macOS with Homebrew
brew install yt-dlp
# On Linux
pip install yt-dlp
Installation
-
Install dependencies:
npm install -
Build the project:
npm run build
Configuration
Claude Desktop Setup
Add this to your Claude Desktop config:
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"youtube-transcripts": {
"command": "node",
"args": ["H:\\MCP\\yt-transcripts\\build\\mcp-server.js"]
}
}
}
Restart Claude Desktop
Close and reopen Claude Desktop for the changes to take effect.
Available Tools
| Tool Name | Description |
|---|---|
process-youtube-captions |
Download, clean, save, and summarize YouTube video captions |
clean-vtt-file |
Clean an existing VTT file to extract readable text |
save-formatted-transcript |
Save a formatted transcript to the filesystem |
create-youtube-summary-note |
Download captions and bundle with Obsidian note formatting instructions |
health-check |
Check if the MCP server and dependencies are working properly |
Usage Examples
Example 1: Process a YouTube Video
Ask Claude:
"Process this YouTube video: https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Claude will:
- Download captions using yt-dlp
- Clean VTT formatting
- Save cleaned text to filesystem
- Generate summary with reading time
- Return the transcript with statistics
Example 2: Clean Existing VTT File
Ask Claude:
"Clean this VTT file: H:\MCP\captions-dl\video.vtt"
Example 3: Health Check
Ask Claude:
"Run a health check on the YouTube transcripts server"
Output Location
By default, all files are saved to:
H:\MCP\captions-dl\
You can specify a custom output directory when using the tools.
File Structure
H:\MCP\yt-transcripts\
├── README.md # This file
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── mcp-server.ts # Main MCP server
├── youtube-tools.ts # Tool implementations
├── caption-cleaner.ts # VTT cleaning utilities
├── file-manager.ts # File operations
├── youtube-downloader.ts # yt-dlp integration
└── build/ # Compiled output
├── mcp-server.js
├── youtube-tools.js
├── caption-cleaner.js
├── file-manager.js
└── youtube-downloader.js
NPM Scripts
npm run build # Compile TypeScript to JavaScript
npm run dev # Watch mode - rebuild on file changes
npm run clean # Remove build/ folder
Troubleshooting
"Tool not found" error
- Check the path in
claude_desktop_config.json - Ensure
build/mcp-server.jsexists (runnpm run build) - Restart Claude Desktop
"Server connection failed"
- Ensure yt-dlp is installed:
yt-dlp --version - Check Node.js version:
node --version(must be v18 or higher) - Verify the server path in Claude Desktop config
"No captions available"
- Try a different video with captions
- Check if the video is private or restricted
- Verify network connection
Benefits
- Self-contained - No external MCP server dependencies
- Simple - Direct implementation, no bridge layer
- Fast - No proxy overhead or progressive discovery
- Easy to maintain - Single codebase, clear structure
- Works with Claude Desktop - Pure MCP server
Language Support
Currently configured for English captions only. The server automatically searches for English captions (en.*) when downloading videos.
License
MIT