@m8lab/mcp-youtube
v1.0.0
Published
MCP server for YouTube — upload videos, manage playlists, moderate comments via Claude Code/Desktop
Downloads
43
Maintainers
Readme
@m8lab/mcp-youtube
MCP server for YouTube — upload videos, manage playlists, and moderate comments via Claude Code/Desktop.
Install
npx @m8lab/mcp-youtubeOr install globally:
npm install -g @m8lab/mcp-youtubeOAuth Setup Guide
You need a Google OAuth 2.0 client with the YouTube Data API v3 enabled.
1. Create OAuth 2.0 Credentials
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the YouTube Data API v3 under APIs & Services
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Choose Desktop app as the application type
- Copy the Client ID and Client Secret
2. Create a .env file
cp .env.example .envAdd your credentials:
YOUTUBE_OAUTH_CLIENT_ID=your-client-id
YOUTUBE_OAUTH_CLIENT_SECRET=your-client-secret
YOUTUBE_CHANNEL_ID=your-channel-id # optional3. Run the token helper
npm run get-tokenFollow the prompts:
- Open the authorization URL in your browser
- Grant access to your YouTube account
- Copy the authorization code and paste it
- The refresh token will be printed — add it to your
.env:
YOUTUBE_REFRESH_TOKEN=your-refresh-tokenClaude Code Configuration
Add to your Claude Code MCP config (~/.claude/mcp.json or project .mcp.json):
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "@m8lab/mcp-youtube"],
"env": {
"YOUTUBE_OAUTH_CLIENT_ID": "your-client-id",
"YOUTUBE_OAUTH_CLIENT_SECRET": "your-client-secret",
"YOUTUBE_REFRESH_TOKEN": "your-refresh-token",
"YOUTUBE_CHANNEL_ID": "your-channel-id"
}
}
}
}Claude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "@m8lab/mcp-youtube"],
"env": {
"YOUTUBE_OAUTH_CLIENT_ID": "your-client-id",
"YOUTUBE_OAUTH_CLIENT_SECRET": "your-client-secret",
"YOUTUBE_REFRESH_TOKEN": "your-refresh-token",
"YOUTUBE_CHANNEL_ID": "your-channel-id"
}
}
}
}Available Tools
| Tool | Description | Quota Cost |
|------|-------------|------------|
| upload_video | Upload a video file to YouTube | 1600 units |
| update_video | Update video title, description, tags, or privacy | 50 units |
| delete_video | Permanently delete a video from your channel | 50 units |
| create_playlist | Create a new playlist | 50 units |
| add_to_playlist | Add a video to a playlist | 50 units |
| get_channel_stats | Get channel statistics and details | 1 unit |
| get_comments | Retrieve comment threads for a video | 1 unit |
| reply_comment | Post a reply to a comment thread | 50 units |
Quota Management
YouTube Data API v3 provides 10,000 units per day by default.
Quota-intensive operations:
upload_videocosts 1,600 units — limit to ~6 uploads/day on the free tier- All other write operations cost 50 units each
- Read operations (
get_channel_stats,get_comments) cost only 1 unit
To increase your quota, request an increase via the Google Cloud Console.
Development
# Clone and install
git clone https://github.com/lmtNoLimit/mcp-youtube.git
cd mcp-youtube
npm install
# Type check
npm run typecheck
# Build
npm run build
# Watch mode
npm run dev
# Get OAuth refresh token
npm run get-tokenLicense
MIT — see LICENSE
