YouTube MCP Server
Enables searching for YouTube videos through natural language commands and playing videos or search results as playlists in the browser.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YouTube MCP Server find and play some lofi hip hop beats for studying"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
YouTube MCP Server
A Model Context Protocol (MCP) server that enables AI agents to search and play YouTube videos through natural language commands.
Features
searchVideos: Search YouTube for videos matching any query
playPlaylist: Open videos in your default browser as a playlist
Related MCP server: mcp-server-youtube
Prerequisites
Node.js 18+ installed
YouTube Data API v3 key from Google Cloud Console
Getting a YouTube API Key
Go to Google Cloud Console
Create a new project (or select existing)
Navigate to APIs & Services > Library
Search for "YouTube Data API v3" and enable it
Go to APIs & Services > Credentials
Click Create Credentials > API Key
Copy your API key
Installation
Clone the repository
Install dependencies:
npm installConfigure Environment Variables: Create a
.envfile in the root directory (copy from.env.example):cp .env.example .envEdit
.envand add yourYOUTUBE_API_KEY.Build the project:
npm run build
Add the following to your MCP configuration (e.g., .cursor/mcp.json or Claude Desktop config):
{
"mcpServers": {
"youtube-mcp": {
"command": "node",
"args": ["/path/to/your/project/youtubeMCP/dist/index.js"]
}
}
}Note: The server will automatically load the
YOUTUBE_API_KEYfrom the.envfile in the project directory. Alternatively, you can pass it directly in theenvobject in the JSON config above.
Usage Examples
Once configured, you can ask your AI agent:
"Search for 10 best English songs on YouTube"
"Play 5 relaxing piano music videos"
"Find Taylor Swift songs and play them"
"Search for coding tutorials"
Available Tools
searchVideos
Search YouTube for videos by query.
Parameters:
query(string, required): Search querymaxResults(number, optional): Number of results (1-50, default: 10)
playPlaylist
Play videos in the browser.
Parameters:
videoIds(string[], optional): Array of video IDs to playquery(string, optional): Search and play videos matching this querymaxResults(number, optional): Number of videos when using query (default: 10)
Development
# Watch mode for development
npm run dev
# Build
npm run build
# Start
npm startProject Structure
YouTubeMCP/
├── package.json
├── tsconfig.json
├── README.md
├── src/
│ ├── index.ts # MCP server entry point
│ ├── youtube-client.ts # YouTube API wrapper
│ └── tools/
│ ├── search.ts # searchVideos tool
│ └── play.ts # playPlaylist tool
└── dist/ # Compiled JavaScriptLicense
MIT
Available Tools
2 toolsplayPlaylistA
Play YouTube videos in the browser. Provide video IDs directly or a search query to find and play videos automatically.
Inputs: videoIds, query, maxResults.
searchVideosC
Search for YouTube videos by query. Returns video IDs, titles, channels, and descriptions.
Inputs: query (required), maxResults.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: playPlaylist is for playing videos in the browser, while searchVideos is for searching and returning video metadata. There is no overlap in functionality, making it easy for an agent to choose the correct tool based on the task.
The naming is inconsistent: playPlaylist uses camelCase, while searchVideos uses a verb_noun pattern. This mix of conventions lacks a predictable pattern, which could confuse agents expecting uniformity across tools.
With only 2 tools, the server feels thin for a YouTube domain, which typically involves operations like listing playlists, managing subscriptions, or uploading videos. The current set is insufficient for comprehensive YouTube interactions, suggesting a significant under-scoping.
The tool surface is severely incomplete for a YouTube server. It lacks basic CRUD operations such as creating playlists, managing subscriptions, or handling user accounts. The existing tools cover only playback and search, leaving major gaps that will likely cause agent failures in broader tasks.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
Search YouTube videos, read transcripts and get public video information in your AI assistant.
YouTube for AI agents: transcripts, comments, video stats, channel monitor, Shorts captions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with YouTube through the YouTube Data API, allowing users to search for videos, playlists, and channels, generate video titles using AI, and manage YouTube content through natural language commands.22ISC
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search videos, read channels, browse playlists, fetch comments, and get transcripts from YouTube using the YouTube Data API v3 and InnerTube API for captions.2GPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search videos, channels, and playlists, retrieve video metadata, transcripts, and comments via the YouTube Data API v3.59 PyPI68MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI models to search, retrieve, and analyze YouTube videos, channels, playlists, and transcripts via the YouTube Data API, with automatic API key failover.503 npmMIT