YouTube Data MCP Server
Extract YouTube video transcripts, comments, video info, and search results.
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 Data MCP Server get transcript for https://youtube.com/watch?v=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 Data MCP Server
A Model Context Protocol (MCP) server for extracting YouTube video transcripts, comments, and search results. Supports both Stdio and StreamableHTTP transports.
Features
getTranscript- Extract subtitles/transcripts with optional timestampsgetVideoInfo- Get video metadata (title, views, comments count)getComments- Fetch comments with pagination and sortinggetCommentReplies- Get replies to specific commentssearchYoutube- Search videos, channels, and playlists
Related MCP server: youtube-summarize
What's New in v2.0
Dual Transport: Stdio (default) + StreamableHTTP for web integration
Reliable Transcripts: Replaced
youtube-transcriptwithyoutube-caption-extractor(bot detection bypass, serverless support)Timestamp Support: Optional start time and duration for each transcript segment
Modular Architecture: Clean separation of concerns (config, types, services, tools)
MCP SDK v1.25.2: Latest SDK with improved stability
Requirements
Node.js 18+
SerpAPI key (for search, comments, video info)
Installation
git clone https://github.com/diasm3/serpapi-youtube-mcp-server.git
cd serpapi-youtube-mcp-server
npm installConfiguration
Create a .env file:
SERPAPI_KEY=your_serpapi_key_here
PORT=3000 # optional, for HTTP modeGet your SerpAPI key at serpapi.com.
Running the Server
# Build
npm run build
# Stdio mode (default) - for Claude Desktop, Cursor, etc.
npm start
# HTTP mode - for web applications
npm start -- --http
# or
MCP_TRANSPORT=http npm startHTTP Endpoints
When running in HTTP mode:
GET /health- Health checkPOST /mcp- MCP request handler
MCP Client Configuration
Claude Desktop / Cursor
{
"mcpServers": {
"youtube-data": {
"command": "node",
"args": ["/path/to/serpapi-youtube-mcp-server/build/index.js"],
"env": {
"SERPAPI_KEY": "your_serpapi_key_here"
}
}
}
}Using npx
{
"mcpServers": {
"youtube-data": {
"command": "npx",
"args": ["-y", "youtube-data-mcp"],
"env": {
"SERPAPI_KEY": "your_serpapi_key_here"
}
}
}
}API Tools
getTranscript
Extract transcript/subtitles from a YouTube video.
Parameter | Type | Required | Description |
| string | Yes | YouTube URL or video ID |
| string | No | Language code (default: 'en') |
| boolean | No | Include start/duration per segment |
Get the Korean transcript for https://youtube.com/watch?v=xxxxx with timestampsgetVideoInfo
Get video metadata using SerpAPI.
Parameter | Type | Required | Description |
| string | Yes | YouTube URL or video ID |
Returns: title, views, publish date, channel, comment count, pagination tokens
getComments
Fetch video comments with pagination.
Parameter | Type | Required | Description |
| string | Conditional | Required for first page |
| number | No | Max comments (default: 100) |
| string | No | 'relevance' or 'time' |
| string | No | For pagination |
getCommentReplies
Get replies to a specific comment.
Parameter | Type | Required | Description |
| string | Yes |
|
searchYoutube
Search YouTube for videos, channels, playlists.
Parameter | Type | Required | Description |
| string | Yes | Search query |
| number | No | Max results (default: 10) |
| string | No | Country code (us, kr, jp) |
| string | No | Language code (en, ko, ja) |
| string | No | Filter parameter |
| string | No | For pagination |
Project Structure
src/
├── index.ts # Server entry (Stdio + HTTP)
├── config/ # Environment configuration
├── types/ # Zod schemas + TypeScript types
├── services/
│ ├── serpapi.ts # SerpAPI integration
│ └── youtube.ts # Transcript extraction
├── tools/ # MCP tool definitions
└── utils/ # Helper functionsTroubleshooting
Transcript not available
Some videos don't have captions enabled
Try different language codes (en, ko, ja, etc.)
Auto-generated captions may not be available for all videos
SerpAPI errors
Verify your API key is valid
Check your SerpAPI quota/limits
Ensure the video is publicly accessible
HTTP mode not starting
Check if PORT is already in use
Verify environment variables are set
License
MIT
Available Tools
5 toolsgetCommentRepliesA
Fetch replies to a specific YouTube comment. Use repliesToken from getComments response.
Inputs: pageToken (required).
getCommentsA
Fetch YouTube video comments with pagination. Supports sorting by relevance or time. Use nextPageToken for pagination.
Inputs: url, sort, limit, pageToken.
getTranscriptA
Extract transcript/subtitles from a YouTube video. Returns full text with video metadata. Supports multiple languages and optional timestamps.
Inputs: url (required), lang, includeTimestamps.
getVideoInfoA
Get YouTube video metadata: title, views, publish date, channel, comment count, and pagination tokens for comments.
Inputs: url (required).
searchYoutubeA
Search YouTube for videos, channels, and playlists. Returns results with thumbnails, views, and channel info.
Inputs: query (required), gl, hl, sp, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct YouTube data aspect: transcript, video metadata, comments, comment replies, and search. There is no overlap or ambiguity between them.
Four tools follow a consistent 'get' + noun pattern (getTranscript, getVideoInfo, getComments, getCommentReplies), but searchYoutube deviates by using a verb-noun phrase. The pattern is mostly consistent and readable.
With 5 tools, the server is well-scoped for YouTube data retrieval. Each tool serves a clear and necessary function without excessive granularity or missing core operations.
The tool set covers major YouTube data retrieval needs: search, video info, transcript, comments, and replies. Minor gaps exist (e.g., playlist or channel details) but the core workflows are well supported.
Maintenance
Related MCP Connectors
Real-time YouTube transcripts, comments, channels & video search MCP. Local npx or hosted OAuth.
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
YouTube MCP — wraps the YouTube Data API v3 (BYO API key)
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.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables users to extract, search, and analyze YouTube video transcripts directly within MCP-compatible clients. It supports advanced features like time-chunked summaries, keyword searching with surrounding context, and batch processing for multiple videos.4MIT
- AlicenseAqualityCmaintenanceMCP server that fetches YouTube video transcripts and optionally summarizes them. Supports multiple transcript formats (text, JSON, SRT, WebVTT), multi-language retrieval, and flexible YouTube URL parsing.641 PyPI6MIT
- FlicenseNot gradedqualityDmaintenanceMCP server providing tools to fetch YouTube video transcripts with metadata, supporting direct YouTube transcripts and audio transcription via multiple backends (whisper, AssemblyAI, OpenAI, Gemini).-
- FlicenseNot gradedqualityDmaintenanceEnables users to fetch YouTube video transcripts via a single MCP tool, with support for multiple languages and OAuth-protected access.-