Skip to main content
Glama

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 MCP Server

Setup

1. Google Cloud Console

  1. Create a project

  2. Enable the following 3 APIs

    • YouTube Analytics API

    • YouTube Reporting API

    • YouTube Data API v3

  3. Configure the OAuth consent screen (user type = External, add your own Google account as a test user)

  4. Credentials > OAuth client ID > Create one with application type = Desktop app, and download the JSON

  5. Place the downloaded JSON in the root of this repository under the name client_secret.json

    Never commit client_secret.json or the token.json created after the first authentication. It is already in .gitignore, but be careful not to run git add -f by 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 install

3. 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-job

On the first run, a browser opens and asks for authentication (after that, token.json handles automatic renewal).

4. Start the MCP server

npm start

To 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-reports

CSVs 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

get_channel_summary

start_date, end_date

Views, watch time, and subscriber changes for the whole period

list_top_videos

start_date, end_date, limit

Top videos by views and their basic metrics

get_video_stats

video_id, start_date, end_date

Detailed metrics for a specified video

get_retention_curve

video_id, start_date(optional), end_date(optional)

Audience retention curve (in 10% steps) + point of greatest drop-off

get_traffic_sources

video_id or start_date+end_date

Breakdown of traffic sources

get_reach

start_date, end_date

Thumbnail impressions and CTR (aggregated from locally stored CSVs)

get_comments

video_id, limit

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_reach only looks at CSVs already downloaded locally. Data for periods when download-reports.js was not run will not appear.

  • The exact column structure of channel_reach_basic_a1 / channel_reach_combined_a1 is unconfirmed. get_reach has 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 npm start locally (stdio)

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.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides AI assistants with comprehensive YouTube analytics and channel management capabilities, including channel performance, video analytics, audience insights, and content strategy tools.
    39
    1
  • A
    license
    A
    quality
    D
    maintenance
    Enables YouTube integration with Claude Code, including video search, metadata retrieval, transcript fetching, channel exploration, and trending videos.
    8
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    6
    21
    MIT

View all related MCP servers

Related MCP Connectors

  • YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.

  • Agent-callable creator intelligence: 952+ scored YouTube creators across 180 niches.

  • Provide token-optimized, structured YouTube data to enhance your LLM applications. Access efficien…

View all MCP Connectors

Latest Blog Posts

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/Zavier0305/youtube-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server