
Model Context Protocol server for YouTube API - search videos, manage playlists
概览
A Model Context Protocol (MCP) server for YouTube API integration. Search videos, manage playlists, and interact with YouTube directly through Claude Desktop or other MCP clients. - 🔍 Search YouTube videos - 📋 Create and manage playlists - ➕ Add videos to playlists - 📝 List user playlists - 🗑️ Delete playlists - Node.js 18 or higher - YouTube Data API v3 access - Google Cloud Console account 1. Go to Google Cloud Console 2. Create a new project or select existing one 3. Note your Project ID 1. In Google Cloud Console, go to "APIs & Services" > "Library" 2. Search for "YouTube Data API v3" 3. Click on it and press "Enable" : If you see "YouTube Data API v3 has not been used in project before or it is disabled", wait 2-3 minutes after enabling for it to propagate. 1. Go to "APIs & Services" > "Credentials" 2. Click "+ CREATE CREDENTIALS" > "OAuth client ID" 3.
README
以下为原文 README 节选,完整内容请查看原文。
YouTube MCP Server
A Model Context Protocol (MCP) server for YouTube API integration. Search videos, manage playlists, and interact with YouTube directly through Claude Desktop or other MCP clients.
Features
- 🔍 Search YouTube videos
- 📋 Create and manage playlists
- ➕ Add videos to playlists
- 📝 List user playlists
- 🗑️ Delete playlists
Prerequisites
- Node.js 18 or higher
- YouTube Data API v3 access
- Google Cloud Console account
Installation
Option 1: Install from npm (Recommended)
npm install -g @a.ardeshir/youtube-mcp
Option 2: Install from GitHub
git clone https://github.com/aardeshir/youtube-mcp.git
cd youtube-mcp
npm install
Setup
1. Set Up YouTube API
Step 1: Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select existing one
- Note your Project ID
Step 2: Enable YouTube Data API v3
- In Google Cloud Console, go to “APIs & Services” > “Library”
- Search for “YouTube Data API v3”
- Click on it and press “Enable”
Common Issue: If you see “YouTube Data API v3 has not been used in project before or it is disabled”, wait 2-3 minutes after enabling for it to propagate.
Step 3: Create OAuth 2.0 Credentials
- Go to “APIs & Services” > “Credentials”
- Click “+ CREATE CREDENTIALS” > “OAuth client ID”
- If prompted, configure OAuth consent screen:
- Choose “External” (or “Internal” for Workspace)
- Fill required fields (app name, support email)
- Add your email as a test user
- For scopes, add:
https://www.googleapis.com/auth/youtube
- For Application type, select “Web application”
- Add authorized redirect URI:
http://localhost:8080/callback - Save and note your Client ID and Client Secret
Step 4: Get API Key (Optional - for read-only access)
- Go to “APIs & Services” > “Credentials”
- Click “+ CREATE CREDENTIALS” > “API key”
- Restrict the key to YouTube Data API v3
2. Authenticate
Run the OAuth setup wizard:
If installed via npm:
youtube-mcp-setup
If installed from GitHub:
npm run auth-setup
This will:
- Prompt for your Client ID and Client Secret
- Open browser for Google authorization
- Generate refresh token automatically
- Create
.envfile with your credentials
3. Configure Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on Mac):
If installed via npm:
{
"mcpServers": {
"youtube-mcp": {
"command": "npx",
"args": ["-y", "@a.ardeshir/youtube-mcp"],
"env": {
"YOUTUBE_API_KEY": "your-api-key",
"YOUTUBE_CLIENT_ID": "your-client-id",
"YOUTUBE_CLIENT_SECRET": "your-client-secret",
"YOUTUBE_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}
If installed from GitHub:
{
"mcpServers": {
"youtube-mcp": {
"command": "node",
安装
npx -y @a.ardeshir/youtube-mcp配置
{
"mcpServers": {
"youtube-mcp": {
"command": "npx",
"args": ["-y", "@a.ardeshir/youtube-mcp"],
"env": {
"YOUTUBE_API_KEY": "your-api-key",
"YOUTUBE_CLIENT_ID": "your-client-id",
"YOUTUBE_CLIENT_SECRET": "your-client-secret",
"YOUTUBE_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}