This MCP server implementation allows AI language models to interact with YouTube content through a standardized interface. It provides tools for retrieving video information, transcripts, channel analytics, and trend analysis through the YouTube Data API.
The easiest way to install the YouTube MCP Server for Claude Desktop is through Smithery:
npx -y @smithery/cli install @icraft2170/youtube-data-mcp-server --client claude
You can also install the server manually using npm:
# Install from npm
npm install youtube-data-mcp-server
# Or clone repository
git clone https://github.com/icraft2170/youtube-data-mcp-server.git
cd youtube-data-mcp-server
npm install
Set these environment variables to configure the server:
YOUTUBE_API_KEY
: Your YouTube Data API key (required)YOUTUBE_TRANSCRIPT_LANG
: Default caption language (optional, default: 'ko')Add the following to your Claude Desktop configuration file:
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "youtube-data-mcp-server"],
"env": {
"YOUTUBE_API_KEY": "YOUR_API_KEY_HERE",
"YOUTUBE_TRANSCRIPT_LANG": "ko"
}
}
}
}
To get your YouTube API key:
The server provides these MCP tools for interacting with YouTube:
getVideoDetails: Retrieves detailed information about YouTube videos
videoIds
(array)searchVideos: Searches for videos based on a query string
query
maxResults
getRelatedVideos: Gets videos related to a specific video
videoId
maxResults
getVideoEngagementRatio: Calculates engagement metrics for videos
videoIds
(array)videoIds
(array)lang
getChannelStatistics: Retrieves detailed metrics for channels
channelIds
(array)getChannelTopVideos: Gets the most viewed videos from a channel
channelId
maxResults
getTrendingVideos: Gets currently popular videos by region and category
regionCode
, categoryId
, maxResults
compareVideos: Compares statistics across multiple videos
videoIds
(array)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.