youtube-mcp-server
Provides tools for interacting with YouTube Data API v3, enabling searches, trending video lookups, channel uploads, video statistics, and comment retrieval.
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-serverWhat's trending in the US right now?"
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
A remote MCP server that exposes YouTube Data API v3 as tools, over Streamable HTTP, so it can be added to claude.ai as a custom connector.
No dependencies. No build step. node src/server.js is the whole thing.
Tools
Tool | What it does | Quota cost |
| Most popular videos for a country, optionally filtered to one category | 1 unit |
| Keyword search for videos, channels or playlists, with stats attached | 1 search call + 1 unit |
| A channel's recent uploads plus its subscriber/view totals | 3 units |
| Full stats for up to 50 videos in one call | 1 unit |
| Top-level comments with like and reply counts | 1 unit |
Transcripts are deliberately absent. captions.download requires OAuth and edit
permission on the video, so an API key can only fetch captions for videos you own.
The unofficial scraping libraries are widely reported to be blocked from cloud IP
ranges, which is exactly where this server runs.
Related MCP server: mcp-server-youtube
Quota
A project gets 10,000 units/day in the general bucket, and search.list sits in a
separate bucket capped at 100 calls per day. That shaped the tool design:
youtube_channel_videos goes channels.list → playlistItems.list → videos.list
rather than search.list?channelId=, so browsing a channel costs 3 general units
instead of one of only a hundred daily searches.
Run locally
cp .env.example .env # add your YOUTUBE_API_KEY
export $(grep -v '^#' .env | xargs)
npm startcurl localhost:3000/health
curl -s localhost:3000/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | head -c 400Test
npm testRuns the full MCP handshake, both transport modes, all five tools and the error paths against a stubbed YouTube API. No API key and no network required.
Deploy to Railway
Push this repo to GitHub.
Railway → New Project → Deploy from GitHub repo → pick it.
Variables → add
YOUTUBE_API_KEY.Settings → Networking → Generate Domain.
Check
https://<your-domain>/healthreturns"apiKeyConfigured": true.
Railway sets PORT itself; the server binds 0.0.0.0 and reads it.
Add to claude.ai
Customize → Connectors → Add custom connector → https://<your-domain>/mcp
No OAuth fields needed — the server is authless by default. To lock it down, set
MCP_AUTH_TOKEN and put Bearer <token> in the connector's Request headers under
authorization.
Environment variables
Variable | Required | Default | Notes |
| yes | — | Google Cloud Console, with YouTube Data API v3 enabled |
| no | 3000 | Railway sets this |
| no |
| Path the MCP endpoint listens on |
| no | — | If set, every request needs |
| no | Google's | Only used to point the test suite at a stub |
Design notes
Stateless. Each POST is self-contained — no Mcp-Session-Id, no session map — so
a restart or a second replica never produces "No valid session ID provided".
Content negotiation matches the reference SDK: an SSE frame when the client sends
Accept: text/event-stream, a plain JSON body otherwise.
GET and DELETE on /mcp return 405, which is what the Streamable HTTP spec
expects from a server with no server-initiated stream and no session to close.
No Origin header validation and no DNS-rebinding protection. Those defences are
meant for MCP servers bound to localhost; left on for a public deployment they
reject Anthropic's own requests, which is a common cause of initialize timeouts.
Tool failures come back as isError: true content rather than JSON-RPC errors, so
Claude reads what went wrong and can adjust instead of the call dying at the
transport layer.
Results are trimmed at 120k characters, under claude.ai's ~150k tool-result cap.
This server cannot be deployed
Maintenance
Related MCP Connectors
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
YouTube discovery, transcripts, library search, and monitors with API keys or OAuth.
YouTube data for AI agents: channels, videos, transcripts, comments, search. Video research.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with YouTube through the YouTube Data API, allowing users to search for videos, playlists, and channels, generate video titles using AI, and manage YouTube content through natural language commands.22-
- 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
- FlicenseNot gradedqualityCmaintenanceEnables searching and retrieving video transcripts, metadata, channel info, playlists, comments, trending videos, and engagement analytics from YouTube through natural language.19 npm-