youtube-mcp
Provides tools for reading public YouTube data via the YouTube Data API (search, videos, channels, playlists, comments, trending charts) and for pulling YouTube Analytics reports for the user's own channels (views, watch time, retention curves, traffic sources, search terms, audience, revenue), plus a breakout finder that ranks videos by views per subscriber.
Surfaces the kind of channel analytics found in YouTube Studio — retention curves, traffic sources, the searches that found the channel, and audience data — for the user's connected channels, though impressions and click-through rate remain Studio-only.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Claude gets your channels' real analytics (retention, traffic sources, the searches that found you, audience) and all of public YouTube (search, any video or channel, comments). It can research the way you would with YouTube Studio and a search tab open, on claude.ai, the desktop and phone apps, and Claude Code.
It runs on your own Vercel account with your own Google Cloud project. Only the Google accounts you list can use it.
Ask it things like
How did my last three videos do in their first week, and where did the views come from?
Find what broke out this week in budget AI hardware, and what the top comments keep asking for.
My retention drops at 0:40 on the last video. Compare it with my best one and tell me what's different.
Related MCP server: YouTube MCP Server
Why this one
Private | Your server, your Google project, your keys. Nothing sits in the middle, and only your listed accounts can connect. |
Remote | A real connector with sign-in, so it works in the Claude apps and on your phone, not only on one computer. |
Free | Vercel's free plan and YouTube's free quota (10,000 units a day) cover one person easily. |
No database | Tokens and your channel list are encrypted with your key and carry their own expiry. |
Read-only | It asks Google for read scopes only. It can't upload, edit or delete anything. |
Tools
Tool | What it does |
| Your connected channels and their public totals |
| Any YouTube Analytics report for your channels: views, watch time, retention curves, traffic sources, search terms, audience, revenue |
| Any read call of the YouTube Data API: search, videos, channels, playlists, comments, trending charts |
| Several searches at once, ranked by views per subscriber, to spot videos that outgrew their channel |
How it works
flowchart LR
C[Claude] -- "OAuth 2.1 + PKCE" --> S["youtube-mcp<br/>(your Vercel)"]
S -- "Sign in with Google<br/>owners only" --> G[Google]
S -- "API key" --> D[YouTube Data API]
S -- "each channel's<br/>read-only login" --> A[YouTube Analytics API]The app is both a small OAuth server and an MCP server. Claude signs in through it; you approve with your Google account. Your channels are added once from a setup page.
Setup
About 15 minutes. You need a Google account, a Vercel account and Claude.
1. Google Cloud
In console.cloud.google.com, create a project.
APIs & Services → Library: enable YouTube Data API v3 and YouTube Analytics API.
APIs & Services → Credentials → Create credentials → API key, restricted to the YouTube Data API v3. This is
YOUTUBE_API_KEY.Google Auth Platform → Branding: an app name, your email, a homepage URL and a privacy policy URL. Google asks for both URLs before it lets you publish.
Audience: External, then Publish app. While an app is in "Testing", Google expires its logins after 7 days.
Clients → Create client → Web application, with the redirect URI
https://<your-domain>/auth/google/callback(you get the domain in the next step and can edit this later). Addhttp://localhost:3000/auth/google/callbacktoo if you'll run it locally. The client ID and secret areGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET.
2. Deploy
Click Deploy with Vercel above and fill in:
Variable | Value |
|
|
| From step 1.6 |
| From step 1.3 |
| The Google account(s) allowed to use it, comma-separated |
Then add your Vercel domain to the Google client's redirect URIs (step 1.6).
3. Add your channels
Open
https://<your-domain>/setupand sign in with an owner account.Click Add a channel and pick the Google account (or Brand Account) that owns the channel. Google warns that the app isn't verified: it's your own app, so choose Advanced → Go to (your app).
Copy the value it shows into a Vercel environment variable named
YOUTUBE_CHANNELS, then redeploy.
Repeat for each channel. The value is encrypted with your CONNECTOR_KEY.
If Google showsError 400: invalid_request for a channel's account, add that account to your Google Cloud project (IAM & Admin → Grant access, role Editor), then try again.
4. Connect Claude
Settings → Connectors → Add custom connector, with the URL https://<your-domain>/mcp. On a Team or Enterprise
plan, an owner adds it under Organization settings → Connectors first. Click Connect, sign in with your owner
Google account and click Allow.
Security
Google scopes are read-only:
youtube.readonly,yt-analytics.readonly,yt-analytics-monetary.readonly.Only accounts in
OWNER_EMAILScan sign in, add channels or allow a client.Clients use OAuth 2.1 with PKCE. Access tokens last 1 hour and refresh tokens 90 days, all sealed with AES-256-GCM using
CONNECTOR_KEY.To sign every client out, change
CONNECTOR_KEYand redeploy, then add your channels again. To cut off one channel, remove it in/setupand remove the app at myaccount.google.com/permissions.
Limits
Impressions and click-through rate aren't in YouTube's API, only in Studio.
Other channels' transcripts aren't in the official API.
10,000 quota units a day per Google project. A search costs 100; most other reads cost 1.
Run locally
cp .env.example .env.local # fill it in
pnpm install
pnpm dev # http://localhost:3000Make your own connector
Nothing in the OAuth server (src/lib/oauth, src/app/oauth, src/app/api/oauth, src/app/.well-known) or the
MCP route (src/app/mcp) knows about YouTube. Replace src/lib/tools.ts with your own tools and you have a private
connector for anything.
License
MIT. Not affiliated with YouTube, Google or Anthropic.
This server cannot be deployed
Maintenance
Related MCP Connectors
Your YouTube channels’ private analytics for AI assistants: revenue, views, retention. Read-only.
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
Hosted MCP for YouTube Studio: uploads, metadata, playlists, comments, analytics, captions.
Search YouTube videos, read transcripts and get public video information in your AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to access and manage YouTube channel data through the YouTube Data API v3 and YouTube Analytics API. Provides tools for reading analytics, fetching video metadata, searching uploads, and updating video SEO directly from Claude.9 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to interact with YouTube Data API for searching videos, channels, and playlists, and retrieving details and playlists.16 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables Claude.ai to search videos, get trending and channel feeds, retrieve video metadata and engagement stats, and fetch or search transcripts over HTTPS.-
- FlicenseAqualityCmaintenanceEnables Claude to retrieve YouTube transcripts, search videos and channels, fetch metadata and playlists, analyze engagement, and access trending content via natural language.1516 npm-