home / mcp / youtube data mcp server
Provides token-optimized access to YouTube data via MCP tools for lean LLM prompts and analyses.
Configuration
View docs{
"mcpServers": {
"kirbah-mcp-youtube": {
"command": "npx",
"args": [
"-y",
"@kirbah/mcp-youtube"
],
"env": {
"YOUTUBE_API_KEY": "YOUR_YOUTUBE_API_KEY_HERE",
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://user:[email protected]/youtube_niche_analysis"
}
}
}
}You can access lean, token-efficient YouTube data through a dedicated MCP server that returns concise, structured results for video details, transcripts, channel analysis, trending content, and more. This design minimizes token usage while preserving useful insights for AI models and LLM workflows.
To use this MCP server with any MCP-compatible client, connect using the provided MCP configuration and supply your YouTube API key and optional MongoDB connection string for caching and analytics.
Prerequisites you need before installation.
node --version
npm --versionInstall dependencies and set up the server locally.
npm ciConfigure environment variables for local development. Create a .env file in the project root and provide your YouTube API key and an optional MongoDB connection string for caching.
YOUTUBE_API_KEY=YOUR_YOUTUBE_API_KEY_HERE
MDB_MCP_CONNECTION_STRING=your_mongodb_connection_string_hereThe MCP client can be configured to spawn the local YouTube MCP server. A typical local usage involves running the server through the MCP-compatible client by specifying an npm-based start script or direct npx invocation. If you are using MongoDB for caching, ensure the database name is youtube_niche_analysis and the user has read/write permissions.
Keep your YouTube Data API key secure. Do not commit it to source control. Monitor API quotas in the Google Cloud Console and restrict your API key to YouTube Data API v3. If you enable MongoDB caching, protect your MongoDB connection string and limit access to trusted environments.
If you encounter issues starting the local MCP server, verify that the required environment variables are correctly set and that the working directory contains the appropriate .env file. Check that the YouTube API key has the necessary permissions and that the MongoDB connection is accessible when using caching.
Retrieves lean, detailed information for multiple videos, including metadata, statistics, engagement ratios, and content details.
Searches for videos or channels with a query and filters, returning concise results suitable for AI processing.
Fetches token-efficient transcripts for videos, with options for full text or key segments.
Retrieves lean statistics for channels such as subscribers, views, and video counts.
Retrieves a channel's top-performing videos with lean details and engagement ratios.
Gets trending videos by region and category with lean details and engagement metrics.
Lists available YouTube video categories for a region, providing essential data only.
Retrieves comments for a video with options to limit results and fetch a number of replies.
Identifies channels that consistently outperform within a niche, storing data in MongoDB.