YouTube MCP Server
Search videos, explore channels, browse playlists, and fetch video details using the YouTube Data API v3.
Click on "Install 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 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
Fetch-native MCP server for YouTube search, channels, playlists, and video metadata. It runs on Bun and Cloudflare Workers.
Author: overment
Tool output comes from an external API and may be incomplete or misleading. Review results before relying on them.
This branch targets the2026-07-28 release candidate with @modelcontextprotocol/server@2.0.0-beta.5, @modelcontextprotocol/client@2.0.0-beta.5, and Zod 4. It does not claim conformance to a final dated specification or stable SDK release. Re-run the final-release gate when those artifacts are published.
Runtime model
One fetch-native SDK handler is created per Bun process or Worker isolate. Its factory creates a fresh McpServer for every request. The SDK owns protocol parsing, modern negotiation, stateless legacy projection, cancellation, completion, cache metadata, and subscriptions.
POST /mcp accepts modern 2026-07-28 traffic and, by default, the SDK's stateless 2025-11-25 fallback. GET /mcp and DELETE /mcp return 405; there are no endpoint sessions, replay buffers, or custom JSON-RPC dispatchers.
The HTTP shell validates Host and every present Origin, applies strict CORS, and rejects MCP bodies above MCP_MAX_REQUEST_BYTES.
Related MCP server: mcp-youtube
Install and run
Requirements: Bun and a YouTube Data API v3 key.
bun install
cp .env.example .env
bun devThe default MCP URL is http://localhost:3000/mcp.
For local workerd:
bun run dev:worker
# http://127.0.0.1:8787/mcpDeploy only after replacing local URLs and allowlists in wrangler.jsonc:
bun run deployYouTube credential resolution
The server resolves the provider credential in this order:
X-YouTube-Api-Keyon the current MCP HTTP request;a separately verified provider access token in
AuthInfo.extra.providerAccessToken;the configured
API_KEYor static provider credential.
The credential is sent to YouTube only as the key query parameter. The inbound MCP bearer (AuthInfo.token) is never forwarded upstream.
Client-header example:
{
"mcpServers": {
"youtube": {
"command": "bunx",
"args": [
"mcp-remote",
"http://localhost:3000/mcp",
"--header",
"X-YouTube-Api-Key: ${YOUTUBE_API_KEY}"
]
}
}
}Server fallback:
AUTH_STRATEGY=api_key
API_KEY=your-youtube-api-key
API_KEY_HEADER=x-youtube-api-keyPROVIDER_API_URL defaults to https://www.googleapis.com/youtube/v3. Override it only for a trusted provider-compatible endpoint or local tests.
Exposed MCP contract
Tools
All tools are read-only, non-destructive, idempotent, and open-world.
Tool | Input | Structured output |
|
| query, count, channel summaries |
|
| channel ID, count, latest videos |
|
| query, count, video summaries |
|
| playlists or playlist videos |
|
| metadata, duration, statistics, tags, thumbnail |
Successful calls return both text content and schema-valid structuredContent. Expected provider/input failures return isError: true. Every provider fetch receives the MCP request cancellation signal.
Prompts
greeting: personalized greeting inen,es,fr, orde; language completion is supported.analysis: structured analysis at basic, intermediate, or advanced depth.multimodal: optional image, audio, and embedded-resource prompt content.
Prompt request arguments are MCP strings. Boolean-like prompt options use "true" and "false".
Resources
Static resources:
config://server— redacted runtime configuration;docs://overview— inherited server documentation;logo://server— PNG blob;logo://server/svg— SVG text;status://server— dynamic process/isolate status.
Templated resource: example://items/{collection}/{id}. It supports listing, argument completion, public cache metadata, and reads. Modern clients can subscribe to list changes and status://server updates through subscriptions/listen.
Authorization boundaries
There are two independent boundaries:
MCP Resource Server authorization controls access to
/mcp. SetAUTH_ENABLED=true.MCP_AUTH_MODE=jwtverifies signature, issuer, audience, algorithm, expiry, client ID, and required scopes against external AS/JWKS metadata.Provider OAuth acquires and refreshes a Google/provider credential. The inherited proxy is disabled by default (
PROVIDER_OAUTH_ENABLED=false). Stored mode validates its opaque MCP token record and resolves the distinct provider token from protected storage.
The inherited provider OAuth code is not the default YouTube product path. It is dormant on Bun unless enabled. Workers retain the existing provider OAuth/discovery routes (/authorize, /oauth/callback, /token, /revoke, /register, and /.well-known/*) outside MCP dispatch for compatibility. These routes never parse MCP protocol messages.
Bun stores OAuth token mappings in RS_TOKENS_FILE; Workers preserve the TOKENS KV binding and key format. RS_TOKENS_ENC_KEY enables AES-256-GCM encryption. Provider refresh tokens stay in storage and never enter tool context.
Worker configuration
wrangler.jsonc is the source of truth. It preserves the deployed Worker name and TOKENS namespace ID. Set secrets without placing values in config:
bunx wrangler secret put API_KEY
bunx wrangler secret put RS_TOKENS_ENC_KEY
bunx wrangler secret put PROVIDER_CLIENT_ID
bunx wrangler secret put PROVIDER_CLIENT_SECRETAfter binding/config changes:
bun run types:worker
bun run types:worker:checkValidation
bun run typecheck
bun run lint
bun run format:check
bun test
bun run build
bun run build:worker
bun run types:worker:check
bun run test:workerdThe protocol suite uses the official beta.5 client in modern and legacy modes. It covers exact discovery contracts, every advertised primitive, schema-valid mocked provider calls, cancellation, cache hints, completion, subscriptions, strict HTTP handling, JWT Resource Server behavior, concurrent principal isolation, preserved provider OAuth routes/storage, and MCP/provider token separation. test:workerd repeats modern and legacy discovery plus a mocked provider call against actual local workerd.
The pre-migration oracle and known baseline defects are recorded in docs/pre-migration-contract.md. Candidate adaptations, OAuth reachability, storage compatibility, and removed infrastructure are recorded in docs/wave-5-migration.md.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/iceener/youtube-streamable-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server