YouTube

Provides a YouTube search and playlist playback MCP server for AI agents via natural language commands.
  • typescript

1

GitHub Stars

typescript

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "hitendrapal3-youtubemcp": {
      "command": "node",
      "args": [
        "/path/to/your/project/youtubeMCP/dist/index.js"
      ],
      "env": {
        "YOUTUBE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You can run a dedicated MCP server that lets your AI agents search YouTube videos and play playlists through natural language commands. This server connects to YouTube Data API v3, handles queries, and opens videos in your browser as a playlist, making it practical to integrate video search and playback into your workflows.

How to use

To use this MCP server, run it alongside your MCP client workflow and point your client configuration to the local server. You can issue natural language prompts like asking it to search for specific YouTube videos or to play a chosen set of videos as a playlist. The server handles querying YouTube, returning results, and launching playback in your browser.

How to install

Prerequisites you must have before installing this MCP server:

  • Node.js 18 or newer installed on your system.

  • A YouTube Data API v3 key obtained from Google Cloud Console.

Install steps

Clone the repository to your local machine.

Install dependencies for the project using npm.

npm install

Create a local environment file and configure your YouTube API key.

cp .env.example .env

Edit the .env file and add your YouTube API key under YOUTUBE_API_KEY.


Build the project to generate runnable artifacts.

npm run build

## MCP configuration and runtime

Configure your MCP client to load the server as an MCP endpoint. The following example shows a local stdio configuration that starts the MCP server from the compiled build.

{ "mcpServers": { "youtube_mcp": { "command": "node", "args": ["/path/to/your/project/youtubeMCP/dist/index.js"] } } }

## Notes on environment variables

The server automatically loads YOUTUBE\_API\_KEY from the .env file located in the project directory. If you prefer, you can provide the API key directly through the MCP configuration by including it in the env object for the server.

## Troubleshooting

If you encounter issues connecting to the YouTube API, double-check that your API key is valid and has the YouTube Data API v3 enabled in the Google Cloud Console. Ensure the .env file is present at the project root and that the key is correctly named as YOUTUBE\_API\_KEY.

## Development and project structure

The project uses TypeScript and compiles to JavaScript in the dist directory. You can run a development watcher, build, and start the server using the commands below.

Watch mode for development

npm run dev

Build

npm run build

Start

npm start


## Available tools

### searchVideos

Search YouTube for videos by a query. Returns a list of matching video results with basic metadata.

### playPlaylist

Open a set of videos in your browser as a playlist based on provided video IDs or a query to fetch matching videos.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
YouTube MCP Server - hitendrapal3/youtubemcp | VeilStrat