YouTube MCP Server
Enables AI models to interact with YouTube content through 18 MCP tools for videos, transcripts, channels, and playlists.
README
YouTube MCP Server
A Model Context Protocol (MCP) server for YouTube, running on Cloudflare Workers using the Agents SDK (McpAgent). Enables AI language models to interact with YouTube content through 18 MCP tools.
Deployment
# Install dependencies
npm install
# Set secrets
npx wrangler secret put YOUTUBE_API_KEY
npx wrangler secret put GOOGLE_OAUTH_CLIENT_ID # Required for transcripts
npx wrangler secret put GOOGLE_OAUTH_CLIENT_SECRET # Required for transcripts
# Deploy
npx wrangler deploy
# MCP endpoint: https://youtube-mcp-server.<your-subdomain>.workers.dev/mcp
Development
# Local dev with auto-reload
npm run dev
# Typecheck
npm run typecheck
Create a .env file for local development (see .env.example), then:
npx wrangler dev --port 8787
Available Tools (18)
Video
| Tool | Description |
|---|---|
videos_getVideo |
Get detailed video information |
videos_searchVideos |
Search videos with channel-level filtering |
videos_getVideoStats |
Get view count, likes, comments statistics |
videos_getTrendingVideos |
Get trending videos by region |
videos_getRelatedVideos |
Find related videos ("Up Next" suggestions) |
Transcript
| Tool | Description |
|---|---|
transcripts_getTranscript |
Retrieve video captions (requires Google OAuth) |
transcripts_searchTranscript |
Search within a video transcript |
transcripts_getTimestampedTranscript |
Get transcript with human-readable timestamps |
Channel
| Tool | Description |
|---|---|
channels_getChannel |
Get channel information with enrichment |
channels_getChannels |
Bulk channel lookup |
channels_searchChannels |
Search channels with subscriber/creator filtering |
channels_findCreators |
Discover creators matching a topic |
channels_listVideos |
List recent videos from a channel |
channels_getStatistics |
Get channel subscriber/video/view counts |
channels_getPlaylists |
Get all playlists by a channel |
Playlist
| Tool | Description |
|---|---|
playlists_getPlaylist |
Get playlist details |
playlists_getPlaylistItems |
List videos in a playlist |
playlists_searchPlaylists |
Search for public playlists |
Authentication
- 15 tools (video, channel, playlist) use only the YouTube Data API key
- 3 transcript tools require Google OAuth 2.0 (YouTube Captions API requires it)
To enable transcripts:
- Create OAuth 2.0 credentials in Google Cloud Console
- Add redirect URI:
https://your-worker.workers.dev/auth/google/callback - Set secrets and deploy
- Visit
/auth/googleon your worker to authorize
Architecture
Built on Cloudflare Workers using:
agents(McpAgent) — Durable Object-backed MCP server@modelcontextprotocol/sdk— MCP protocol implementationzod— Input validation for all tool schemas- KV — Response caching (1h search, 24h details)
No googleapis, youtube-transcript, or ytdl-core — all YouTube API calls use native fetch().
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.