youtube-playlists-mcp
Provides tools for managing YouTube playlists and searching videos via the YouTube Data API v3, including listing playlists and playlist items, adding or removing videos, creating playlists, and searching for videos.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
youtube-playlists-mcp
A small Model Context Protocol (MCP) server that wraps the YouTube Data API v3, so an AI assistant can manage your YouTube playlists (for example a "learning watch list") and search for videos.
Transport: stdio
Language: TypeScript (Node.js 22+)
Auth: OAuth 2.0 with PKCE, scope
https://www.googleapis.com/auth/youtube. Tokens refresh automatically, and a rejected token is refreshed and the call retried once.Quota-aware: every tool description states its quota cost, and search results are cached.
Tools
Tool | What it does | Quota cost |
| Lists your playlists (id, title, item count, privacy) | 1 |
| Lists videos in a playlist, with | 1 per page (50 items) |
| Adds a video (ID or URL) to a playlist | 50 |
| Removes an entry by | 50 |
| Creates a playlist (private by default) | 50 |
| Searches videos, up to 10 results | 100 (0 when served from cache) |
Quota
The default quota is 10,000 units per day per Google Cloud project and resets at midnight Pacific time. search_videos is the expensive one: about 100 uncached searches a day would use it all. Identical searches (same query, page size, page token) are cached on disk for 24 hours (YOUTUBE_SEARCH_CACHE_TTL_HOURS) and cost nothing. If you hit the limit, tools return a quotaExceeded error. See the quota calculator for costs.
Related MCP server: YouTube MCP Server
Setup
1. Google Cloud (one time, about 10 minutes)
Open the Google Cloud Console and create a project.
APIs & Services → Library: enable YouTube Data API v3.
APIs & Services → OAuth consent screen (Google Auth Platform): choose External, fill in the app name and your email, and add your Google account under Test users (Google Auth Platform → Audience → Add users). If you skip this, sign-in fails with "Access blocked: … has not completed the Google verification process".
Credentials → Create credentials → OAuth client ID, application type Desktop app. Leave "Use this client for an AI-powered agent" unticked (it is for clients that use Google's own MCP tools; this server calls the YouTube Data API directly). Copy the client ID and client secret.
Optional but recommended: once everything works, set the consent screen's publishing status to In production. For personal use you don't need Google verification (you'll see an "unverified app" warning that you can click through). While the app is in Testing, Google expires refresh tokens after 7 days, and you'd have to re-run the auth step weekly.
2. Install and build
git clone https://github.com/kvechkanov/youtube-playlists-mcp.git
cd youtube-playlists-mcp
npm install # also builds dist/Or skip the clone and run it straight from GitHub with npx github:kvechkanov/youtube-playlists-mcp (npm builds it on first use). Everywhere below, node dist/index.js and npx github:kvechkanov/youtube-playlists-mcp are interchangeable. The package is not published to the npm registry.
3. Authorize (one time)
Set your credentials in the environment (don't commit them):
export YOUTUBE_CLIENT_ID="...apps.googleusercontent.com"
export YOUTUBE_CLIENT_SECRET="..."The script works on machines where you can't open a browser to localhost (a remote box, for example). It prints a sign-in URL; after you sign in, your browser is redirected to http://localhost:8085/?code=..., which fails to load. That's expected. Copy the full URL from the address bar and give it back to the script.
Interactive:
node dist/index.js authOr in two non-interactive steps (useful when someone else relays the URL):
node dist/index.js auth url # prints the sign-in URL and saves PKCE state
node dist/index.js auth finish "http://localhost:8085/?code=...&state=..."Paste the whole URL, not just the code: its state value is checked against the one saved by url.
The refresh token is written to ~/.config/youtube-playlists-mcp/token.json with mode 600. The PKCE state from url is valid for 30 minutes and must be used on the same machine and user.
4. Run the server
YOUTUBE_CLIENT_ID=... YOUTUBE_CLIENT_SECRET=... node dist/index.jsRegister it in any MCP client (Claude Desktop, Cursor, Grok Bot, ...) as a stdio server:
{
"mcpServers": {
"youtube": {
"command": "node",
"args": ["/absolute/path/to/youtube-playlists-mcp/dist/index.js"],
"env": {
"YOUTUBE_CLIENT_ID": "...apps.googleusercontent.com",
"YOUTUBE_CLIENT_SECRET": "..."
}
}
}
}To run it from GitHub instead of a local clone, use "command": "npx" with "args": ["-y", "github:kvechkanov/youtube-playlists-mcp"] and the same env.
Without credentials or a token, the server still starts and lists its tools. Calling a tool returns an error beginning with NOT AUTHORIZED: that says what to do.
Configuration
Variable | Default | Purpose |
| (required) | OAuth client ID |
| (required) | OAuth client secret |
|
| Where the token is stored |
|
| Token and pending-auth directory. A token in the old |
|
| Search cache directory |
|
| Search cache lifetime in hours (0 or more) |
|
| Port in the redirect URI (nothing listens on it; Desktop-app clients accept any loopback port) |
Invalid numeric values (YOUTUBE_REDIRECT_PORT, YOUTUBE_SEARCH_CACHE_TTL_HOURS) stop startup with an error naming the variable.
Troubleshooting
Symptom | Fix |
Access blocked: … has not completed the Google verification process | Add your Google account under Test users (Audience page), or publish the app. |
Google hasn't verified this app warning | Expected for personal apps. Click Advanced → Go to … (unsafe). |
| Expected. Copy the full URL from the address bar and paste it into |
authorization code … expired or was already used | Run |
refresh token rejected every ~7 days | The app is in Testing. Set publishing status to In production, then re-run |
Google did not return a refresh token | Revoke the app at https://myaccount.google.com/permissions and run |
token file … is corrupt | Delete that file and run |
| The 10,000 daily units are used up. It resets at midnight Pacific time. |
Security notes
Secrets live only in environment variables and the
600-mode token file, outside the repository..gitignorealso excludestoken.json,.env, and credentials files.The scope
youtubegrants full management of your YouTube account (playlists, and more). Treat the token like a password. Revoke it any time at https://myaccount.google.com/permissions.The server only calls Google endpoints (
accounts.google.com,oauth2.googleapis.com,www.googleapis.com).
Development
npm run build # compile to dist/
npm run lint # Biome; `npm run format` fixes
npm run typecheck
npm test # builds, then runs the testsThe tests start the server and the auth CLI in an empty home directory against a local mock of Google's endpoints, so they make no network calls. See CONTRIBUTING.md and the CHANGELOG.
License
MIT © 2026 Kostya Vechkanov
This server cannot be deployed
Maintenance
Related MCP Connectors
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
Search YouTube videos, read transcripts and get public video information in your AI assistant.
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
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
- AlicenseAqualityCmaintenanceEnables AI models to interact with YouTube content including video details, transcripts, channel information, playlists, and search functionality through the YouTube Data API.742 npm11MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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 gradedqualityCmaintenanceEnables AI assistants to search videos, channels, and playlists, retrieve video metadata, transcripts, and comments via the YouTube Data API v3.59 PyPI72MIT