youtube-mcp-server
youtube-mcp-server
リモート MCP サーバーで、YouTube Data API v3 をツールとして公開し、Streamable HTTP 経由で claude.ai にカスタムコネクタとして追加できるようにします。
依存関係なし。ビルド手順なし。node src/server.js だけで全部です。
ツール
ツール | 説明 | クォータ消費量 |
| ある国の最も人気のある動画。オプションで1つのカテゴリに絞り込み可能 | 1ユニット |
| 動画、チャンネル、またはプレイリストのキーワード検索。統計情報付き | 検索1回 + 1ユニット |
| チャンネルの最近のアップロード動画と、登録者数・視聴回数の合計 | 3ユニット |
| 1回の呼び出しで最大50本の動画の完全な統計情報 | 1ユニット |
| 高評価数と返信数を含むトップレベルコメント | 1ユニット |
トランスクリプトは意図的に含めていません。captions.download には OAuth および 動画の編集権限が必要なため、API キーで取得できる字幕は自分が所有する動画のものだけです。非公式のスクレイピングライブラリはクラウドIPレンジからブロックされると広く報告されており、このサーバーが動作するのはまさにその環境です。
Related MCP server: mcp-server-youtube
クォータ
プロジェクトには一般バケットで1日あたり10,000ユニットが与えられ、search.list は別のバケットにあり、1日100回の上限があります。このことがツール設計を形作っています。youtube_channel_videos は search.list?channelId= を使わず、channels.list → playlistItems.list → videos.list の順に呼び出します。そのため、チャンネルの閲覧には、1日100回しかない検索の1回ではなく、一般ユニットを3つ消費します。
ローカルで実行
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 400テスト
npm testスタブ化した YouTube API に対して、MCP ハンドシェイク全体、両方のトランスポートモード、5つのツールすべて、およびエラーパスを実行します。API キーもネットワークも不要です。
Railway へデプロイ
このリポジトリを GitHub にプッシュします。
Railway → 新規プロジェクト → GitHub リポジトリからデプロイ → 選択します。
変数 →
YOUTUBE_API_KEYを追加します。設定 → ネットワーク → ドメインを生成します。
https://<your-domain>/healthが"apiKeyConfigured": trueを返すことを確認します。
Railway が PORT を自身で設定します。サーバーは 0.0.0.0 にバインドし、その値を読み取ります。
claude.ai に追加
カスタマイズ → コネクタ → カスタムコネクタを追加 → https://<your-domain>/mcp
OAuth フィールドは不要です — サーバーはデフォルトでは認証なしです。ロックダウンするには、MCP_AUTH_TOKEN を設定し、コネクタのリクエストヘッダーの authorization に Bearer <token> を指定します。
環境変数
変数 | 必須 | デフォルト | 備考 |
| はい | — | Google Cloud Console で YouTube Data API v3 を有効にしたもの |
| いいえ | 3000 | Railway が設定します |
| いいえ |
| MCP エンドポイントが待ち受けるパス |
| いいえ | — | 設定すると、すべてのリクエストに |
| いいえ | Google のデフォルト | テストスイートをスタブに向けるためだけに使用 |
設計メモ
ステートレスです。各 POST は自己完結しています — Mcp-Session-Id もセッションマップもありません — そのため、再起動や2番目のレプリカでも「No valid session ID provided」は発生しません。
コンテンツネゴシエーションはリファレンス SDK に従います。クライアントが Accept: text/event-stream を送信した場合は SSE フレーム、それ以外の場合はプレーンな JSON ボディを返します。
/mcp への GET と DELETE は 405 を返します。これは、サーバー発信のストリームも閉じるセッションもないサーバーに対して Streamable HTTP 仕様が期待する動作です。
Origin ヘッダーの検証も DNS リバインディング対策も行いません。これらの防御は localhost にバインドされた MCP サーバー向けのものです。公開デプロイで有効のままにすると Anthropic 自身のリクエストを拒否するため、initialize タイムアウトの一般的な原因になります。
ツールの失敗は JSON-RPC エラーではなく isError: true のコンテンツとして返されます。そのため Claude は何が問題だったかを読み取って調整でき、呼び出しがトランスポート層で途絶えることはありません。
結果は 120k 文字に切り詰められます。claude.ai のツール結果上限 ~150k を下回ります。
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.
Related MCP Connectors
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents. No signup.
Provide token-optimized, structured YouTube data to enhance your LLM applications. Access efficien…
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
Personal YouTube AI knowledge base powered by RAG. Query your subscribed YouTube channels.
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
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to search videos, channels, and playlists, retrieve video metadata, transcripts, and comments via the YouTube Data API v3.71
- FlicenseNot gradedqualityBmaintenanceEnables searching and retrieving video transcripts, metadata, channel info, playlists, comments, trending videos, and engagement analytics from YouTube through natural language.57
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/BismaNwaz/-youtube-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server