ytmcp
Allows fetching YouTube video transcripts with precise timestamps, supporting multiple languages, time-range filtering, and listing available transcript languages.
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., "@ytmcpGet the transcript of this YouTube video: dQw4w9WgXcQ"
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.
YTMcp - YouTube Transcript MCP Server
A Model Context Protocol (MCP) server that enables AI assistants like Claude to fetch YouTube video transcripts with precise timestamps. Built on top of the excellent youtube-transcript-api by @jdepoix.
🎯 Features
🎥 Fetch YouTube transcripts with start/end timestamps
🌍 Multi-language support with automatic fallback
⏱️ Time-range filtering for specific video segments
📋 List available languages for any video
🔍 Smart URL parsing - works with any YouTube URL format
🤖 MCP compatible - works with Claude Desktop and other MCP clients
🚀 Zero external dependencies - bundled with transcript API
🛡️ Comprehensive error handling for robust operation
Related MCP server: YouTube Transcript MCP Server
📦 Installation
pip install ytmcp🚀 Quick Start
1. Run as MCP Server
ytmcpThe server will start and listen for MCP requests via stdio.
2. Configure with Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"youtube-transcript": {
"command": "ytmcp"
}
}
}3. Test Installation
# Test the server functionality
ytmcp --test
# Test with a specific video
ytmcp --test --video-id dQw4w9WgXcQ
# Check version
ytmcp --version4. Use with Claude
Once configured, you can ask Claude natural language questions like:
"Get the transcript for this YouTube video: https://www.youtube.com/watch?v=dQw4w9WgXcQ"
"What transcript languages are available for this video?"
"Get me the transcript from 2:30 to 5:00 in this video"
"Summarize the key points from this YouTube video's transcript"
🛠️ Available Tools
get_transcript
Fetch complete video transcript with timestamps.
Parameters:
video_url_or_id(required): YouTube URL or video IDlanguages(optional): Array of language codes in priority order (default: ["en"])preserve_formatting(optional): Keep HTML formatting (default: false)include_timestamps(optional): Include start/end times (default: true)
Example Usage:
{
"name": "get_transcript",
"arguments": {
"video_url_or_id": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"languages": ["en", "es"],
"include_timestamps": true
}
}Example Response:
{
"video_id": "dQw4w9WgXcQ",
"language": "English",
"language_code": "en",
"is_generated": true,
"transcript_count": 142,
"transcript": [
{
"text": "We're no strangers to love",
"start": 15.5,
"duration": 2.3,
"end": 17.8
},
{
"text": "You know the rules and so do I",
"start": 17.8,
"duration": 2.1,
"end": 19.9
}
]
}list_available_transcripts
List all available transcript languages for a video.
Parameters:
video_url_or_id(required): YouTube URL or video ID
Example Usage:
{
"name": "list_available_transcripts",
"arguments": {
"video_url_or_id": "dQw4w9WgXcQ"
}
}Example Response:
{
"video_id": "dQw4w9WgXcQ",
"manually_created_transcripts": [
{
"language": "English",
"language_code": "en",
"is_translatable": true
}
],
"auto_generated_transcripts": [
{
"language": "English (auto-generated)",
"language_code": "en",
"is_translatable": true
}
],
"total_transcripts": 2
}get_transcript_with_time_range
Get transcript for specific time range.
Parameters:
video_url_or_id(required): YouTube URL or video IDstart_time(required): Start time in secondsend_time(required): End time in secondslanguages(optional): Language preferences (default: ["en"])preserve_formatting(optional): Keep HTML formatting (default: false)
Example Usage:
{
"name": "get_transcript_with_time_range",
"arguments": {
"video_url_or_id": "dQw4w9WgXcQ",
"start_time": 30.0,
"end_time": 90.0,
"languages": ["en"]
}
}Example Response:
{
"video_id": "dQw4w9WgXcQ",
"language": "English",
"language_code": "en",
"is_generated": true,
"time_range": {
"start": 30.0,
"end": 90.0
},
"filtered_transcript": [
{
"text": "Never gonna give you up",
"start": 32.1,
"duration": 1.8,
"end": 33.9
}
],
"snippet_count": 15
}🔧 Configuration Options
Language Codes
YTMcp supports all language codes that YouTube provides. Common ones include:
en- Englishes- Spanishfr- Frenchde- Germanit- Italianpt- Portugueseru- Russianja- Japaneseko- Koreanzh- Chinese
URL Format Support
YTMcp automatically extracts video IDs from various YouTube URL formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_IDhttps://www.youtube.com/watch?v=VIDEO_ID&t=120sOr just the video ID directly:
VIDEO_ID
⚠️ Error Handling
YTMcp provides comprehensive error handling for various scenarios:
Common Error Types
Invalid Video ID: Invalid URL or video ID format
No Transcript Found: No transcripts available in requested languages
Transcripts Disabled: Video has disabled subtitles/captions
Video Unavailable: Video is private, deleted, or restricted
Request Blocked: IP blocked by YouTube (consider using proxies)
Age Restricted: Video requires authentication
Error Response Format
{
"content": [
{
"type": "text",
"text": "Error: No transcript found for languages: ['de']"
}
]
}🔄 Advanced Usage
Running as Python Module
python -m ytmcpDevelopment Mode
# Install in development mode
pip install -e .
# Run tests
ytmcp --test
# Test with verbose output
ytmcp --test --video-id dQw4w9WgXcQProxy Support
If you encounter IP blocking issues, you can extend the server by modifying the YouTube API configuration to use proxies. See the youtube-transcript-api documentation for proxy configuration options.
📚 Use Cases
Content Analysis
Video Summarization: Extract transcripts for AI-powered summaries
Content Research: Analyze video content programmatically
Educational Tools: Create study materials from lecture videos
Accessibility
Transcript Generation: Provide text alternatives for video content
Translation: Use with translation APIs for multilingual access
Search & Discovery: Make video content searchable
Development
API Integration: Embed transcript functionality in applications
Data Pipeline: Process video transcripts in bulk
AI Training: Use transcripts as training data
🐛 Troubleshooting
Installation Issues
# If you get import errors
pip install --upgrade ytmcp
# If command not found
pip install --force-reinstall ytmcp
# Check installation
ytmcp --versionCommon Problems
1. Video Not Found
Verify the video ID/URL is correct
Check if the video is public and available
Ensure the video has captions enabled
2. Language Not Available
Use
list_available_transcriptsto see available languagesTry fallback languages like
["en", "auto"]Some videos only have auto-generated transcripts
3. Rate Limiting
YouTube may temporarily block requests from your IP
Consider using proxy configuration for high-volume usage
Space out your requests to avoid hitting rate limits
4. Permission Errors
Check file permissions if running on Unix systems
Ensure Python has permission to execute the script
Try running with appropriate user privileges
🤝 Contributing
We welcome contributions! Here's how you can help:
Development Setup
git clone https://github.com/shubhamshnd/ytmcp.git
cd ytmcp
pip install -e ".[dev]"Running Tests
pytest tests/Code Style
black ytmcp/
flake8 ytmcp/
mypy ytmcp/Submitting Changes
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Credits
This project is built on top of the excellent youtube-transcript-api by @jdepoix. All core transcript fetching functionality is provided by this library.
Key Dependencies:
youtube-transcript-api - Core YouTube transcript fetching (bundled)
requests - HTTP library for API calls
defusedxml - Secure XML parsing
🔗 Related Projects
Model Context Protocol - The protocol specification
Claude Desktop - AI assistant that supports MCP
youtube-transcript-api - Original transcript API
📞 Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Documentation: README
🚀 Roadmap
Translation Support: Automatic transcript translation
Batch Processing: Handle multiple videos simultaneously
Caching: Cache transcripts for improved performance
WebSocket Support: Real-time transcript streaming
Export Formats: SRT, VTT, and other subtitle formats
Search: Full-text search within transcripts
Webhooks: Notification system for transcript updates
Made with ❤️ for the MCP and AI community
If you find this project useful, please consider giving it a ⭐ on GitHub!
Available Tools
3 toolsget_transcriptC
Fetch transcript for a YouTube video with timestamps
| Name | Required | Description | Default |
|---|---|---|---|
| languages | No | Preferred languages in priority order (e.g., ['en', 'es']) | |
| video_url_or_id | Yes | YouTube video URL or video ID | |
| include_timestamps | No | Whether to include start and end timestamps | |
| preserve_formatting | No | Whether to preserve HTML formatting in transcript text |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It merely restates that timestamps are included, which is already implied by the schema's default. It does not disclose return format, error behavior (e.g., when no transcript is available), or any side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It is concise and to the point. Given the simplicity of the sentence, it earns a high score for structure, though it could be slightly more informative without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 4 parameters, no output schema, and no annotations. The description fails to explain what the returned transcript looks like, how languages are handled, or how this tool relates to the time-range variant. It is incomplete for a tool of this complexity, as the agent would need additional information to invoke it correctly and interpret results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no additional meaning beyond the schema; the mention of timestamps corresponds to the include_timestamps parameter default but offers no extra insight into parameter usage or edge cases.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (fetch) and resource (YouTube video transcript), and mentions 'with timestamps' which hints at a key feature. However, it does not explicitly distinguish this tool from the sibling get_transcript_with_time_range, which could cause confusion about when to use which.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidance is provided. The description does not indicate when to use this tool versus the siblings (list_available_transcripts, get_transcript_with_time_range), nor does it mention any prerequisites or exclusions. Users are left to infer the appropriate use case.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_transcript_with_time_rangeA
Fetch transcript for a specific time range of a YouTube video
| Name | Required | Description | Default |
|---|---|---|---|
| end_time | Yes | End time in seconds | |
| languages | No | Preferred languages in priority order | |
| start_time | Yes | Start time in seconds | |
| video_url_or_id | Yes | YouTube video URL or video ID | |
| preserve_formatting | No | Whether to preserve HTML formatting |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. The verb 'Fetch' implies a read-only operation, but the description does not disclose error behavior, language fallback behavior, or what happens if no transcript exists for the range. It provides minimal behavioral context beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It is highly concise and appropriate for the tool's simplicity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema, so the description should clarify what the tool returns to some degree. It says 'Fetch transcript' but does not indicate return format (e.g., text, JSON, list of segments) or edge-case behavior. Given the simple read-only nature, the description is minimally adequate but leaves gaps in context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% parameter description coverage, so the baseline is 3. The description does not add any parameter-specific meaning beyond what the schema already provides; it merely contextualizes the time-range parameters generically.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool fetches a transcript for a specific time range of a YouTube video, using a specific verb ('Fetch') and resource ('transcript for a specific time range'). This distinguishes it from sibling tools that list available transcripts or fetch full transcripts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly indicates the use case (fetching a transcript segment by time range), which provides clear context. However, it does not explicitly name alternatives or state when not to use this tool, so it lacks explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_available_transcriptsA
List all available transcript languages for a YouTube video
| Name | Required | Description | Default |
|---|---|---|---|
| video_url_or_id | Yes | YouTube video URL or video ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of disclosing behavior. It clearly indicates a read-only listing operation, but adds no additional details such as return format, behavior when no transcripts exist, or whether auto-generated captions are included. This is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no unnecessary words or repetition. It is front-loaded with the action and resource, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no output schema, no complex nested objects), the description is sufficient for an agent to understand the tool's core function. It lacks some behavioral details like output shape, but for a listing operation this is acceptable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with the parameter description 'YouTube video URL or video ID'. The tool description does not add any extra meaning beyond the schema, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'list' and clearly identifies the resource ('available transcript languages for a YouTube video'). It distinguishes itself from sibling tools (get_transcript, get_transcript_with_time_range) by focusing on listing languages rather than fetching transcript content.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage context is implied: one would call this tool to discover which transcript languages are available before fetching a transcript. However, it does not explicitly mention when to use it over the sibling tools or provide any exclusion criteria, leaving the guidance implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
The tools are mostly distinct: listing available transcripts and fetching a full transcript are clearly different. However, get_transcript and get_transcript_with_time_range both fetch transcripts and could be confused, though the time-range description mitigates ambiguity.
All tool names follow a consistent verb_noun pattern using 'get_' and 'list_', with descriptive modifiers like 'with_time_range'. The naming is predictable and clearly maps to each tool's purpose.
With only 3 tools, the server is tightly scoped to YouTube transcript retrieval. This is an appropriate size for such a niche domain, with no unnecessary bloat.
The set covers listing languages and fetching transcripts (full and by range), but there is no explicit way to choose a specific language from the list. This creates a potential dead end where users can see available languages but not act on them.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents. No signup.
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
Fetch transcripts, subtitles, chapters, metadata and frames from YouTube and 10+ video platforms
Extract YouTube transcripts, search what was said, and read on-screen frames with cited timestamps.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to fetch and process YouTube video transcripts in multiple formats and languages, with built-in caching and rate limiting for efficient video content analysis.
- AlicenseAqualityFmaintenanceRetrieves transcripts from YouTube videos with support for multiple languages, timestamp control, and language detection. Enables video content analysis, summarization, and quote extraction without manually downloading or watching videos.214915MIT
- AlicenseBqualityFmaintenanceEnables AI assistants to analyze and summarize YouTube videos by extracting captions, subtitles, and comprehensive metadata including title, description, and duration in multiple languages.14560MIT
- FlicenseDqualityDmaintenanceEnables AI assistants to fetch and analyze transcripts from YouTube videos using video IDs or URLs, with support for multiple language preferences.1
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/shubhamshnd/ytmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server