YouTube Content Management MCP server

Integrates with YouTube Data API v3 to provide channel and video discovery capabilities with comprehensive filtering options for duration, upload date, and sort order, enabling content creators and marketers to research competitors and analyze content landscapes.
Back to servers
Setup instructions
Provider
NastyRunner13
Release date
Jul 21, 2025
Language
Go
Stats
1 star

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.

Prerequisites

  • Python 3.8 or higher
  • YouTube Data API v3 key
  • VSCode with MCP extension (for VSCode usage)
  • Required Python packages: google-api-python-client, python-dotenv, pydantic

Getting Your YouTube API Key

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3:
    • Navigate to "APIs & Services" > "Library"
    • Search for "YouTube Data API v3"
    • Click on it and press "Enable"
  4. Create credentials:
    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "API Key"
    • Copy the generated API key
  5. (Recommended) Restrict the API key:
    • Click on the API key to edit it
    • Under "API restrictions", select "Restrict key"
    • Choose "YouTube Data API v3"
    • Save the changes

Installation

  1. Clone the repository

    git clone https://github.com/NastyRunner13/youtube-content-management-mcp
    cd youtube-content-management-mcp
    
  2. Install dependencies

    pip install -r requirements.txt
    

    Or if using uv:

    uv install
    
  3. Set up your environment (Optional) Create a .env file in the project root:

    YOUTUBE_API_KEY=your_youtube_api_key_here
    

Usage

With VSCode

  1. Install the MCP extension in VSCode

  2. 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"
          }
        }
      }
    }
    
  3. Restart VSCode or reload the window

  4. Use the tools through the MCP panel or by asking your AI assistant

With Claude Desktop

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"
      }
    }
  }
}

With Other MCP Clients

The server implements the standard MCP protocol and should work with any compatible MCP client. Refer to your client's documentation for configuration instructions.

Available Tools

search_videos

Search YouTube for videos with advanced filtering options, including metrics like view count, like count, and comment count.

Parameters:

  • query (string, required): Search query
  • max_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

search_channels

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 channels
  • max_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_playlists

Search YouTube for playlists based on search queries.

Parameters:

  • query (string, required): Search query for playlists
  • max_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

get_video_metrics

Retrieve statistics for a specific YouTube video, including view count, like count, and comment count.

Parameters:

  • video_id (string, required): The YouTube video ID

Example usage:

Get metrics for the video with ID dQw4w9WgXcQ

get_channel_metrics

Retrieve statistics for a specific YouTube channel, including subscriber count, total view count, and video count.

Parameters:

  • channel_id (string, required): The YouTube channel ID

Example usage:

Get metrics for the channel with ID UC_x5XG1OV2P6uZZ5FSM9Ttw

get_playlist_metrics

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 ID

Example usage:

Get metrics for the playlist with ID PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU

Example Interactions

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?"

Troubleshooting

Common Issues

  1. "YouTube API key is not set"

    • Ensure your API key is properly configured in the environment variables
    • Check that the key is valid and has YouTube Data API v3 enabled
  2. "quotaExceeded" errors

    • You've hit your daily API quota limit (default: 10,000 units)
    • Wait until the quota resets (daily) or increase your quota in Google Cloud Console
  3. "keyInvalid" errors

    • Your API key is invalid or has been revoked
    • Generate a new API key and update your configuration
  4. "Invalid input arguments" errors

    • Check the error message for details (e.g., missing query, invalid order)
    • Ensure inputs match the tool's parameter requirements
  5. MCP server not starting

    • Check that all dependencies are installed
    • Verify the Python path in your configuration is correct
    • Check the MCP extension logs for detailed error messages

Debug Mode

To enable debug logging, add this to your environment:

"env": {
  "YOUTUBE_API_KEY": "your_key_here",
  "DEBUG": "true"
}

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. 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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later