The YouTube MCP Server is a specialized server that enables Claude and other AI assistants to interact with the YouTube API. It provides tools for searching videos, retrieving video details, searching channels, and obtaining channel information. This implementation leverages the Model Context Protocol (MCP), an open standard developed by Anthropic to connect AI models with external data sources.
The Model Context Protocol (MCP) is a universal bridge for AI, allowing models like Claude to access external data sources and tools in a standardized way. It ensures seamless integration with various content repositories, business services, or applications.
Clone the repository:
shell
git clone https://github.com/Nocodeboy/youtube-mcp-server.git
cd youtube-mcp-server
Install dependencies:
shell
npm install
Create a .env
file in the project root and add your YouTube API key:
plaintext
YOUTUBE_API_KEY=your_api_key_here
To start the server, run:
npm start
To use this MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json
file:
{
"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.
Search for videos on YouTube based on a query.
Function:
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
Retrieve detailed information about a specific video.
Function:
get_video_details
Parameters:
- videoId
(string, required): YouTube video ID
Retrieve detailed information about a specific channel.
Function:
get_channel_details
Parameters:
- channelId
(string, required): YouTube channel ID
Search for channels on YouTube based on a query.
Function:
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
youtube://popular/videos
: List of currently popular videos on YouTube 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?"
.env
file or Claude Desktop configuration. If you encounter errors, check:
1. That you have installed all dependencies with npm install
.
2. That your YouTube API key is valid.
3. That you have the YouTube Data API v3 enabled in your Google project.
4. That you are using Node.js version 16 or higher.
5. If using Claude Desktop, check the logs in %APPDATA%\Claude\logs\
(Windows) or ~/Library/Logs/Claude/
(macOS).
Contributions are welcome! You can:
1. Report bugs or issues.
2. Suggest new features.
3. Submit pull requests with improvements or fixes.
4. Improve documentation.
This project is licensed under the MIT License. See the LICENSE file for details.