YouTube Tools MCP Server
Uses YouTube Data API v3 from Google Cloud Console for video search functionality with advanced filtering by date, duration, quality, and view count.
Uses RapidAPI's YouTube Transcripts API to extract complete transcripts from YouTube videos with support for multiple languages.
Enables searching for YouTube videos using the YouTube Data API v3, extracting full transcripts from videos with timestamp segments and multi-language support, and storing/retrieving video summaries in a local database.
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 Tools MCP Serverget transcript for the latest SpaceX launch video"
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 Tools MCP Server
A powerful Model Context Protocol (MCP) server that enables AI assistants to search YouTube and extract video transcripts. Built with TypeScript and designed for seamless integration with Claude Desktop and other MCP-compatible clients.
šÆ What is this?
This MCP server bridges the gap between AI assistants and YouTube content by providing comprehensive YouTube integration capabilities. It allows you to:
Search YouTube videos using the official YouTube Data API v3
Extract full transcripts from any YouTube video (when available)
Store and retrieve video summaries using a local libsql database
Filter search results by date, duration, quality, and more
Get timestamped transcript segments for precise referencing
Support multiple languages for international content
Handle various YouTube URL formats automatically
Perfect for content discovery, analysis, research, accessibility, and AI-powered video content workflows.
Related MCP server: mcp-server-youtube
⨠Features
š YouTube Video Search: Search YouTube using the official YouTube Data API v3
š¬ YouTube Transcript Extraction: Get complete transcripts from YouTube videos using RapidAPI
š¾ Video Summary Storage: Store and retrieve video summaries using local libsql database
šÆ Advanced Search Filters: Filter by date, duration, quality, view count, and more
š Flexible Input Formats: Supports video IDs, full URLs, short URLs, and embed URLs
š Multi-Language Support: Extract transcripts in different languages when available
ā” Smart Error Handling: Comprehensive error handling with clear, actionable messages
š ļø MCP Protocol Compliant: Built with the official MCP SDK for maximum compatibility
š Official API Integration: Uses YouTube Data API v3 and RapidAPI for reliable service
š» CLI Tool Included: Command-line interface for direct transcript extraction
š Quick Start
Prerequisites
Node.js 18+
pnpm (recommended) or npm
Claude Desktop (for usage)
YouTube Data API v3 Key (for search functionality)
RapidAPI Account (for transcript extraction)
Installation
Clone and install dependencies:
git clone <repository-url> cd youtube-tools-mcp pnpm installSet up API Keys:
YouTube Data API v3 (for search):
Go to Google Cloud Console
Create a new project or select existing one
Enable the YouTube Data API v3
Create credentials (API key)
Copy your YouTube API key
RapidAPI (for transcripts):
Subscribe to the API (free tier available)
Copy your RapidAPI key
Configure environment:
# Create .env file and add your API keys: YOUTUBE_API_KEY=your_youtube_api_key_here RAPIDAPI_KEY=your_rapidapi_key_here # Optional: Specify custom database path for video summaries DATABASE_PATH=./video_summaries.dbBuild the project:
pnpm run buildTest your setup:
node temp/test-rapidapi.jsConfigure Claude Desktop:
Add to your Claude Desktop config file (
~/Library/Application Support/Claude/claude_desktop_config.json):{ "mcpServers": { "youtube-tools": { "command": "node", "args": ["/absolute/path/to/youtube-tools-mcp/build/index.js"], "env": { "YOUTUBE_API_KEY": "your_youtube_api_key_here", "RAPIDAPI_KEY": "your_rapidapi_key_here", "DATABASE_PATH": "/absolute/path/to/youtube-tools-mcp/video_summaries.db" } } } }Important:
Replace
/absolute/path/to/youtube-tools-mcpwith your actual project pathReplace the API keys with your actual keys
The
DATABASE_PATHis optional - if omitted, it defaults tovideo_summaries.dbin the project root
Restart Claude Desktop completely.
Test it out! Try asking Claude:
"Get the transcript for this YouTube video: https://www.youtube.com/watch?v=2nkiHeoPTqQ"
š» CLI Usage
You can also use the included command-line tool:
# Basic usage
node cli.js 2nkiHeoPTqQ
# With full URL
node cli.js "https://www.youtube.com/watch?v=2nkiHeoPTqQ"
# Specify language
node cli.js 2nkiHeoPTqQ --language es
# Save to file
node cli.js 2nkiHeoPTqQ --output transcript.txt
# JSON format
node cli.js 2nkiHeoPTqQ --json
# Hide timestamps
node cli.js 2nkiHeoPTqQ --no-timestamps
# Show help
node cli.js --helpš Usage Examples
Once configured with Claude Desktop, you can use natural language to interact with YouTube:
Search Examples
Basic search:
"Search YouTube for 'javascript tutorial' videos"Search with filters:
"Find recent React tutorials from the last month, ordered by view count"Search for specific content:
"Search for Python programming videos that are medium length and high definition"Transcript Examples
Get transcript from URL:
"Get the transcript for this YouTube video: https://www.youtube.com/watch?v=2nkiHeoPTqQ"Use just the video ID:
"Extract transcript from YouTube video ID 2nkiHeoPTqQ"Specify language:
"Get the Spanish transcript for this video: https://www.youtube.com/watch?v=example"Works with different URL formats:
Full URL:
https://www.youtube.com/watch?v=dQw4w9WgXcQShort URL:
https://youtu.be/dQw4w9WgXcQEmbed URL:
https://www.youtube.com/embed/dQw4w9WgXcQVideo ID:
dQw4w9WgXcQ
Video Summary Examples
Store a video summary:
"Store this summary for video dQw4w9WgXcQ: This is a classic music video featuring Rick Astley's hit song Never Gonna Give You Up."Retrieve a stored summary:
"Get the stored summary for video ID dQw4w9WgXcQ"Check if a summary exists:
"Do we have a summary stored for this YouTube video: https://www.youtube.com/watch?v=dQw4w9WgXcQ"š§ Available Tools
search_youtube
Search for YouTube videos using the official YouTube Data API v3.
Parameters:
query(required): Search query for YouTube videosmaxResults(optional): Maximum number of results to return (1-50, default: 10)order(optional): Order of results - "relevance", "date", "rating", "viewCount", "title" (default: "relevance")publishedAfter(optional): Return videos published after this date (RFC 3339 format)publishedBefore(optional): Return videos published before this date (RFC 3339 format)videoDuration(optional): Filter by duration - "any", "short", "medium", "long" (default: "any")videoDefinition(optional): Filter by definition - "any", "high", "standard" (default: "any")
Sample Output:
YouTube Search Results for: "javascript tutorial"
š Total Results Available: 1000000
š Results Returned: 3
š Ordered by: relevance
--- SEARCH RESULTS ---
1. **JavaScript Tutorial for Beginners**
šŗ Channel: Programming with Mosh
š
Published: 1/15/2023
š URL: https://www.youtube.com/watch?v=W6NZfCO5SIk
š Video ID: W6NZfCO5SIk
š Description: Learn JavaScript fundamentals in this comprehensive tutorial...
2. **Modern JavaScript Course**
šŗ Channel: The Net Ninja
š
Published: 3/22/2023
š URL: https://www.youtube.com/watch?v=iWOYAxlnaww
š Video ID: iWOYAxlnaww
š Description: Master modern JavaScript with this complete course...get_youtube_transcript
Extract complete transcripts from YouTube videos using RapidAPI.
Parameters:
videoId(required): YouTube video ID or any YouTube URL formatlanguage(optional): Language code for transcript (e.g., "en", "es", "fr", default: "en")
Sample Output:
YouTube Transcript for Video ID: W6NZfCO5SIk
š Total Segments: 245
ā±ļø Duration: 1:23:45
--- TRANSCRIPT ---
[0:00] Welcome to this JavaScript tutorial for beginners
[0:05] In this video we're going to learn the fundamentals
[0:12] Let's start with variables and data types
...storeVideoSummary
Store or update a video summary in the local database.
Parameters:
videoId(required): YouTube video IDsummary(required): Video summary text to store
Sample Output:
Successfully stored summary for video ID: W6NZfCO5SIkfetchExistingVideoSummary
Fetch an existing video summary from the local database.
Parameters:
videoId(required): YouTube video ID
Sample Output:
Summary for video ID: W6NZfCO5SIk
This is a comprehensive JavaScript tutorial covering fundamentals like variables, functions, and DOM manipulation. Perfect for beginners looking to learn modern JavaScript development.Note: Returns "No summary found" if no summary exists for the given video ID.
š ļø Development
Available Scripts
pnpm run build- Compile TypeScript to JavaScriptpnpm run dev- Watch mode for development (auto-rebuild on changes)pnpm start- Run the compiled server directlypnpm run test- Test YouTube transcript functionalitypnpm run test-mcp- Test MCP server functionalitypnpm run test-search- Test YouTube search API functionalitypnpm run test-mcp-search- Test MCP server with search functionality
Project Structure
youtube-tools-mcp/
āāā src/
ā āāā index.ts # Main MCP server implementation
ā āāā database.ts # Database service for video summaries
āāā build/ # Compiled JavaScript output
āāā docs/ # Documentation and examples
āāā temp/ # Test files and utilities
āāā video_summaries.db # Local libsql database (auto-created)
āāā package.json # Dependencies and scripts
āāā .env.example # Environment variables template
āāā README.md # This fileTesting
Test the server functionality:
# Test YouTube transcript extraction
pnpm run test
# Test YouTube search API
pnpm run test-search
# Test MCP server protocol
pnpm run test-mcp
# Test MCP server with search functionality
pnpm run test-mcp-search
# Test database functionality (video summary storage/retrieval)
node temp/test-database-functionality.js
# Manual server test (runs until Ctrl+C)
pnpm startā ļø Error Handling
The server provides clear error messages for common scenarios:
Error | Cause | Solution |
"Transcript is disabled" | Video creator disabled transcripts | Try a different video |
"No transcript found" | No transcript in requested language | Try "en" or check available languages |
"Video unavailable" | Private, deleted, or restricted video | Verify the video is public and accessible |
"Invalid video ID" | Malformed URL or ID | Check the YouTube URL format |
š§ Troubleshooting
Server not appearing in Claude Desktop?
Verify the absolute path in your config is correct
Ensure the project built successfully (
pnpm run build)Restart Claude Desktop completely
Check Claude's logs:
~/Library/Logs/Claude/mcp*.log
Tool calls failing?
Test the server manually:
pnpm startVerify the video has transcripts available
Try with a different video
Check the video is public and not region-restricted
š¦ Dependencies
@modelcontextprotocol/sdk - Official MCP SDK for TypeScript
@libsql/client - libsql client for local database storage
axios - HTTP client for API requests
š¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
š License
MIT License - see LICENSE file for details.
Built with ā¤ļø using the Model Context Protocol
Available Tools
4 toolsfetchExistingVideoSummaryA
Fetch an existing video summary from the database
| Name | Required | Description | Default |
|---|---|---|---|
| videoId | Yes | YouTube video ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description reveals no details about return values, error handling, or behavior when no summary exists. Without annotations (readOnlyHint, destructiveHint), the agent has no explicit indication that this is a safe read operation, though the word 'fetch' implies it. It also does not mention prerequisites like a valid videoId or database accessibility.
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 that directly states the tool's action without unnecessary words. It earns a high score for conciseness and clarity.
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?
For a simple one-parameter retrieval tool, the description gives the core purpose but omits outcome details such as whether a missing summary returns null or an error. Since there is no output schema, the agent must infer the return type, leaving some ambiguity in edge cases. This is adequate but not fully complete.
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 fully documents the single parameter videoId as 'YouTube video ID', so the description need not elaborate. The description itself does not mention the parameter, but the schema covers it adequately; baseline 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 clearly states the tool's function: fetching an existing summary from a database. It distinguishes from siblings (get transcript, search, store) by specifying 'existing video summary' and 'database', making its purpose unmistakable.
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 implies usage when a videoId is available and a previously stored summary is needed, but it does not explicitly reference alternative tools or state when not to use it. Sibling tools like get_youtube_transcript and storeVideoSummary are absent from the guidance, so the agent must infer usage context from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_youtube_transcriptB
Extract transcript from a YouTube video
| Name | Required | Description | Default |
|---|---|---|---|
| videoId | Yes | YouTube video ID or full YouTube URL | |
| language | No | Language code for transcript (optional, e.g., "en", "es", "fr") | en |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry behavioral transparency. It does not disclose expected output format, limitations (e.g., language availability, video accessibility), or whether the tool returns plain text, timestamps, or a structured object. The description adds no behavioral details beyond what the tool name implies.
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 efficiently communicates the primary purpose, earning a high score for conciseness.
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 is relatively simple with two parameters and no annotations or output schema, but the description is too sparse to be complete. It does not explain what the transcript output looks like, how language is handled, or any edge cases, leaving meaningful gaps for an agent.
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% (both videoId and language have descriptions), so the schema fully documents parameters. The description adds no extra meaning about parameters, but baseline 3 is appropriate because the schema handles the heavy lifting.
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 'Extract' and a clear resource ('transcript from a YouTube video'), which immediately distinguishes it from siblings like search_youtube, fetchExistingVideoSummary, and storeVideoSummary. There is no ambiguity about what the tool does.
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 provides no guidance on when to use this tool versus alternatives, no prerequisites, and no examples. It merely states the action without contextualizing scenarios (e.g., when a user needs transcript text vs. a summary).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_youtubeB
Search for YouTube videos using the YouTube Data API v3
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | Order of results (relevance, date, rating, viewCount, title) | relevance |
| query | Yes | Search query for YouTube videos | |
| maxResults | No | Maximum number of results to return (1-50, default: 10) | |
| videoDuration | No | Filter by video duration | any |
| publishedAfter | No | Return videos published after this date (RFC 3339 format, e.g., '2023-01-01T00:00:00Z') | |
| publishedBefore | No | Return videos published before this date (RFC 3339 format, e.g., '2024-01-01T00:00:00Z') | |
| videoDefinition | No | Filter by video definition | any |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose whether this operation is read-only, requires authentication, has rate limits, or returns certain data. It only mentions the API name, giving no behavioral transparency beyond what is obvious from the tool name.
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?
A single, direct sentence that states the tool's purpose without waste. It is front-loaded and appropriately concise for a simple search tool.
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?
With seven parameters, no annotations, and no output schema, the description does not explain return values, result format, or operational constraints. It provides no context about pagination, sorting defaults, or how results relate to sibling tools, making it insufficiently complete.
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?
All seven parameters are documented in the schema with descriptions, including enums and defaults. The description adds no parameter-specific information beyond the schema, so the baseline of 3 applies.
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 a specific action (search) on a specific resource (YouTube videos) and names the underlying API. This distinguishes it from sibling tools that handle transcripts and summaries.
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 provides no guidance on when to use this tool versus alternatives like get_youtube_transcript or storeVideoSummary. There are no exclusions or contextual hints beyond the basic search function.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
storeVideoSummaryB
Store or update a video summary in the database
| Name | Required | Description | Default |
|---|---|---|---|
| summary | Yes | Video summary text to store | |
| videoId | Yes | YouTube video ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full behavioral burden. It states the write intent but fails to disclose key details such as whether an existing summary is overwritten, whether it upserts vs. inserts, required permissions, or what the response looks like. The ambiguous 'store or update' phrasing leaves uncertainty.
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 sentence with no filler, immediately conveying the core function. It is appropriately sized and front-loaded with the action.
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?
Even though the tool is simple with two params and full schema coverage, the absence of annotations and output schema leaves the description incomplete. It does not explain upsert/overwrite behavior, return values, or error conditions, which are essential for reliable invocation.
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 both parameters fully described in the input schema. The description adds no additional semantic detail beyond the schema, so the baseline 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 clearly identifies the verb ('Store or update') and resource ('video summary in database'), and the write intent distinguishes it from sibling read/search tools like fetchExistingVideoSummary and get_youtube_transcript. This makes the purpose unambiguous and specific.
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 implies usage for persisting a summary, and the read/write distinction from siblings is apparent, but it does not explicitly state when to use this tool vs alternatives or provide any exclusions. No alternative tools are named for update/creation scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
fetchExistingVideoSummary - First observed
get_youtube_transcript - First observed
search_youtube - First observed
storeVideoSummary
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: searching YouTube, fetching transcripts, and retrieving/storing summaries. There is no overlap between tool responsibilities, so an agent can easily select the correct tool for a task.
The tool names mix conventions: 'get_youtube_transcript' and 'search_youtube' use snake_case and include 'youtube', while 'fetchExistingVideoSummary' and 'storeVideoSummary' use camelCase and omit the service name. The inconsistent verb choices (get vs fetch, store vs search) further reduce predictability.
With only 4 tools, the server is tightly scoped to its purpose of YouTube video search, transcript retrieval, and summary management. Each tool is necessary and there is no bloat, making the count appropriate for the domain.
The tool set covers the core workflows: search, transcript, and summary storage/retrieval. A delete summary tool is missing, but the store operation handles both create and update, so the surface is largely complete for the implied use case.
Maintenance
Related MCP Connectors
Search YouTube, read video metadata, and fetch transcripts with language preferences
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents. No signup.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables interaction with YouTube through search and transcript extraction functionality. Allows searching for videos and retrieving full transcripts with timestamps for content analysis.27-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search videos, read channels, browse playlists, fetch comments, and get transcripts from YouTube using the YouTube Data API v3 and InnerTube API for captions.2GPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search videos, channels, and playlists, retrieve video metadata, transcripts, and comments via the YouTube Data API v3.71MIT
- AlicenseAqualityDmaintenanceEnables AI tools to access YouTube content, including transcript extraction, video/channel info, and search.413 npmMIT