YouTube organic analytics — channel stats, video performance, watch time & audience insights.
MCP server for YouTube organic analytics — channel stats, video performance, watch time, and audience engagement via the YouTube Data API v3 and YouTube Analytics API v2.
Built for Claude Code and any MCP-compatible AI tool. Gives your AI assistant direct, read-only access to your own channel's organic data — subscribers, views, watch time, per-video engagement, and day-by-day trends.
Part of The SEO Engine toolkit by Rex Jones — AI-powered SEO and social media tooling for agencies and businesses.
| Tool | Description |
|---|---|
list_accounts | List configured channels and the default |
get_channel_info | Channel profile + lifetime stats (subscribers, total views, video count, uploads playlist) |
get_videos | Paginated uploads with per-video views, likes, comments, duration |
get_video_details | Details for specific video IDs (batch up to 50) |
get_channel_analytics | Channel analytics over a date range: views, watch time, avg view duration/%, subs gained/lost, likes, comments, shares — optionally by day |
get_video_analytics | The same metrics for a single video over a date range |
All tools accept an optional account parameter for multi-account setups.
In Google Cloud Console (any project — you can reuse an existing one), enable YouTube Data API v3 and YouTube Analytics API.
Create an OAuth client of type Desktop app and download its client_secret JSON. Then run the helper (needs pip install google-auth-oauthlib):
python3 scripts/get_youtube_token.py /path/to/client_secret.json my-channel
Authorize with the Google account that owns the channel (pick the Brand Account if prompted). It prints the three YOUTUBE_* values to drop into your config and writes them to .youtube_account.json (gitignored).
Add to your Claude Code MCP settings:
{
"mcpServers": {
"youtube-organic": {
"command": "node",
"args": ["/path/to/youtube-organic-mcp/dist/index.js"],
"env": {
"YOUTUBE_CLIENT_ID": "your_client_id.apps.googleusercontent.com",
"YOUTUBE_CLIENT_SECRET": "your_client_secret",
"YOUTUBE_REFRESH_TOKEN": "1//your_refresh_token"
}
}
}
}
Or set YOUTUBE_ACCOUNTS to a JSON array for multiple channels (see .env.example).
src/
index.ts # MCP server entry point, tool registration
accounts.ts # Multi-account resolution (client_id/secret/refresh_token)
client.ts # OAuth token minting + Data/Analytics API HTTP client
types.ts # TypeScript interfaces for API responses
tools/
channel.ts # get_channel_info + uploads-playlist resolver
videos.ts # get_videos, get_video_details
analytics.ts # get_channel_analytics, get_video_analytics
fetch (Node 18+)MIT
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y youtube-organic-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-lanternrow-youtube-organic-mcp": {
"command": "npx",
"args": [
"-y",
"youtube-organic-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceyoutube-organic-mcpnpmio.github.lanternrow/youtube-organic-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.