Server data from the Official MCP Registry
Provide token-optimized, structured YouTube data to enhance your LLM applications. Access efficien…
Provide token-optimized, structured YouTube data to enhance your LLM applications. Access efficien…
Remote endpoints: streamable-http: https://server.smithery.ai/@kirbah/mcp-youtube/mcp
Valid MCP server (1 strong, 1 medium validity signals). 1 code issue detected. No known CVEs in dependencies. Imported from the Official MCP Registry. Trust signals: trusted author (3/3 approved). 1 finding(s) downgraded by scanner intelligence.
3 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Available as Local & Remote
This plugin can run on your machine or connect to a hosted endpoint. during install.
From the project's GitHub README.
A production-grade YouTube Data MCP server engineered specifically for AI agents.
Unlike standard API wrappers that flood your LLM with redundant data, this server strips away YouTube's heavy payload bloat. It is designed to save you massive amounts of context window tokens, protect your daily API quotas via caching, and run reliably without breaking your workflows.
Most MCP servers are weekend projects. @kirbah/mcp-youtube is built for reliable, daily, cost-effective agentic workflows.
The raw YouTube API returns massive JSON payloads filled with nested eTags, redundant thumbnails, and localization data that LLMs don't need. This server structures the data to give your LLM exactly what it needs to reason, and nothing else.
%%{init: { "theme": "base", "themeVariables": { "xyChart": { "plotColorPalette": "#ef4444, #22c55e" } } } }%%
xychart-beta
title "Token Consumption (Lower is Better)"
x-axis ["getVideoDetails", "searchVideos", "getChannelStats"]
y-axis "Context Tokens" 0 --> 1200
bar "Raw YouTube API" [854, 1115, 673]
bar "MCP-YouTube (Optimized)" [209, 402, 86]
| API Method | Raw YouTube Tokens | MCP-YouTube Tokens | Token Savings | Data Size |
|---|---|---|---|---|
getChannelStatistics | 673 | 86 | ~87% Less | 1.9 KB ➔ 0.2 KB |
getVideoDetails | 854 | 209 | ~75% Less | 2.9 KB ➔ 0.6 KB |
searchVideos | 1115 | 402 | ~64% Less | 3.4 KB ➔ 1.2 KB |
(Curious? You can compare the raw API responses vs optimized outputs in the examples folder).
The YouTube Data API has strict daily limits (10,000 quota units). If your LLM gets stuck in a loop or re-asks a question, standard servers will drain your API limit in minutes. This server includes an optional MongoDB caching layer. If your agent requests a video details or searches the same trending videos twice, the server serves it from the cache - costing you 0 API quota points.
Tired of MCP tools crashing your AI client? This server is built to be a rock-solid dependency:
npm run lint passes 100%).Want to just fetch transcripts? You can use this server immediately without any configuration! Just install and go. Add a YouTube API key later to unlock deep search and analytics.
The easiest way to install this server is by clicking the "Add to Claude Desktop" button on the Glama server page.
If you are configuring manually (e.g., in Cursor), just add this bare-minimum setup:
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "@kirbah/mcp-youtube"]
}
}
}
✨ Tip: In Zero-Config mode, you can ask your AI to simply "Read the transcript for youtube://transcript/{videoId}"!
If you prefer to configure your MCP client manually (e.g., Claude Desktop or Cursor), add the following to your configuration file:
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "@kirbah/mcp-youtube"],
"env": {
"YOUTUBE_API_KEY": "YOUR_YOUTUBE_API_KEY_HERE",
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://user:pass@cluster0.abc.mongodb.net/youtube_niche_analysis"
}
}
}
}
(Windows PowerShell Users: If npx fails, try using "command": "cmd" and "args": ["/k", "npx", "-y", "@kirbah/mcp-youtube"])
The server provides the following MCP tools, each designed to return token-optimized data:
| Tool Name | Description | Parameters (see details in tool schema) |
|---|---|---|
getVideoDetails | Retrieves detailed, lean information for multiple YouTube videos including metadata, statistics, engagement ratios, and content details. | videoIds (array of strings) |
searchVideos | Searches for videos or channels based on a query string with various filtering options, returning concise results. | query (string), maxResults (optional number), order (optional), type (optional), channelId (optional), etc. |
getTranscripts | Retrieves token-efficient transcripts (captions) for multiple videos, with options for full text or key segments (intro/outro). | videoIds (array of strings), lang (optional string for language code), format (optional enum: 'full_text', 'key_segments' - default 'key_segments') |
getChannelStatistics | Retrieves lean statistics for multiple channels (subscriber count, view count, video count, creation date). | channelIds (array of strings) |
getChannelTopVideos | Retrieves a list of a channel's top-performing videos with lean details and engagement ratios. | channelId (string), maxResults (optional number) |
getTrendingVideos | Retrieves a list of trending videos for a given region and optional category, with lean details and engagement ratios. | regionCode (optional string), categoryId (optional string), maxResults (optional number) |
getVideoCategories | Retrieves available YouTube video categories (ID and title) for a specific region, providing essential data only. | regionCode (optional string) |
getVideoComments | Retrieves comments for a YouTube video. Allows sorting, limiting results, and fetching a small number of replies per comment. | videoId (string), maxResults (optional number), order (optional), maxReplies (optional number), commentDetail (optional string) |
findConsistentOutlierChannels | Identifies channels that consistently perform as outliers within a specific niche. Requires a MongoDB connection. | niche (string), minVideos (optional number), maxChannels (optional number) |
For detailed input parameters and their descriptions, please refer to the inputSchema within each tool's configuration file in the src/tools/ directory (e.g., src/tools/video/getVideoDetails.ts).
Note on API Quota Costs: Most tools are highly efficient.
getVideoDetails,getChannelStatistics, andgetTrendingVideoscost only 1 unit per call. ThegetTranscriptstool has 0 API cost. The newgetVideoCommentstool has a variable cost: the base call is 1 unit, but if you request replies (by settingmaxReplies > 0), it costs an additional 1 unit for each top-level comment it fetches replies for. The search-based tools are the most expensive:searchVideoscosts 100 units andgetChannelTopVideoscosts 101 units.
If you wish to contribute, modify the server, or run it locally outside of an MCP client's managed environment:
package.json engines field - currently >=20.0.0)Clone the repository:
git clone https://github.com/kirbah/mcp-youtube.git
cd mcp-youtube
Install dependencies:
npm ci
Configure Environment:
Create a .env file in the root by copying .env.example:
cp .env.example .env
Then, edit .env to add your YOUTUBE_API_KEY:
YOUTUBE_API_KEY=your_youtube_api_key_here
MDB_MCP_CONNECTION_STRING=your_mongodb_connection_string_here
# Run in development mode with live reloading
npm run dev
# Build for production
npm run build
# Run the production build (after npm run build)
npm start
# Lint files
npm run lint
# Run tests
npm run test
npm run test -- --coverage # To generate coverage reports
# Inspect MCP server using the Model Context Protocol Inspector
npm run inspector
To have an MCP client run your local development version (instead of the published NPM package):
Ensure you have a script in package.json for a non-watching start, e.g.:
"scripts": {
"start:client": "tsx ./src/index.ts"
}
Configure your MCP client to spawn this local script:
{
"mcpServers": {
"youtube_local_dev": {
"command": "npm",
"args": ["run", "start:client"],
"working_directory": "/absolute/path/to/your/cloned/mcp-youtube",
"env": {
"YOUTUBE_API_KEY": "YOUR_LOCAL_DEV_API_KEY_HERE"
}
}
}
}
Note on the env block above: Setting YOUTUBE_API_KEY directly in the env block for the client configuration is one way to provide the API key. Alternatively, if your server correctly loads its .env file based on the working_directory, you might not need to specify it in the client's env block, as long as your local .env file in the project root contains the YOUTUBE_API_KEY. The working_directory path must be absolute and correct for the server to find its .env file.
YOUTUBE_API_KEY.>=20.0.0 (as specified in package.json)findConsistentOutlierChannels ToolThe findConsistentOutlierChannels tool is designed to identify emerging or established YouTube channels that consistently outperform their size within a specific niche. This tool is particularly useful for content creators, marketers, and analysts looking for high-potential channels.
Important Note: This tool requires a MongoDB connection to store and analyze channel data. Without MDB_MCP_CONNECTION_STRING configured, this tool will not be available.
The tool operates through a multi-phase analysis process, leveraging both YouTube Data API and a MongoDB database:
Candidate Search (Phase 1):
query to search for relevant videos and channels on YouTube.videoCategoryId and regionCode if specified.Channel Filtering (Phase 2):
channelAge (e.g., 'NEW' for channels under 6 months, 'ESTABLISHED' for 6-24 months).Deep Analysis (Phase 3):
consistencyLevel (e.g., 'MODERATE' for ~30% of videos showing outlier performance, 'HIGH' for ~50%).outlierMagnitude (e.g., 'STANDARD' for views > subscribers, 'STRONG' for views > 3x subscribers).Ranking & Formatting (Phase 4):
The behavior of this tool is primarily controlled by the following parameters:
query (string, required): The central topic or niche to analyze (e.g., "DIY home repair", "quantum computing explained").channelAge (enum: "NEW", "ESTABLISHED", default: "NEW"): Focuses the search on emerging or more mature channels.consistencyLevel (enum: "MODERATE", "HIGH", default: "MODERATE"): Sets the threshold for how consistently a channel's videos must perform as outliers.outlierMagnitude (enum: "STANDARD", "STRONG", default: "STANDARD"): Defines how significantly a video's performance must exceed typical expectations (e.g., views vs. subscribers) to be considered an "outlier."videoCategoryId (string, optional): Narrows the search to a specific YouTube category ID.regionCode (string, optional): Targets channels relevant to a particular geographical region.maxResults (number, default: 10): Limits the number of top outlier channels returned.YOUTUBE_API_KEY is sensitive. Never commit it directly to your repository. Use environment variables (e.g., via a .env file which should be listed in .gitignore).This project is licensed under the MIT License. See the LICENSE file for details.
Be the first to review this server!
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by mcp-marketplace · Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm — conversationally
by mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.
by Taylorwilsdon · Productivity
Control Gmail, Calendar, Docs, Sheets, Drive, and more from your AI