YouTube MCP Server
Enables GitHub Copilot to access YouTube data, including video search, details, comments, and transcripts.
Provides tools to search YouTube videos, retrieve video metadata, comments, transcripts, and available caption languages.
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 MCP Serversearch for recent Python tutorials"
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 MCP Server
An MCP (Model Context Protocol) server that provides YouTube video data to AI agents like GitHub Copilot, Claude Desktop, and Cursor.
Supports both stdio (local) and Streamable HTTP (VPS/remote) transports.
Features
Tool | Description |
| Search videos with filters for upload date and popularity |
| Video metadata: title, views, likes, upload date, duration, tags, description |
| Comment threads with full replies, author info, and likes |
| Transcripts (manual + auto-generated captions) with timestamps |
| Lists available manual and auto-generated caption languages |
Related MCP server: yt
Prerequisites
Node.js 18+
No YouTube API key required! This server uses
youtubei.js(YouTube's InnerTube API) for video info, comments, and search, andyoutube-transcript-plusfor transcripts. Both work without any API key or authentication.
Setup
# Clone and install
cd youtube-mcp
npm install
# Build
npm run buildOption 1: Local (stdio) — Default
This is the simplest setup. The MCP client spawns the server as a subprocess.
npm startGitHub Copilot (VS Code)
Add to your VS Code settings.json:
{
"mcp": {
"servers": {
"youtube": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"]
}
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"youtube": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"]
}
}
}Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"youtube": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"]
}
}
}Option 2: VPS Deployment (Streamable HTTP)
For remote deployment, the server runs as a persistent HTTP service using the Streamable HTTP transport (the current MCP standard, replacing the deprecated SSE transport).
1. Deploy to your VPS
# On your VPS
git clone <your-repo-url> youtube-mcp
cd youtube-mcp
npm install
npm run build
# Create .env (optional, for HTTP mode)
cp .env.example .env
# Uncomment TRANSPORT=http, PORT, HOST as needed2. Run with HTTP transport
# Using --http flag
node dist/index.js --http
# Or using environment variable
TRANSPORT=http PORT=3000 node dist/index.js
# Or using npm script
npm run start:httpThe server will listen on http://0.0.0.0:3000/mcp.
3. Set up Nginx reverse proxy with TLS
server {
listen 443 ssl;
server_name mcp.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/mcp.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mcp.yourdomain.com/privkey.pem;
location /mcp {
proxy_pass http://127.0.0.1:3000/mcp;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Required for SSE streaming
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding on;
}
}Get a free TLS certificate:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d mcp.yourdomain.com4. Keep it running with systemd
Create /etc/systemd/system/youtube-mcp.service:
[Unit]
Description=YouTube MCP Server
After=network.target
[Service]
Type=simple
User=your_user
WorkingDirectory=/path/to/youtube-mcp
ExecStart=/usr/bin/node dist/index.js --http
Restart=always
RestartSec=5
Environment=TRANSPORT=http
Environment=PORT=3000
Environment=HOST=127.0.0.1
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable youtube-mcp
sudo systemctl start youtube-mcp
sudo systemctl status youtube-mcp5. Connect MCP clients to your VPS
GitHub Copilot (VS Code) — Remote
{
"mcp": {
"servers": {
"youtube": {
"type": "http",
"url": "https://mcp.yourdomain.com/mcp"
}
}
}
}Claude Desktop — Remote
{
"mcpServers": {
"youtube": {
"type": "streamable-http",
"url": "https://mcp.yourdomain.com/mcp"
}
}
}Usage Examples
Once connected, you can ask your AI agent things like:
"Get info about this YouTube video: https://www.youtube.com/watch?v=dQw4w9WgXcQ"
"Show me the top comments on video ID abc123"
"Get the transcript of this video in English"
"Summarize the transcript of https://youtu.be/xyz789"
"Search for Node.js tutorials uploaded this week, sorted by views"
"Find the most popular React videos from the last month"
Tool Response Format
All tools return:
content: short human-readable text for chat-style MCP clientsstructuredContent: JSON-shaped data for agents that need reliable fields
The server is intentionally JSON-first, text-second. Agents should prefer structuredContent when they need to filter, transform, or chain tool results.
Example shape from get_video_info:
{
"content": [
{
"type": "text",
"text": "📹 Example title\n\nChannel: Example channel\n..."
}
],
"structuredContent": {
"videoId": "dQw4w9WgXcQ",
"title": "Example title",
"description": "Example description",
"channelName": "Example channel",
"channelId": "UC123",
"uploadedAt": "1 year ago",
"duration": "3m 33s",
"viewCount": "123456",
"likeCount": "7890",
"commentCount": "456",
"tags": ["music", "pop"],
"thumbnailUrl": "https://..."
}
}Tool Details
search_youtube
Input:
query(search text),maxResults(1-50, default 10),sortBy(relevance|date|viewCount|rating),uploadDate(any|hour|today|week|month|year),videoDuration(any|short|medium|long)Returns: Human-readable summary in
contentplus structured JSON results instructuredContent
get_video_info
Input:
video(YouTube URL or video ID)Returns: Human-readable summary in
contentplus structured JSON metadata instructuredContent
get_video_comments
Input:
video(URL or ID),maxResults(1-20, default 20),sortBy(relevanceortime),page(default 1)Returns: Human-readable summary in
contentplus structured JSON comment threads, pagination fields, andhasMoreinstructuredContent
get_video_transcript
Input:
video(URL or ID),lang(language code, defaulten),maxSegments(default0for all),startSegment(default0)Returns: Human-readable transcript in
contentplus structured JSON segments, plain text, and pagination metadata instructuredContentNote: Does NOT require an API key — works via YouTube's internal caption system
get_transcript_languages
Input:
video(YouTube URL or video ID)Returns: Human-readable language list in
contentplus structured JSON language metadata instructuredContent
Rate Limits
This server uses YouTube's InnerTube API (the same API used by youtube.com). There are no official API quotas, but:
Heavy automated usage may trigger CAPTCHAs or temporary blocks
Use responsibly — add delays between bulk requests if needed
All tools are free with no API key required
License
ISC
Available Tools
5 toolsget_transcript_languagesA
List all available caption/transcript languages for a YouTube video. Returns language codes and names for both manual and auto-generated captions. Call this first to discover available languages before fetching a transcript.
| Name | Required | Description | Default |
|---|---|---|---|
| video | Yes | YouTube video URL or video ID |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | No | |
| videoId | Yes | |
| available | Yes | |
| languages | Yes | |
| manualCount | Yes | |
| totalTracks | Yes | |
| autoGeneratedCount | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but description covers return values (language codes and names) and scope (both manual and auto-generated). Lacks discussion of authentication or rate limits, but these are reasonable defaults for a listing tool.
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?
Two sentences: first states main purpose, second adds detail and usage guidance. No wasted words.
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?
Output schema exists to document return format. Description fully covers purpose, usage, and behavioral aspects for this simple discovery tool.
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 a single parameter already described as 'YouTube video URL or video ID'. Description adds no new semantic detail beyond the schema.
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 lists available caption/transcript languages for a YouTube video, specifying both manual and auto-generated. It distinguishes itself from sibling tools like get_video_transcript and get_video_info.
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?
Explicitly instructs to call this first before fetching a transcript, providing clear when-to-use guidance and implying when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_video_commentsA
Get YouTube video comments with replies. Returns comment text, author, likes, and date. Supports sorting by 'relevance' (top comments) or 'time' (newest). Returns error if comments are disabled.
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination. Each page returns up to 20 comment threads. Use hasMore in the response to know if more pages exist. | |
| video | Yes | YouTube video URL or video ID | |
| sortBy | No | Sort order: 'relevance' (top comments) or 'time' (newest first) | relevance |
| maxResults | No | Number of comment threads per page (1-20, YouTube returns ~20 per page) |
Output Schema
| Name | Required | Description |
|---|---|---|
| page | Yes | |
| sortBy | Yes | |
| hasMore | Yes | |
| threads | Yes | |
| videoId | Yes | |
| threadCount | Yes | |
| totalFetched | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, description carries full burden. Covers sorting options and error case (disabled comments), but omits authentication needs, rate limits, or response structure details beyond basic fields. Incomplete for an unaided tool.
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?
Extremely concise: two sentences covering purpose, output, sorting, and error. No filler or redundancy.
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?
Output schema exists, so return structure is not required. However, description lacks guidance on pagination strategy or how to handle multiple pages. Usage context is minimal given four parameters and a pagination mechanism.
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%, so baseline 3. Description mentions sorting and error but adds little beyond schema descriptions (e.g., schema already says maxResults=20 per page). No new parameter insights.
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?
Clearly states the tool retrieves YouTube video comments with replies, listing returned fields (text, author, likes, date). Distinct from sibling tools like get_video_info, get_video_transcript, or search_youtube.
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?
Description implies use when you want comments, but no explicit when-to-use or when-not-to-use. No mention of alternatives (e.g., use search_youtube for finding videos). Lacks exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_video_infoA
Get YouTube video metadata: title, views, likes, comment count, upload date, duration, tags, and description. Input: YouTube URL or video ID. Returns error message if video is private, deleted, or unavailable.
| Name | Required | Description | Default |
|---|---|---|---|
| video | Yes | YouTube video URL or video ID |
Output Schema
| Name | Required | Description |
|---|---|---|
| tags | Yes | |
| title | Yes | |
| videoId | Yes | |
| duration | Yes | |
| channelId | Yes | |
| likeCount | Yes | |
| viewCount | Yes | |
| uploadedAt | Yes | |
| channelName | Yes | |
| description | Yes | |
| commentCount | Yes | |
| thumbnailUrl | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It explains the tool returns metadata fields and an error message for unavailable videos. However, it does not mention authentication requirements, rate limits, or whether the tool is read-only. Since it implies a read operation without explicit safety guarantees, a 3 is appropriate.
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?
Two sentences convey purpose, input, and error behavior without redundancy. The most critical information is front-loaded. Every sentence serves a clear function, making it highly efficient.
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 (1 parameter, has output schema), the description comprehensively covers input format, returned metadata fields, and possible error scenarios. The presence of an output schema means return value details are omitted appropriately. No gaps remain for a basic metadata retrieval tool.
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% for the single 'video' parameter, with description already stating 'YouTube URL or video ID.' The tool description repeats this exact information without adding new details like allowed URL formats or examples. Thus, description adds no extra value beyond the schema, meeting the baseline of 3.
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 'Get YouTube video metadata' and lists specific fields (title, views, likes, comment count, upload date, duration, tags, and description). This verb+resource+scope approach distinguishes it from sibling tools like get_video_transcript or search_youtube, which serve different purposes.
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?
Description explicitly specifies input format: 'YouTube URL or video ID.' It also notes error conditions (private, deleted, unavailable). While it doesn't directly compare to siblings, the sibling names make usage context clear, and the input guidance is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_video_transcriptA
Get YouTube video transcript/captions (manual or auto-generated) with timestamps. Use 'lang' to specify language code (e.g. 'en', 'id'). Returns both timestamped and plain text versions. Returns error if captions are unavailable.
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language code for the transcript (e.g., 'en', 'id', 'ja') | en |
| video | Yes | YouTube video URL or video ID | |
| maxSegments | No | Maximum number of transcript segments to return. 0 (default) returns all segments. Use with startSegment for pagination. | |
| startSegment | No | Segment index to start from (0-based). Use with maxSegments to paginate through long transcripts. |
Output Schema
| Name | Required | Description |
|---|---|---|
| hasMore | Yes | |
| message | No | |
| videoId | Yes | |
| segments | Yes | |
| available | Yes | |
| plainText | Yes | |
| languageCode | Yes | |
| startSegment | Yes | |
| totalSegments | Yes | |
| nextStartSegment | Yes | |
| returnedSegments | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behavior. It reveals it returns both timestamped and plain text versions, supports auto-generated and manual captions, and errors if captions are unavailable. This is good coverage, though it doesn't mention rate limits or auth requirements.
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?
Two concise sentences, no fluff, front-loaded with primary purpose. Every word earns its place.
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 presence of an output schema, the description need not detail return values. It covers key aspects: source (YouTube video), type (transcript/captions), and error case. Lacks mention of pagination support but that is handled by parameter descriptions.
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%, so the schema already documents all parameters. Description adds minimal extra meaning beyond what schema provides (e.g., language code examples). Baseline 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?
Description clearly states it gets YouTube video transcript/captions with timestamps. It distinguishes from sibling tools like get_transcript_languages (which lists languages) and get_video_comments (which gets comments).
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?
Description mentions language code specification and error behavior but does not explicitly guide when to use this tool vs alternatives like get_transcript_languages for listing available languages. Usage context is implied but not explicitly stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_youtubeA
Search YouTube videos by query. Returns up to 50 results with title, channel, views, duration, and URL. Supports filtering by uploadDate (today/week/month/year) and videoDuration (short/medium/long), and sorting by relevance, date, viewCount, or rating.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string | |
| sortBy | No | Sort order: 'relevance' (default), 'date' (newest), 'viewCount' (most popular), 'rating' (highest rated) | relevance |
| maxResults | No | Maximum number of results to return (1-50) | |
| uploadDate | No | Filter by upload date: 'any', 'hour', 'today', 'week', 'month', 'year' | any |
| videoDuration | No | Filter by duration: 'any', 'short' (<3min), 'medium' (3-20min), 'long' (>20min) | any |
Output Schema
| Name | Required | Description |
|---|---|---|
| query | Yes | |
| sortBy | Yes | |
| results | Yes | |
| uploadDate | Yes | |
| resultCount | Yes | |
| videoDuration | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility. It discloses return fields and limits (up to 50 results) and filtering options, but does not mention authentication, rate limits, or error handling. This is adequate but not comprehensive.
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 two sentences: first states purpose and output, second lists filters and sorting. No redundant information. Every sentence serves a purpose.
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 presence of an output schema, the description does not need to detail return values extensively. It covers the main functionality: querying, filtering, sorting, and result limits. Missing details like pagination or language filters are acceptable given the schema coverage.
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%, so baseline is 3. The description adds value by summarizing the return fields (title, channel, views, duration, URL) and the purpose of filters, which goes beyond the schema's parameter descriptions. However, it does not add detail per parameter beyond restating options.
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 'Search YouTube videos by query', which is a specific verb and resource. It distinguishes itself from sibling tools like get_video_transcript or get_video_comments, which serve different purposes.
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 does not explicitly contrast with sibling tools. While the sibling list implies this tool is for searching, no guidance is given on when to use search_youtube versus other tools like get_video_info. The usage context is implied but not stated.
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.
5 tool updates
v1.0.0- First observed
get_transcript_languages - First observed
get_video_comments - First observed
get_video_info - First observed
get_video_transcript - First observed
search_youtube
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: transcript languages, comments, video metadata, transcript, and search. No overlap or ambiguity.
All tools follow a consistent verb_noun pattern ('get_*' for data retrieval, 'search_youtube' for search). The pattern is uniform and predictable.
5 tools is well-scoped for a YouTube MCP server. Each tool covers a core operation without unnecessary bloat or deficiency.
The tool set covers the essential read operations for YouTube video data: search, metadata, comments, and transcripts with language discovery. No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents. No signup.
💯 The fastest YouTube transcript + YouTube search MCP for AI agents. Try for free.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that provides AI assistants with powerful tools to interact with YouTube, including video searching, transcript extraction, comment retrieval, and more.819Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that provides YouTube data access without API keys or quotas. It enables agents to search videos, retrieve transcripts and metadata, and perform full-text search across cached content for AI context retrieval.3-
- AlicenseAqualityDmaintenanceMCP server that lets AI agents search YouTube and fetch transcripts.23MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for YouTube that provides tools to fetch video metadata and transcripts, enabling natural language queries about YouTube videos.2-