YouTube MCP server

Integrates with YouTube API to enable video search, channel discovery, and trending content retrieval for content research and analysis workflows.
Back to servers
Provider
Nocodeboy
Release date
Mar 20, 2025
Language
TypeScript
Stats
1 star

This MCP server enables AI assistants like Claude to access YouTube data through the Model Context Protocol, providing tools to search videos and channels, and retrieve detailed information about specific YouTube content.

Requirements

  • Node.js v16 or higher
  • A YouTube API key (obtained from the Google Developer Console)

Installation

  1. Clone the repository:

    git clone https://github.com/Nocodeboy/youtube-mcp-server.git
    cd youtube-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file in the project root and add your YouTube API key:

    YOUTUBE_API_KEY=your_api_key_here
    

Starting the Server

To start the server, run:

npm start

Integration with Claude Desktop

To use this MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json file (typically located in %APPDATA%\Claude\ on Windows or ~/Library/Application Support/Claude/ on macOS):

{
  "mcpServers": {
    "youtube": {
      "command": "node",
      "args": ["path/to/youtube-mcp-server/index.js"],
      "env": {
        "YOUTUBE_API_KEY": "your_api_key_here"
      }
    }
  }
}

Replace "path/to/youtube-mcp-server/index.js" with the absolute path to the index.js file, and "your_api_key_here" with your YouTube API key.

Available Tools

Search Videos

Search for videos on YouTube based on a query.

search_videos

Parameters:

  • query (string, required): Search terms
  • maxResults (number, optional): Maximum number of results (between 1 and 50)
  • pageToken (string, optional): Token to get the next page of results

Get Video Details

Get detailed information about a specific video.

get_video_details

Parameters:

  • videoId (string, required): YouTube video ID

Get Channel Details

Get detailed information about a specific channel.

get_channel_details

Parameters:

  • channelId (string, required): YouTube channel ID

Search Channels

Search for channels on YouTube based on a query.

search_channels

Parameters:

  • query (string, required): Search terms
  • maxResults (number, optional): Maximum number of results (between 1 and 50)
  • pageToken (string, optional): Token to get the next page of results

Available Resources

  • youtube://popular/videos: List of currently popular videos on YouTube

Usage Examples

With Claude Desktop, you can ask questions like:

  • "Search for Python programming videos"
  • "Show me details of video with ID dQw4w9WgXcQ"
  • "Search for cooking-related channels"
  • "Give me information about the GoogleDevelopers channel"
  • "What are the most popular videos right now?"

Getting a YouTube API Key

To get a YouTube API key:

  1. Go to the Google Developer Console
  2. Create a new project (or select an existing one)
  3. In the sidebar, select "API Library"
  4. Search for "YouTube Data API v3" and enable it
  5. In the sidebar, select "Credentials"
  6. Click on "Create credentials" and select "API key"
  7. Copy the generated key and use it in your .env file or in the Claude Desktop configuration

Troubleshooting

If you encounter errors, check:

  • That you have installed all dependencies with npm install
  • That your YouTube API key is valid
  • That you have the YouTube Data API v3 enabled in your Google project
  • That you are using Node.js version 16 or higher
  • If you use Claude Desktop, check the logs in %APPDATA%\Claude\logs\ (Windows) or ~/Library/Logs/Claude/ (macOS)

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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