YouTube Personal Playlist noAPI MCP
Manage YouTube playlists from an MCP agent using pasted browser cookies, without an API key or OAuth app.
Store pasted cookies and verify YouTube login/playlist access.
Check cookie storage path and current authentication status.
Read the authenticated account's name/handle.
List account-visible playlists.
Read a page of a playlist, including up to 100 videos per page.
Create new playlists, optionally with up to 50 initial videos.
Rename editable playlists and set playlist descriptions.
Add up to 50 videos to a playlist.
Remove up to 50 videos from a playlist.
Delete editable playlists; this is destructive.
Allows managing your own YouTube playlists using browser cookies without requiring the Google API, including listing playlists, creating, renaming, setting descriptions, adding and removing videos, deleting playlists, and checking account/cookie authentication status.
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 Personal Playlist noAPI MCP list my YouTube playlists"
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 Personal Playlist noAPI MCP
Manage your own YouTube playlists from any MCP-capable agent using your existing YouTube browser cookies. No Google API key, Google Cloud project, or OAuth app is required.
This package is a local stdio MCP executable, not a backend service. The agent starts it when needed and it exits with the agent/client.
Run directly from GitHub
Prerequisite: Node.js 20 or newer. No clone, global install, or npm registry publish is required.
YOUTUBE_COOKIE_FILE="$HOME/.config/youtube-personal-playlist-noapi-mcp/cookies.txt" \
npx -y github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0This is a stdio MCP executable: use it as the command in an MCP client, rather than expecting a terminal UI. It can start with no credentials; paste cookies to a trusted agent and have it call youtube_cookie_set.
The command above is verified with npm 11.19.1. npm 12.2.0 disables Git dependencies by default; use the tested npm 12 command below instead.
YOUTUBE_COOKIE_FILE="$HOME/.config/youtube-personal-playlist-noapi-mcp/cookies.txt" \
npm exec --yes --allow-git=all github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0Related MCP server: youtube-playlist-mcp
Install in your agent
It works with any MCP client that can start a stdio command. It needs Node.js 20+. npm exec fetches the pinned release from GitHub, so no clone or registry install is needed. Pick your agent below.
Variable | Meaning | Example |
| Where cookies are stored (optional) |
|
YOUTUBE_COOKIE_FILE is optional and defaults to ~/.config/youtube-personal-playlist-noapi-mcp/cookies.txt. With no cookies yet, paste them to the agent and it calls youtube_cookie_set. The npm exec --allow-git=all form works with npm 11 and 12 (npm 12 disables Git dependencies by default).
The VS Code buttons ask for each value, keeping secrets out of files. The Cursor button writes placeholders: edit them in ~/.cursor/mcp.json afterwards. Elsewhere, replace the example values.
claude mcp add youtube-playlists -s user -e YOUTUBE_COOKIE_FILE=/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt -- npm exec --yes --allow-git=all 'github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0'Settings → Developer → Edit Config (claude_desktop_config.json):
{
"mcpServers": {
"youtube-playlists": {
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"
}
}
}
}Use the button above, or add this to .vscode/mcp.json (workspace) or to the user mcp.json (command
MCP: Open User Configuration):
{
"inputs": [
{
"type": "promptString",
"id": "youtube_cookie_file",
"description": "Where cookies are stored (optional)",
"password": false
}
],
"servers": {
"youtube-playlists": {
"type": "stdio",
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "${input:youtube_cookie_file}"
}
}
}
}Use the button above, or add this to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
{
"mcpServers": {
"youtube-playlists": {
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"
}
}
}
}Add this to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"youtube-playlists": {
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"
}
}
}
}codex mcp add youtube-playlists --env YOUTUBE_COOKIE_FILE=/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt -- npm exec --yes --allow-git=all 'github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0'Or add this to ~/.codex/config.toml:
[mcp_servers.youtube-playlists]
command = "npm"
args = ["exec", "--yes", "--allow-git=all", "github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"]
env = { YOUTUBE_COOKIE_FILE = "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt" }Add this to ~/.gemini/settings.json (or to .gemini/settings.json in a project):
{
"mcpServers": {
"youtube-playlists": {
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"
}
}
}
}Deep Agents CLI: add this to ~/.deepagents/.mcp.json (all projects) or to .mcp.json in a project. ${VAR} values are read from your shell or ~/.deepagents/.env, so secrets stay out of the file.
{
"mcpServers": {
"youtube-playlists": {
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "${YOUTUBE_COOKIE_FILE}"
}
}
}
}Python library (pip install deepagents langchain-mcp-adapters):
import asyncio
import os
from deepagents import create_deep_agent
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"youtube-playlists": {
"transport": "stdio",
"command": "npm",
"args": ["exec", "--yes", "--allow-git=all", "github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"],
"env": {
"YOUTUBE_COOKIE_FILE": os.environ["YOUTUBE_COOKIE_FILE"],
},
}
})
async def main():
tools = await client.get_tools()
agent = create_deep_agent(model="anthropic:claude-sonnet-5-5", tools=tools)
result = await agent.ainvoke({"messages": [{"role": "user", "content": "What can you do?"}]})
print(result["messages"][-1].content)
asyncio.run(main())Save this as agent.yaml, then run docker agent run agent.yaml:
agents:
root:
model: anthropic/claude-sonnet-5-5
description: Assistant with the youtube-playlists MCP tools
instruction: Use the youtube-playlists tools to answer the user's requests.
toolsets:
- type: mcp
command: npm
args:
- "exec"
- "--yes"
- "--allow-git=all"
- "github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
env:
YOUTUBE_COOKIE_FILE: "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"Add this to ~/.hermes/config.yaml, then run /reload-mcp in a chat:
mcp_servers:
youtube-playlists:
command: npm
args: ["exec", "--yes", "--allow-git=all", "github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"]
env:
YOUTUBE_COOKIE_FILE: "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"MCP Servers → Configure (cline_mcp_settings.json / mcp_settings.json):
{
"mcpServers": {
"youtube-playlists": {
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"
}
}
}
}Add this to settings.json:
{
"context_servers": {
"youtube-playlists": {
"command": "npm",
"args": [
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"env": {
"YOUTUBE_COOKIE_FILE": "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"
}
}
}
}Add this to opencode.json (project) or ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"youtube-playlists": {
"type": "local",
"command": [
"npm",
"exec",
"--yes",
"--allow-git=all",
"github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"
],
"environment": {
"YOUTUBE_COOKIE_FILE": "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"
},
"enabled": true
}
}
}Run goose configure → Add Extension → Command-line Extension, with the command npm exec --yes --allow-git=all 'github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0'. Or add this to
~/.config/goose/config.yaml:
extensions:
youtube-playlists:
type: stdio
enabled: true
cmd: npm
args: ["exec", "--yes", "--allow-git=all", "github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0"]
envs:
YOUTUBE_COOKIE_FILE: "/home/you/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"Most clients take the standard mcpServers JSON shown for Claude Desktop. Some use servers instead.
To install once instead of fetching on each start:
npm install -g github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0then use "command": "youtube-personal-playlist-noapi-mcp", "args": [].
From a checkout: "command": "node", "args": ["/abs/path/youtube-personal-playlist-noapi-mcp/src/server.mjs"].
Cookie location
Cookie storage is intentionally high-level and predictable.
Priority:
--cookie-file /path/to/cookies.txtYOUTUBE_COOKIE_FILE=/path/to/cookies.txt$XDG_CONFIG_HOME/youtube-personal-playlist-noapi-mcp/cookies.txt~/.config/youtube-personal-playlist-noapi-mcp/cookies.txt
The MCP stores normalized cookies with mode 0600 and never returns cookie values.
Example custom location:
YOUTUBE_COOKIE_FILE="$HOME/.config/my-youtube/cookies.txt" \
npx -y github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0or:
npx -y github:bigbatmanorg/youtube-personal-playlist-noapi-mcp#v1.2.0 \
--cookie-file "$HOME/.config/my-youtube/cookies.txt"Tools
Tool | Purpose | Annotation |
| Store pasted Netscape cookies.txt content or a raw Cookie header, then verify account + playlist access | write (local) |
| Show the cookie path and test current authentication | read-only |
| Account name and handle | read-only |
| All account playlists with visibility, video count and last update | read-only |
| One page of a playlist (Watch Later | read-only |
| Whole-playlist totals: duration, remaining time (also at 1.25×/1.5×/2×), watched / partially watched, unavailable, duplicates, top channels | read-only |
| List exactly which videos a clean-up would remove ( | read-only |
| Remove exactly the previewed videos; fails with | destructive |
| Create a playlist, optionally with initial videos | write |
| Rename a playlist | write |
| Set a playlist description | write |
| Add up to 50 videos | write |
| Remove up to 50 videos; fails without changes if any is not in the playlist | destructive |
| Delete a playlist | destructive |
Playlist arguments accept a playlist ID or any YouTube URL with list=. Video arguments accept IDs or watch, youtu.be and shorts URLs. Special playlists (Watch Later WL, Liked LL, mixes) are read-only: stats and clean-up previews work on them, but nothing is modified. YouTube omits some unavailable videos from playlist pages, so counts can be lower than the number shown on YouTube's playlist badge. Every tool declares MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) so clients can ask before destructive calls.
One-command full-cycle test from pasted cookies
This is the strongest test. It starts the MCP with no assumed session, reads pasted cookie text from stdin, calls youtube_cookie_set, stores the cookie at the configured path, verifies authentication, lists/reads playlists, creates a disposable playlist, renames it, sets a description, adds/removes a test video, verifies each state change, deletes the temporary playlist, and exercises the real MCP protocol end-to-end.
Interactive:
npm run test:full -- --cookie-file "$HOME/.config/youtube-personal-playlist-noapi-mcp/test-cookies.txt"Paste your full Netscape cookie export or raw Cookie: header, then press Ctrl-D.
Or pipe an export:
cat ~/Downloads/youtube-cookies.txt | \
npm run test:full -- --cookie-file "$HOME/.config/youtube-personal-playlist-noapi-mcp/test-cookies.txt"A successful run ends with:
RESULT: READYThe full test temporarily modifies the authenticated YouTube account by creating a test playlist. It deletes that playlist in cleanup even when an intermediate test fails.
Other tests
Offline unit suite (no cookies, no network):
npm testRead-only live verification:
npm run verifyLive write verification using the stored cookie:
npm run test:liveMCP protocol smoke test:
npm run test:mcpTest the actual npm tarball/install shape:
npm run test:packageDocker Agent example
See examples/docker-agent.yaml. The MCP can be consumed directly from GitHub through npx; there is no MCP source code to copy into every agent project.
Upgrade policy
youtubei.js is exactly pinned. Do not upgrade it blindly. The compatibility boundary is isolated in src/youtube/compat.mjs, so upstream request-shape changes should require a small targeted change rather than touching the MCP API.
Test a candidate in a disposable copy:
npm run test:upgrade -- latest --cookie-file "$HOME/.config/youtube-personal-playlist-noapi-mcp/cookies.txt"Pass a specific version such as 18.3.0 instead of latest to test that release. Without a cookie path it runs only the offline compatibility checks; with a cookie path it also runs read-only and live write verification.
Before publishing any release:
npm run release:checkThen run npm run verify, npm run test:live and npm run test:full with real cookies. Treat RESULT: READY from all three as the live release gate. The write tests only touch a temporary MCP_TEST_* / MCP_FULL_TEST_* playlist that they create and delete; verify is read-only. Point test:full at a scratch --cookie-file, because it stores the pasted cookies there.
Bump version in package.json, update the pinned #vX.Y.Z references and CHANGELOG.md, merge to main, then tag vX.Y.Z and publish a GitHub release.
Security note
YouTube browser cookies are account credentials. youtube_cookie_set exists specifically for users who deliberately want to paste those credentials through their MCP-capable agent. The server never echoes stored cookie values and sanitizes known cookie fields from returned errors. Use only with agents/frontends you trust.
This tool drives YouTube's internal web API with your browser session, which is not an officially supported integration. Google may change it at any time, and automated use can trigger security checks on the account. Use a reasonable request rate and prefer an account you are comfortable using this way.
Keeping cookies valid
Google rotates some session cookies while the browser that owns them stays open, which can invalidate an export within hours. For longer-lived cookies, sign in to YouTube in a private/incognito window, export the cookies from that window, then close it without signing out.
Troubleshooting
COOKIE_FILE_NOT_FOUNDmeans the configured cookie path does not exist yet. Start the MCP without credentials and useyoutube_cookie_set, or provide the correct absoluteYOUTUBE_COOKIE_FILEpath.NOT_LOGGED_INmeans the exported YouTube cookies have expired or do not authenticate the intended account. Export fresh cookies (see Keeping cookies valid) and set them again.VIDEO_NOT_FOUNDlists the requested video IDs that are not in the playlist; nothing is removed in that case.INVALID_IDmeans an argument is neither a valid YouTube ID nor a supported YouTube URL.PLAN_CHANGEDmeans the playlist (or the clean-up options) changed afteryoutube_clean_playlist_preview; preview again and apply the newplan_token.npm 12 reporting
EALLOWGITrequires the per-command--allow-git=allflag shown above. Do not disable npm security globally.
Available Tools
14 toolsyoutube_account_infoBRead-only
Get concise account identity for the authenticated YouTube session.
Inputs: no named parameters.
youtube_add_videosB
Add videos to an editable playlist.
Inputs: video_ids (required), playlist_id (required).
youtube_clean_playlist_applyADestructiveIdempotent
Remove exactly the videos from a matching youtube_clean_playlist_preview. Requires the same arguments and its plan_token; fails with PLAN_CHANGED and removes nothing if the playlist changed since the preview. Special playlists such as Watch Later cannot be modified.
Inputs: remove (required), plan_token (required), playlist_id (required), watched_threshold.
youtube_clean_playlist_previewARead-only
Preview a playlist clean-up without changing anything: lists exactly which videos would be removed and why, plus a plan_token for youtube_clean_playlist_apply. Show the list to the user before applying.
Inputs: remove (required), playlist_id (required), watched_threshold.
youtube_cookie_setBIdempotent
Store pasted YouTube cookies at the configured cookie path and verify login + playlist access.
Inputs: cookies (required).
youtube_cookie_statusARead-only
Show where cookies are stored and test whether the stored cookies currently authenticate.
Inputs: no named parameters.
youtube_create_playlistB
Create an editable playlist, optionally with initial videos.
Inputs: title (required), video_ids.
youtube_delete_playlistADestructiveIdempotent
Delete an editable playlist. This is destructive and cannot be undone.
Inputs: playlist_id (required).
youtube_get_playlistARead-only
Get one page of a playlist (Watch Later "WL" and Liked "LL" included). Each video has duration, channel, playable, view/age info, percent_watched and a link. page is 1-based and counts pages of limit videos; request next_page while has_more is true.
Inputs: playlist_id (required), page, limit.
youtube_list_playlistsBRead-only
List account-visible playlists as compact normalized data.
Inputs: no named parameters.
youtube_playlist_statsBRead-only
Summarize a whole playlist (Watch Later "WL" included): video count, total and remaining duration (also at 1.25x/1.5x/2x), watched and partially watched counts, unavailable and duplicate counts, and top channels.
Inputs: playlist_id (required), watched_threshold.
youtube_remove_videosADestructiveIdempotent
Remove videos from an editable playlist. Fails without changes if any requested video is not in the playlist.
Inputs: video_ids (required), playlist_id (required).
youtube_rename_playlistCIdempotent
Rename an editable playlist.
Inputs: name (required), playlist_id (required).
youtube_set_playlist_descriptionCIdempotent
Set an editable playlist description.
Inputs: description (required), playlist_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools target clearly distinct resources and actions (list/get/stats/create/delete/rename/add/remove). The only real overlap zone is youtube_remove_videos versus youtube_clean_playlist_preview/apply, but the descriptions clarify that one removes explicit IDs while the other is a token-guarded plan, and cookie_set vs cookie_status vs account_info are differentiated by their stated purpose.
All names share a consistent 'youtube_' prefix and snake_case, which makes the set predictable. Minor deviation: the playlist tools use verb-first (youtube_list_playlists, youtube_create_playlist) while cookie and clean-up tools use noun-first (youtube_cookie_set, youtube_clean_playlist_apply), so the pattern is slightly mixed but still highly readable.
Fourteen tools is well within a sensible range for a playlist-management server, and each tool earns its place: playlist lifecycle, read/inspect operations, a two-step clean-up flow, and cookie/auth handling. Nothing feels redundant or padding-like.
The surface covers full editable-playlist CRUD (create, delete, rename, describe, add, remove), read/inspection (list, get, stats), and a safe preview/apply clean-up flow, plus auth via cookies. Minor gaps remain: no reordering/moving of items within a playlist, no targeted search within a playlist, and no batch copy/transfer operation, though agents can work around these.
Maintenance
Related MCP Connectors
YouTube MCP — wraps the YouTube Data API v3 (BYO API key)
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
Hosted MCP for YouTube Studio: uploads, metadata, playlists, comments, analytics, captions.
Real-time YouTube transcripts, comments, channels & video search MCP. Local npx or hosted OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables YouTube playlist curation including inventory, deduplication, merging, and deletion via MCP tools.121MIT
- FlicenseNot gradedqualityDmaintenanceEnables analyzing and managing YouTube playlists, including Watch Later, using InnerTube authentication via browser cookies.-
- AlicenseAqualityDmaintenanceAn MCP server for organizing YouTube playlists via the YouTube Data API v3, enabling playlist and playlist item creation, listing, updating, and deletion through natural language.9MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI coding tools and MCP hosts to search YouTube Music and add or remove tracks on your own playlists through natural-language prompts, authenticated with your Google login. It runs locally over stdio, so credentials and OAuth tokens stay on your machine.-