YouTube Transcript MCP Server
Extracts transcripts from YouTube videos with support for timestamps, metadata, and file exports.
Click on "Deploy 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 Transcript MCP Server extract transcript from https://youtu.be/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.
YouTube Transcript MCP Server
A Model Context Protocol (MCP) server that enables Large Language Models (LLMs) to extract transcripts from YouTube videos. Built with the reliable youtubei.js library, this server provides seamless transcript extraction with support for timestamps, metadata, and file exports.
β¨ Features
π₯ Extract transcripts from any YouTube video with captions
β±οΈ Timestamp support - Get transcripts with or without timestamps
π Rich metadata - Word count, duration, segment count, and more
πΎ Export to files - Save transcripts as text files
π§ Flexible input - Accepts full URLs, short URLs, or just video IDs
β‘ High reliability - Uses YouTube's internal API via youtubei.js
π No API key required - Works out of the box
π‘οΈ Error handling - Clear, actionable error messages
Related MCP server: YouTube Insights MCP Server
π¦ Installation
As an MCP Server for Claude Desktop
# Clone the repository
git clone https://github.com/tanush-yadav/youtube-transcript-mcp.git
cd youtube-transcript-mcp
# Install dependencies
npm installAs an npm Package
npm install @tanush-yadav/youtube-transcript-mcpOr using yarn:
yarn add @tanush-yadav/youtube-transcript-mcpπ Quick Start
Configuration for Claude Desktop
Add the server to your Claude Desktop configuration:
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-transcript": {
"command": "node",
"args": ["/absolute/path/to/youtube-transcript-mcp/index.js"]
}
}
}Or if installed globally via npm:
{
"mcpServers": {
"youtube-transcript": {
"command": "npx",
"args": ["@tanush-yadav/youtube-transcript-mcp"]
}
}
}π οΈ Available Tools
1. get_transcript
Extract transcript from a YouTube video with optional timestamps.
Parameters:
url(string, required): YouTube video URL or video IDinclude_timestamps(boolean, optional): Include timestamps in output (default: false)
Example Request:
{
"name": "get_transcript",
"arguments": {
"url": "https://youtube.com/watch?v=dQw4w9WgXcQ",
"include_timestamps": true
}
}Example Output with timestamps:
[00:00] We're no strangers to love
[00:04] You know the rules and so do I
[00:08] A full commitment's what I'm thinking of2. get_transcript_with_metadata
Extract transcript along with comprehensive metadata.
Parameters:
url(string, required): YouTube video URL or video ID
Example Response:
{
"metadata": {
"video_id": "dQw4w9WgXcQ",
"video_url": "https://youtube.com/watch?v=dQw4w9WgXcQ",
"word_count": 251,
"segment_count": 42,
"duration": "3:32",
"duration_seconds": 212,
"language": "en",
"is_auto_generated": false
},
"transcript": "Never gonna give you up...",
"full_transcript_length": 1234
}3. save_transcript
Save transcript to text file(s) on the local filesystem.
Parameters:
url(string, required): YouTube video URL or video IDfilename(string, required): Base filename (without extension)with_timestamps(boolean, optional): Save version with timestamps (default: true)
Example:
{
"name": "save_transcript",
"arguments": {
"url": "https://youtu.be/dQw4w9WgXcQ",
"filename": "rickroll_transcript",
"with_timestamps": true
}
}Creates files:
rickroll_transcript_clean.txt- Plain text transcriptrickroll_transcript_with_timestamps.txt- Transcript with timestamps (if enabled)
π» Programmatic Usage
As an MCP Client
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
// Initialize transport
const transport = new StdioClientTransport({
command: 'node',
args: ['/path/to/youtube-transcript-mcp/index.js'],
})
// Create client
const client = new Client({
name: 'youtube-transcript-client',
version: '1.0.0',
})
// Connect and use
await client.connect(transport)
// Get transcript with timestamps
const result = await client.callTool({
name: 'get_transcript',
arguments: {
url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
include_timestamps: true,
},
})
console.log(result.content[0].text)Direct Module Usage
// Coming soon: Direct module import support
import { YouTubeTranscriptExtractor } from '@tanush-yadav/youtube-transcript-mcp'
const extractor = new YouTubeTranscriptExtractor()
const transcript = await extractor.getTranscript('dQw4w9WgXcQ')
console.log(transcript)π Supported URL Formats
The server accepts various YouTube URL formats:
β Standard:
https://www.youtube.com/watch?v=VIDEO_IDβ Short:
https://youtu.be/VIDEO_IDβ Embed:
https://www.youtube.com/embed/VIDEO_IDβ Mobile:
https://m.youtube.com/watch?v=VIDEO_IDβ Shorts:
https://www.youtube.com/shorts/VIDEO_IDβ With timestamps:
https://youtube.com/watch?v=VIDEO_ID&t=123β With playlist:
https://youtube.com/watch?v=VIDEO_ID&list=PLAYLIST_IDβ Just video ID:
dQw4w9WgXcQ
π Usage Examples with Claude
Once configured, you can ask Claude:
"Get the transcript from https://www.youtube.com/watch?v=dQw4w9WgXcQ"
"Extract the YouTube transcript with timestamps from video ID abc123"
"Save the transcript from this video to a file: [URL]"
"Get detailed metadata and transcript from: [URL]"
"Summarize this YouTube video: [URL]" (Claude will fetch and summarize)π§ Development
Running Tests
npm testBuilding from Source
git clone https://github.com/tanush-yadav/youtube-transcript-mcp.git
cd youtube-transcript-mcp
npm install
npm run buildDevelopment Mode
npm run devTesting the MCP Server
Create a test file test-client.js:
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
const transport = new StdioClientTransport({
command: 'node',
args: ['./index.js'],
})
const client = new Client({
name: 'test-client',
version: '1.0.0',
})
await client.connect(transport)
// List available tools
const tools = await client.listTools()
console.log('Available tools:', tools)
// Test transcript extraction
const result = await client.callTool({
name: 'get_transcript',
arguments: {
url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
},
})
console.log('Transcript:', result.content[0].text)
await transport.close()π Troubleshooting
Common Issues
"No transcript available"
β Ensure the video has captions/subtitles available
β Check if the video is public and not age-restricted
β Some live streams may not have transcripts available
Connection errors
β Verify your internet connection
β Check if YouTube is accessible in your region
β Ensure Node.js version is 18.0 or higher
MCP server not found in Claude
β Verify the path in your Claude configuration is absolute
β Ensure Node.js is properly installed and in PATH
β Restart Claude Desktop after configuration changes
Permission errors when saving files
β Ensure write permissions in the target directory
β Check disk space availability
Debug Mode
Enable debug logging by setting the environment variable:
DEBUG=youtube-transcript-mcp node index.jsπ Performance
Average transcript extraction time: 1-3 seconds
Memory usage: ~50MB
Supports videos up to 12+ hours in length
Handles 1000+ segments efficiently
π€ Contributing
Contributions are welcome! Please follow these steps:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Development Guidelines
Follow existing code style
Add tests for new features
Update documentation as needed
Ensure all tests pass before submitting PR
π License
MIT License - see LICENSE file for details
π Acknowledgments
youtubei.js - Excellent YouTube API implementation
Model Context Protocol - MCP SDK and specification
Anthropic - For creating Claude and the MCP protocol
π Roadmap
Support for multiple language transcripts
Batch processing for multiple videos
Transcript translation capabilities
Export to SRT/VTT subtitle formats
Caching for improved performance
Support for playlist extraction
Real-time transcript streaming
Custom formatting options
π¬ Support
For issues, questions, or suggestions:
π Open an issue
π‘ Start a discussion
π§ Contact: tanush@cintra.run
π Changelog
[1.0.0] - 2024-01-03
π Initial release
β¨ Transcript extraction with youtubei.js
β±οΈ Timestamp support
π Metadata extraction
πΎ File saving capability
π§ MCP protocol implementation
Made with β€οΈ by the Open Source Community
Star β this repo if you find it useful!
Available Tools
3 toolsget_transcriptC
Extract transcript from a YouTube video URL or video ID
Inputs: url (required), include_timestamps.
get_transcript_with_metadataA
Extract transcript with detailed metadata including duration and word count
Inputs: url (required).
save_transcriptB
Extract and save transcript to a file
Inputs: url (required), filename (required), with_timestamps.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 3 tools
The tools are mostly distinct: one returns raw transcript, another adds metadata, and the third saves to a file. However, get_transcript and get_transcript_with_metadata overlap heavily since the latter is a superset, which could cause an agent to pick the wrong one for a simple transcript request.
All tool names follow a consistent verb_noun pattern in snake_case: get_transcript, get_transcript_with_metadata, save_transcript. The naming clearly indicates the action and target, with no mixed conventions or vague verbs.
Three tools is well-scoped for a server dedicated to YouTube transcript extraction. Each tool serves a clear purposeβbasic retrieval, retrieval with metadata, and saving to fileβwithout unnecessary bloat.
The core workflow of extracting and saving transcripts is covered. Minor gaps exist such as language selection, timestamped segments, or listing available transcript tracks, but these are extensions rather than fundamental missing pieces for the stated purpose.
Maintenance
Related MCP Connectors
Fetch YouTube transcripts with timestamps, search history, and export data for AI models.
YouTube transcripts for AI agents: captions with timestamps, languages, TXT, SRT and VTT export.
Transcripts from YouTube videos, whole channels and playlists for AI agents, with bulk ZIP export.
Transcripts of YouTube videos, playlists and channels with timestamps; SRT or WebVTT too.
Related MCP Servers
- AlicenseAqualityDmaintenanceRetrieves 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.42114 npm16MIT
- AlicenseBqualityDmaintenanceEnables extraction of transcripts, keyword-based video search with metadata retrieval, and channel information discovery from YouTube videos through natural language interaction.34MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to fetch YouTube video transcripts with precise timestamps, multi-language support, and time-range filtering.31MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with YouTube videos by fetching transcripts, summarizing content, and answering questions based on video context.-