Enables fetching subtitles and transcripts from public YouTube videos with support for multiple output formats (SRT, VTT, TXT, JSON), multi-language subtitle support, and complete timestamp information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YouTube Subtitle MCP Serverfetch subtitles from https://youtu.be/dQw4w9WgXcQ in SRT format"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ฌ YouTube Subtitle MCP Server
A Model Context Protocol (MCP) server for fetching YouTube video subtitles/transcripts with support for multiple output formats (SRT, VTT, TXT, JSON).
โจ Features
๐ฅ Fetch subtitles from any public YouTube video
๐ Multiple output formats: SRT, VTT, TXT, JSON
๐ Multi-language subtitle support
โก Two deployment modes: stdio (local) and HTTP (server)
๐ง Zero-configuration setup with npx
๐ Complete timestamp information
๐ Production-ready with TypeScript
๐ฅ Built with youtubei.js for reliable and stable subtitle extraction
๐ Quick Start
โญ Method 1: stdio Mode (Recommended for Local Use)
Zero configuration required! Simply use npx:
Or install globally:
๐ Method 2: HTTP Mode (For Server Deployment)
Server will start at http://localhost:3000
๐ฆ Installation
For Development
For Production
๐ง Configuration
โญ stdio Mode Configuration (Recommended)
Add to your MCP client configuration file:
Claude Desktop / Cursor Configuration:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
For local development:
๐ HTTP Mode Configuration
๐ ๏ธ Tool: fetch_youtube_subtitles
Parameters
Parameter | Type | Required | Description | Example |
| string | โ Yes | YouTube video URL or video ID |
|
| string | โ No | Output format (default: JSON) |
|
| string | โ No | Language code (default: auto) |
|
Supported URL Formats
Standard:
https://www.youtube.com/watch?v=VIDEO_IDShort:
https://youtu.be/VIDEO_IDEmbed:
https://www.youtube.com/embed/VIDEO_IDDirect ID:
VIDEO_ID
Language Codes
zh-Hans- Simplified Chinesezh-Hant- Traditional Chineseen- Englishja- Japaneseko- Koreanes- Spanishfr- Frenchde- German
๐ Usage Examples
Example 1: Fetch JSON Format Subtitles (Default)
Example 2: Fetch SRT Format Subtitles
Example 3: Fetch Specific Language Subtitles
Example 4: Fetch Plain Text Content
๐ Output Format Examples
JSON Format
SRT Format
VTT Format
TXT Format
๐๏ธ Project Structure
๐ Development
Build
Watch Mode
Start stdio Mode
Start HTTP Mode
Custom Port (HTTP Mode)
๐ณ Docker Deployment
Using Docker
Using Docker Compose
๐ Deployment
PM2 (Process Manager)
๐ API Reference
Health Check (HTTP Mode)
Endpoint: GET /health
Response:
MCP Endpoint (HTTP Mode)
Endpoint: POST /mcp
Headers:
Content-Type: application/jsonMcp-Session-Id: <session-id>(after initialization)
Request Body: JSON-RPC 2.0 format
โ ๏ธ Notes
Public videos only: Cannot fetch subtitles from private or restricted videos
Subtitles required: Video must have available subtitles (auto-generated or uploaded)
Language codes: If specified language doesn't exist, an error will be returned
Network required: Requires stable network connection to access YouTube
Terms of Service: Please comply with YouTube's Terms of Service, use for research/analysis purposes only
โ FAQ
Q: Server started but client can't connect?
A: Check the following:
Verify server is running: visit
http://localhost:3000/healthCheck URL in configuration file:
http://localhost:3000/mcpEnsure firewall isn't blocking port 3000
Restart Cursor/Claude Desktop
Q: Why can't I fetch subtitles?
A: Possible reasons:
Video has no subtitles
Video is private or region-restricted
Specified language code doesn't exist
Network connection issue
Server network can't access YouTube
Q: Do you support auto-generated subtitles?
A: Yes, supports YouTube auto-generated subtitles.
Q: Can I batch process multiple videos?
A: Current version processes one video at a time. For batch processing, loop the tool call on the client side.
Q: What's the timestamp unit?
A: Timestamps in JSON format are in milliseconds (ms).
Q: Can I deploy on a remote server?
A: Yes! Just:
Install Node.js on remote server
Clone project and run
npm installStart server with
npm run start:httpUse remote URL in client configuration:
http://your-server:3000/mcpRecommend using HTTPS and reverse proxy (e.g., Nginx) for security
Q: How to change port?
A: Two methods:
Environment variable:
PORT=8080 npm run start:httpCreate
.envfile: addPORT=8080
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
๐ค Author
Xingyu Chen
๐ Acknowledgments
Model Context Protocol - MCP SDK
youtubei.js - Powerful YouTube API wrapper for reliable subtitle extraction
๐ฎ Support
If you have any questions or suggestions, please create an Issue.
Made with โค๏ธ by Xingyu Chen