The YouTube Content Management MCP server provides YouTube Data API v3 integration for content discovery and analytics, enabling AI assistants to search for videos, channels, playlists, and retrieve detailed metrics for each.
google-api-python-client, python-dotenv, pydanticClone the repository
git clone https://github.com/NastyRunner13/youtube-content-management-mcp
cd youtube-content-management-mcp
Install dependencies
pip install -r requirements.txt
Or if using uv:
uv install
Set up your environment (Optional)
Create a .env file in the project root:
YOUTUBE_API_KEY=your_youtube_api_key_here
Install the MCP extension in VSCode
Configure the MCP server by adding this to your VSCode settings.json:
{
"mcp.servers": {
"youtube-content-management": {
"command": "python",
"args": [
"/path/to/youtube-content-management-mcp/main.py"
],
"env": {
"YOUTUBE_API_KEY": "your_youtube_api_key_here"
}
}
}
}
Alternative using uv:
{
"mcp.servers": {
"youtube-content-management": {
"command": "uv",
"args": [
"--directory",
"/path/to/youtube-content-management-mcp",
"run",
"main.py"
],
"env": {
"YOUTUBE_API_KEY": "your_youtube_api_key_here"
}
}
}
}
Restart VSCode or reload the window
Use the tools through the MCP panel or by asking your AI assistant
Add this configuration to your Claude Desktop config file:
Windows: %APPDATA%/Claude/claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"youtube-content-management": {
"command": "python",
"args": ["/path/to/youtube-content-management-mcp/main.py"],
"env": {
"YOUTUBE_API_KEY": "your_youtube_api_key_here"
}
}
}
}
The server implements the standard MCP protocol and should work with any compatible MCP client. Refer to your client's documentation for configuration instructions.
Search YouTube for videos with advanced filtering options, including metrics like view count, like count, and comment count.
Parameters:
query (string, required): Search querymax_results (integer, optional): Maximum number of results (1-50, default: 25)order (string, optional): Sort order - "relevance", "date", "rating", "viewCount" (default: "relevance")duration (string, optional): Video duration - "medium", "long" (default: "medium")published_after (string, optional): RFC 3339 timestamp (e.g., "2023-01-01T00:00:00Z")Example usage:
Search for Python tutorials uploaded in the last year, sorted by view count
Find YouTube channels based on search queries, including metrics like subscriber count, video count, and total view count.
Parameters:
query (string, required): Search query for channelsmax_results (integer, optional): Maximum number of results (1-50, default: 25)published_after (string, optional): RFC 3339 timestamp (e.g., "2023-01-01T00:00:00Z")Example usage:
Find coding tutorial channels
Search YouTube for playlists based on search queries.
Parameters:
query (string, required): Search query for playlistsmax_results (integer, optional): Maximum number of results (1-50, default: 25)published_after (string, optional): RFC 3339 timestamp (e.g., "2023-01-01T00:00:00Z")Example usage:
Find playlists about machine learning
Retrieve statistics for a specific YouTube video, including view count, like count, and comment count.
Parameters:
video_id (string, required): The YouTube video IDExample usage:
Get metrics for the video with ID dQw4w9WgXcQ
Retrieve statistics for a specific YouTube channel, including subscriber count, total view count, and video count.
Parameters:
channel_id (string, required): The YouTube channel IDExample usage:
Get metrics for the channel with ID UC_x5XG1OV2P6uZZ5FSM9Ttw
Retrieve statistics for a specific YouTube playlist, including item count and total view count of all videos.
Parameters:
playlist_id (string, required): The YouTube playlist IDExample usage:
Get metrics for the playlist with ID PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU
Once the MCP server is configured, you can interact with it through your AI assistant:
Video Search with Metrics:
"Search for machine learning tutorials from the last 6 months, sorted by view count, and show view counts"
Channel Discovery with Metrics:
"Find top cooking channels on YouTube with their subscriber counts"
Playlist Search:
"Show me playlists about Python programming"
Video Metrics:
"Get the view count and like count for the video with ID dQw4w9WgXcQ"
Channel Metrics:
"What are the subscriber count and total views for the channel UC_x5XG1OV2P6uZZ5FSM9Ttw?"
Playlist Metrics:
"How many videos and total views are in the playlist PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU?"
"YouTube API key is not set"
"quotaExceeded" errors
"keyInvalid" errors
"Invalid input arguments" errors
query, invalid order)MCP server not starting
To enable debug logging, add this to your environment:
"env": {
"YOUTUBE_API_KEY": "your_key_here",
"DEBUG": "true"
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "youtube-content-management" '{"command":"python","args":["/path/to/youtube-content-management-mcp/main.py"],"env":{"YOUTUBE_API_KEY":"your_youtube_api_key_here"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"youtube-content-management": {
"command": "python",
"args": [
"/path/to/youtube-content-management-mcp/main.py"
],
"env": {
"YOUTUBE_API_KEY": "your_youtube_api_key_here"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"youtube-content-management": {
"command": "python",
"args": [
"/path/to/youtube-content-management-mcp/main.py"
],
"env": {
"YOUTUBE_API_KEY": "your_youtube_api_key_here"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect