youtube-mcp
Provides tools for analyzing YouTube channels and videos, including channel summaries, top videos, detailed video statistics, audience retention curves, traffic sources, reach/CTR data, and comments.
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-mcpWhat was my best video by CTR last week?"
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
An MCP server that lets you analyze @ザビエル-zav's YouTube channel directly from Claude.
It aims to answer questions like "Which video had the best CTR last week?" by fetching real data.
Built with Node.js (no Python). It wraps the YouTube Analytics API / Reporting API / Data API v3
with the official Node libraries (googleapis, google-auth-library) and exposes them as tools
via the official MCP TypeScript SDK (@modelcontextprotocol/sdk).
APIs used and how they are divided
Data wanted | API | How it is retrieved |
Views, watch time, average view duration, subscriber changes, traffic sources, audience | YouTube Analytics API | Returns JSON on request |
Thumbnail impressions, impression CTR | YouTube Reporting API (Bulk Reports) | Register a job in advance → CSV generated daily → download and read |
Video titles, descriptions, comments | YouTube Data API v3 | Returns JSON on request |
Only CTR has a fundamentally different retrieval method (bulk reports), so it follows a separate path:
register-reach-job.js registers the job → download-reports.js periodically accumulates CSVs locally.
Related MCP server: youtube-organic-mcp
Setup
1. Google Cloud Console
Create a project
Enable the following 3 APIs
YouTube Analytics API
YouTube Reporting API
YouTube Data API v3
Configure the OAuth consent screen (user type = External, add your own Google account as a test user)
Credentials > OAuth client ID > Create one with application type = Desktop app, and download the JSON
Place the downloaded JSON in the root of this repository under the name
client_secret.jsonNever commit
client_secret.jsonor thetoken.jsoncreated after the first authentication. It is already in.gitignore, but be careful not to rungit add -fby mistake.
2. Node.js and dependencies
Node.js 18 or later is required (if not installed, install the LTS version from nodejs.org.
The installer includes npm, so no separate PATH configuration is needed like with Python).
npm install3. Register the reach report (CTR) job — run this first
The Reporting API starts generating data from the day the job is registered, and historical data can only go back 30 days from the registration point. The longer you delay registration, the more past CTR data is lost, so run this before anything else.
npm run register-reach-jobOn the first run, a browser opens and asks for authentication (after that, token.json handles automatic renewal).
4. Start the MCP server
npm startTo use it from Claude Desktop, register it in claude_desktop_config.json as follows.
{
"mcpServers": {
"youtube-analytics": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/server.js"]
}
}
}5. Download reach reports (a few hours to 2 days after registration)
npm run download-reportsCSVs are accumulated under data/reach/<report_type>/. Reports disappear on YouTube's side after 60 days
(30 days for historical data), so keep running this regularly (ideally once a day).
On Windows, use Task Scheduler; on Mac/Linux, set up a cron job.
The get_reach tool reads these local CSVs.
List of exposed tools
Tool name | Arguments | Returns |
|
| Views, watch time, and subscriber changes for the whole period |
|
| Top videos by views and their basic metrics |
|
| Detailed metrics for a specified video |
|
| Audience retention curve (in 10% steps) + point of greatest drop-off |
|
| Breakdown of traffic sources |
|
| Thumbnail impressions and CTR (aggregated from locally stored CSVs) |
|
| List of comments (by relevance) |
Output is not raw JSON but rounded numbers and text tables capped at about 20 entries (to reduce context consumption on the Claude side).
Known limitations
Analytics API data lags up to about 2 days behind what YouTube Studio shows. "Yesterday's numbers" may not be available.
get_reachonly looks at CSVs already downloaded locally. Data for periods whendownload-reports.jswas not run will not appear.The exact column structure of
channel_reach_basic_a1/channel_reach_combined_a1is unconfirmed.get_reachhas a fallback that guesses column names by keyword, but check once against the headers of an actually downloaded CSV.No write scopes are attached (read-only). There is no path that could accidentally modify or delete videos.
Deployment target branches
Where you want to use it | What you need |
Claude Desktop app | Just run |
claude.ai (Web/Mobile) | Must be published as a remote MCP server accessible over HTTPS |
If you also want to use it from mobile, the quickest path is to switch StdioServerTransport to
StreamableHTTPServerTransport (@modelcontextprotocol/sdk/server/streamableHttp.js)
and piggyback on your existing hosting environment.
This server cannot be deployed
Maintenance
Related MCP Connectors
AI YouTube analyst in Claude for creators: audit, fix, decide what to make next, grow subs.
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
GA4, Google Ads and Search Console in Claude. Read-only OAuth, multi-account for agencies.
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
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
- AlicenseAqualityCmaintenanceEnables AI assistants to access YouTube organic analytics, including channel stats, video performance, watch time, and audience engagement, via the YouTube Data API v3 and Analytics API v2.615 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables Claude to pull exact YouTube creator stats (subscribers, views, engagement) and discover new creators, then write them into a Notion Influencers roster.-
- AlicenseAqualityCmaintenanceEnables AI assistants to retrieve YouTube channel overviews, Studio analytics, video performance, traffic source breakdowns, and comments for sentiment analysis using natural language prompts.81MIT