A Model Context Protocol (MCP) server that gives AI coding agents full control over a YouTube channel. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible client.
22 tools covering channel management, video operations, playlists, comments, search, analytics, thumbnails, and captions.
| Category | Actions |
|---|---|
| Channel | Get channel info, update description/keywords/trailer |
| Videos | List, get details, upload from local file, update metadata, delete, set thumbnails |
| Playlists | List, create, update, delete, add/remove videos |
| Comments | List comment threads, reply to comments, delete comments |
| Search | Search YouTube for videos, channels, or playlists |
| Analytics | Channel analytics (views, watch time, subs, revenue), top videos |
| Captions | List available captions/subtitles |
| Categories | List assignable video categories by region |
- Go to the Google Cloud Console
- Create a project (or select an existing one)
- Enable the YouTube Data API v3 and YouTube Analytics API
- Create an OAuth 2.0 Client ID (type: Desktop app)
- Note your Client ID and Client Secret
git clone https://github.com/mrchevyceleb/youtube-mcp.git
cd youtube-mcp
npm install
npm run buildexport GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
export GOOGLE_CLIENT_SECRET="your-client-secret"Or create a .env file (it is gitignored):
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
npm run authThis opens an interactive prompt:
- It gives you a URL to open in your browser
- Sign in with the Google account that owns your YouTube channel
- Grant permissions
- Copy the authorization code from the redirect URL
- Paste it back into the terminal
Tokens are saved locally in tokens.json (gitignored). They auto-refresh, so you only need to do this once.
Add to your Claude Code MCP config (~/.claude.json or project .mcp.json):
{
"mcpServers": {
"youtube": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}Add to your Cursor MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"youtube": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}Once connected, your AI agent gets a single youtube tool with an action parameter. Examples:
youtube({ action: "get_channel" })
youtube({ action: "list_videos", params: { maxResults: 10, orderBy: "date" } })
youtube({
action: "update_video",
params: {
videoId: "dQw4w9WgXcQ",
title: "New Title",
tags: ["tag1", "tag2", "tag3"]
}
})
youtube({
action: "upload_video",
params: {
filePath: "/path/to/my-video.mp4",
title: "How I Built This in 24 Hours",
description: "Full walkthrough of building an app with AI coding agents.",
tags: ["ai", "coding", "tutorial"],
categoryId: "28",
privacyStatus: "unlisted",
playlistId: "PLxxxxxx"
}
})
youtube({
action: "get_analytics",
params: {
startDate: "2026-02-01",
endDate: "2026-03-01",
metrics: ["views", "estimatedMinutesWatched", "subscribersGained"]
}
})
youtube({
action: "search_youtube",
params: { query: "vibe coding", type: "video", maxResults: 5 }
})
youtube({
action: "set_thumbnail",
params: {
videoId: "dQw4w9WgXcQ",
imageBase64: "<base64-encoded-image>",
mimeType: "image/jpeg"
}
})
get_channel- Get channel info (name, stats, branding)update_channel- Update description, keywords, language, country, trailer
list_videos- List videos from a channel or playlistget_video- Get full video details (stats, tags, status)upload_video- Upload a video from a local file path (resumable, any size)update_video- Update title, description, tags, category, privacydelete_video- Permanently delete a videoset_thumbnail- Upload a custom thumbnail (JPEG/PNG/BMP, max 2MB)
list_playlists- List playlists from a channelcreate_playlist- Create a new playlistupdate_playlist- Update playlist title, description, privacyadd_to_playlist- Add a video to a playlistremove_from_playlist- Remove a video from a playlistdelete_playlist- Permanently delete a playlist
list_comments- List comment threads on a videoreply_to_comment- Reply to a commentdelete_comment- Delete a comment you own
search_youtube- Search for videos, channels, or playlists
get_analytics- Channel analytics (views, watch time, subs, revenue)get_top_videos- Top-performing videos by any metric
list_captions- List available captions/subtitles for a videolist_categories- List assignable video categories by region
This server uses the Model Context Protocol to expose YouTube API operations as tools that AI agents can call. It communicates over stdio, which is the standard transport for local MCP servers.
Under the hood:
- YouTube Data API v3 for channel, video, playlist, comment, and search operations
- YouTube Analytics API v2 for analytics and top video queries
- Google OAuth 2.0 with offline access for automatic token refresh
- Zod for input validation on every action
- Router pattern to expose all 21 actions as a single tool (reduces context token overhead)
- Node.js 20+
- A Google Cloud project with YouTube Data API v3 and YouTube Analytics API enabled
- OAuth 2.0 credentials (Desktop app type)
MIT