youtube-studio-mcp
You can inspect and analyze the authenticated user's own YouTube channel data through local MCP tools or a CLI, backed by cached OAuth-fetched YouTube Data/Analytics stats.
Get channel basics: subscribers, total views, video count, uploads playlist id.
Get channel performance metrics for a date range: views, watch time, average view duration, subscriber gains/losses/net.
List all uploaded videos with id, title, publish date, and duration.
Retrieve audience retention curves for individual videos.
Analyze watch time and retention grouped by hand-maintained content pillars (unmapped videos go into an 'não classificado' bucket).
Rank video efficiency across long-form and shorts using retention, subscribers, comments, and likes with a transparent score.
Run all tools from a terminal with one-shot commands or an interactive menu, and bypass the local SQLite cache with refresh flags when needed.
Provides access to your own YouTube channel's Studio data, including channel overview (subscribers, views, video count), channel metrics over a date range, video listings with durations, audience retention curves, and performance grouped by content pillars.
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-studio-mcpWhat are my channel metrics for the last 28 days?"
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-studio-mcp
Local MCP server (stdio) exposing data from your own YouTube channel to Claude Code. OAuth → YouTube Data API v3 + YouTube Analytics API v2 → SQLite cache → MCP tools → stdio.
Tools:
Tool | What it returns |
| subscribers, total views, video count, uploads playlist id |
| views, minutes watched, avg view duration, subscribers gained/lost/net for a date range |
| every uploaded video (id, title, publish date, ISO-8601 duration) |
| audience retention curve for one video |
| watch time and retention grouped and ranked by content pillar |
| videos ranked by efficiency within longos vs shorts (retention, subscribers, comments, likes) — raw metrics + a transparent score for downstream decision-making |
⚠️ Phase 1 requires re-consenting once. The Analytics tools need the added
yt-analytics.readonlyscope, and adding a scope does not widen an existing token. A token minted before Phase 1 is detected as insufficient and the tools ask you to runmake auth(oryoutube-studio-mcp auth) again to grant the new scope.
List the registered tools without authenticating:
.venv/bin/python -m youtube_studio_mcp.server --self-checkLayout
src/youtube_studio_mcp/
config.py paths/settings (env vars), scopes, cache TTLs
auth.py OAuth: `login` (CLI, opens browser) / `load_credentials` (server, silent refresh + scope check)
youtube.py thin Data API v3 client + response parsing
analytics.py thin Analytics API v2 client + response parsing
pillars.py loads config/pilares.json (videoId -> pillar map)
cache.py sqlite3 key/value cache with TTL
service.py use cases (clients + cache), no MCP/Google imports
server.py MCP tool registration (MCPServer) + --self-check
__main__.py entry point: `serve` (default), `auth`, and the CLI commands
config/
pilares.json hand-maintained videoId -> pillar map
tests/ pytest, no networkTo add a tool: API call in youtube.py → use case in service.py → @server.tool() in server.py.
Note:
mcp2.x renamedFastMCPtoMCPServer(from mcp.server.mcpserver import MCPServer).
Related MCP server: YouTube MCP Server
Setup
make install # venv + project + dev deps
make test
make # list all commands (install, test, shell, auth, overview, mcp-add, clean...)Google OAuth (one time)
📘 Step-by-step guide (credentials, OAuth, Claude Code, troubleshooting): docs/SETUP.md
Summary:
In Google Cloud Console: enable YouTube Data API v3 and YouTube Analytics API.
Configure the OAuth consent screen (add yourself as a test user).
Create an OAuth client ID of type Desktop app and download the JSON to
~/.youtube-studio-mcp/client_secret.json.Log in (opens the browser):
make auth
No API key is used — your own channel's data requires OAuth.
The token is stored at ~/.youtube-studio-mcp/token.json and refreshed automatically.
The server never opens the browser itself (it would corrupt stdio).
CLI
The same features are available from the terminal (same service and cache as the MCP tools).
Interactive menu with Tab completion — just run it in a terminal:
$ .venv/bin/youtube-studio-mcp
YouTube Studio — 'help' lists commands, Tab completes, 'exit' quits.
yt> help
yt> overview --help
yt> overview --refresh
yt> exitOne-shot commands:
.venv/bin/youtube-studio-mcp --help
.venv/bin/youtube-studio-mcp overview # JSON, served from cache when fresh
.venv/bin/youtube-studio-mcp overview --refresh # bypass the cache
.venv/bin/youtube-studio-mcp metrics --start 2026-08-01 --end 2026-08-28
.venv/bin/youtube-studio-mcp videos
.venv/bin/youtube-studio-mcp retention <VIDEO_ID>
.venv/bin/youtube-studio-mcp pillars
.venv/bin/youtube-studio-mcp efficiencyTo add a command for a new tool: add a subparser in cli.build_parser, handle it in
cli.run_command, and list it in shell.COMMANDS.
Content pillars (config/pilares.json)
analyze_pillar_performance groups your videos by content pillar. You maintain the
map by hand — it is the source of truth for videoId -> pillar:
{
"VIDEO_ID": { "pilar": "imigracao|pedro|holanda|pratico|doceria", "formato": "vlog", "seo": true }
}Videos not listed here are still counted, under a não classificado bucket, so nothing
is silently dropped. Point YTS_PILLARS_FILE elsewhere to use a different file.
Connect to Claude Code
claude mcp add youtube-studio -- "$(pwd)/.venv/bin/youtube-studio-mcp" serveConfiguration
Env var | Default |
|
|
|
|
|
|
|
|
Available Tools
5 toolsanalyze_pillar_performanceARead-only
Group each mapped video's watch time and retention by content pillar (config/pilares.json) and rank pillars by minutes watched. Unmapped videos land in a 'não classificado' bucket. Derived from cached metrics.
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | No | ||
| start_date | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint annotation already establishes safety, and the description adds useful behavioral context: data comes from cached metrics and unmapped videos are placed in a 'não classificado' bucket. This goes beyond the annotation and helps the agent anticipate edge-case grouping behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three focused sentences: the core aggregation and ranking behavior, the unmapped-video edge case, and the data source. There is no filler, and the most important behavior is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the main grouping behavior and the unmapped bucket, but it omits any explanation of the optional date parameters, which are the only inputs. With no output schema and no parameter descriptions, the definition is adequate but leaves meaningful gaps for an agent trying to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not compensate by explaining how start_date and end_date affect the aggregation, whether they default to a full range, or what date format is expected. The description adds no meaning to either parameter beyond the bare names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb ('Group each mapped video's watch time and retention'), a specific resource ('content pillar (config/pilares.json)'), and a specific output behavior ('rank pillars by minutes watched'). It clearly distinguishes itself from broader channel metrics and retention curve siblings by focusing on pillar aggregation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage context is clear: use this when you need pillar-level aggregation and ranking rather than channel-wide or per-video metrics. However, it does not explicitly mention when NOT to use it or name alternative sibling tools, so it stops short of full routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_channel_metricsARead-only
Channel metrics from the YouTube Analytics API for a date range (default: last 28 days): views, minutes watched, average view duration, subscribers gained/lost and net. Dates are YYYY-MM-DD. Cached per range.
| Name | Required | Description | Default |
|---|---|---|---|
| refresh | No | ||
| end_date | No | ||
| start_date | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark the operation read-only, and the description adds useful behavior: default range, date format, and per-range caching. It does not cover rate limits, authentication, or return-shape details, but the read-only annotation lowers the burden.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences, front-loaded with the tool's purpose and immediately followed by the metrics and date constraints. Every sentence earns its place and there is no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only metrics tool with three optional parameters, the description covers the key call context: metrics returned, default range, date format, and caching. The only notable omission is an explicit explanation of the refresh parameter, but the description still provides enough to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description must carry parameter meaning; it does define date format and default range, and 'Cached per range' hints at caching semantics. It does not explicitly explain the refresh boolean or how start_date/end_date interact, leaving a gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific resource ('Channel metrics from the YouTube Analytics API') and lists the measured fields, making the tool's function clear. It does not explicitly contrast with sibling tools, but the metric list and date-range scope distinguish it from get_channel_overview and list_videos.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear context: metrics are for a date range, defaulting to the last 28 days, with dates formatted YYYY-MM-DD and results cached per range. It does not explicitly state when to prefer another sibling tool, but the intended use case is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_channel_overviewARead-only
Basic stats of the authenticated owner's YouTube channel: subscribers, total views, video count and uploads playlist id. Cached locally; pass refresh=true to bypass the cache.
| Name | Required | Description | Default |
|---|---|---|---|
| refresh | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| title | Yes | |
| channel_id | Yes | |
| view_count | Yes | |
| video_count | Yes | |
| subscriber_count | Yes | |
| uploads_playlist_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint annotation already signals safety, and the description adds useful behavioral context by disclosing that results are cached locally and that refresh=true bypasses the cache. There is no contradiction with the annotation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two tight sentences. The first front-loads what the tool returns and for whom; the second clarifies the only parameter behavior that matters. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only tool with one optional parameter and an output schema, the description covers all essentials: scope, returned fields, and caching behavior. Return-value details are already covered by the output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only a bare boolean with a default and no description, so the description carries full responsibility for explaining refresh. It does so explicitly: 'pass refresh=true to bypass the cache.'
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb-resource pair: it gets basic stats of the authenticated owner's YouTube channel, and enumerates the exact fields returned (subscribers, total views, video count, uploads playlist id). However, it does not explicitly contrast this with the sibling get_channel_metrics, so some differentiation is left implicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given for when to choose this tool over get_channel_metrics, list_videos, get_retention_curve, or analyze_pillar_performance. The only usage note is about refresh=true and caching, which addresses parameter behavior rather than tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_retention_curveARead-only
Audience retention curve for one video: a list of points {ratio, watch_ratio, relative} across the video's elapsed-time ratio.
| Name | Required | Description | Default |
|---|---|---|---|
| refresh | No | ||
| video_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true, so the description does not need to restate safety. The description adds useful context about the output structure (list of points with ratio, watch_ratio, relative), but it does not disclose details like whether the curve is normalized, how missing data is handled, or whether refresh forces a recomputation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that front-loads the core purpose and includes the key output structure. Every word earns its place, and there is no redundant restating of the tool name or schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only single-video tool with a simple schema, the description is mostly adequate. However, with no output schema and no explanation of the 'refresh' parameter or the meaning of the returned fields, an agent may not know how to interpret the response or when to set refresh. It is minimally viable but has clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for parameter meaning. It explains the output semantics but does not explain the 'refresh' parameter or the expected format of video_id beyond the schema's basic type. The description adds some value by clarifying the output fields, but leaves parameter-level meaning mostly to the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('get') and resource ('audience retention curve for one video') and defines the returned data shape as a list of points with ratio, watch_ratio, and relative fields. It is clear what the tool does, though it does not explicitly distinguish it from sibling tools like get_channel_metrics or analyze_pillar_performance.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for retrieving retention data for a single video, and the required video_id parameter makes the context clear. However, it does not state when to prefer this over siblings or mention any exclusions, such as not being suitable for channel-level retention analysis.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_videosARead-only
Every uploaded video (id, title, publish date, ISO-8601 duration) via the uploads playlist. Cached; pass refresh=true to bypass the cache.
| Name | Required | Description | Default |
|---|---|---|---|
| refresh | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish readOnlyHint=true, and the description adds meaningful behavioral context: results are cached, refresh=true bypasses the cache, and the data comes from the uploads playlist. This goes beyond the structured annotation without contradicting it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single efficient sentence: it front-loads the purpose and output fields, then adds the caching note and parameter behavior. Every phrase contributes useful information with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple list tool with one optional parameter, the description is complete: it names the exact fields returned, identifies the data source, and explains the cache behavior. The output schema is absent, so the field list in the description adequately compensates.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description carries the full burden for the only parameter, refresh. It explicitly explains that passing refresh=true bypasses the cache, which gives the agent actionable semantics beyond the raw boolean schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('list') and resource ('videos'), and further specifies the scope ('every uploaded video') and return fields (id, title, publish date, ISO-8601 duration). It is immediately clear what this tool does and how it differs from channel-level metric siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'every uploaded video' makes the primary use case explicit: retrieve the complete set of uploaded videos. It does not explicitly name sibling tools or exclusion criteria, but the video-listing scope is clear enough that an agent would not confuse it with channel metrics or retention curves.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
analyze_pillar_performance - First observed
get_channel_metrics - First observed
get_channel_overview - First observed
get_retention_curve - First observed
list_videos
TDQS
Scored across 5 tools
Each tool targets a distinct resource or analytical view: channel overview, channel analytics, video list, retention curve, and pillar aggregation. Even the two channel-level tools are clearly separated by cached current stats vs. date-range analytics.
Tool names follow a consistent verb_noun pattern: get_ for single retrievals, list_ for collections, and analyze_ for derived analysis. All names use snake_case and clearly communicate their action.
Five tools is a well-scoped size for an analytics-focused YouTube Studio server. Each tool serves a distinct part of the workflow without unnecessary redundancy or sprawl.
The set covers channel-level stats, video listing, retention, and pillar analysis, but there are notable gaps such as per-video performance metrics, video metadata updates, and any management actions. It works well for read-only analytics but is not a complete YouTube Studio surface.
Maintenance
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceA local stdio MCP server that gives Claude (or any MCP client) full programmatic control over a single YouTube channel, including video upload, channel management, comments, analytics, and more.4617 npmMIT
- AlicenseNot gradedqualityDmaintenanceA local MCP server that connects Claude to your YouTube channel, enabling video analysis, performance tracking, comment reading, and niche suggestions.13 npmMIT
- AlicenseAqualityCmaintenanceA local-first MCP server for inspecting and managing a creator-owned YouTube channel, using Google's official YouTube Data API v3 and Analytics API.1015 npmMIT
- AlicenseNot gradedqualityAmaintenanceA local, privacy-first MCP server providing direct access to official YouTube Data, Analytics, Reporting, and Live Streaming APIs for creators, enabling channel analysis, research, and guarded management operations.2MIT