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.
Clone the repository:
git clone https://github.com/Nocodeboy/youtube-mcp-server.git
cd youtube-mcp-server
Install dependencies:
npm install
Create a .env
file in the project root and add your YouTube API key:
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 (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.
Search for videos on YouTube based on a query.
search_videos
Parameters:
query
(string, required): Search termsmaxResults
(number, optional): Maximum number of results (between 1 and 50)pageToken
(string, optional): Token to get the next page of resultsGet detailed information about a specific video.
get_video_details
Parameters:
videoId
(string, required): YouTube video IDGet detailed information about a specific channel.
get_channel_details
Parameters:
channelId
(string, required): YouTube channel IDSearch for channels on YouTube based on a query.
search_channels
Parameters:
query
(string, required): Search termsmaxResults
(number, optional): Maximum number of results (between 1 and 50)pageToken
(string, optional): Token to get the next page of resultsyoutube://popular/videos
: List of currently popular videos on YouTubeWith Claude Desktop, you can ask questions like:
To get a YouTube API key:
.env
file or in the Claude Desktop configurationIf you encounter errors, check:
npm install
%APPDATA%\Claude\logs\
(Windows) or ~/Library/Logs/Claude/
(macOS)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 > 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"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.