youtube-playlist-manager
v1.0.20MCP server for managing YouTube playlists with OAuth2 and a React GUI
An MCP (Model Context Protocol) server that lets Claude and other AI assistants manage your YouTube playlists. Includes a React GUI accessible via a browser. For a local unpublished copy, replace command and args with "command": "node", "args": ["/youtube-playlist-manager/dist/index.js"]. Variables come from the MCP env block or from ~/.config/youtube-playlist-manager/.env. When both are present, the .env file wins (it is loaded with override: true).
Summary extracted from the README.
youtube-playlist-manager
An MCP (Model Context Protocol) server that lets Claude and other AI assistants manage your YouTube playlists. Includes a React GUI accessible via a browser.
Features
- List, search, create, update and delete playlists
- Add and remove videos from playlists
- Get video details
- React-based GUI for visual management
- OAuth2 authentication with automatic token refresh
Prerequisites
- Node.js >= 18
- A Google Cloud project with the YouTube Data API v3 enabled
- OAuth 2.0 credentials (Client ID + Client Secret) of a Web application client (see Authorization)
Configuration
{
"mcpServers": {
"youtube-playlist-manager": {
"command": "npx",
"args": ["-y", "@imenam/youtube-playlist-manager"],
"env": {
"GOOGLE_CLIENT_ID": "123456789012-abc….apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "GOCSPX-…",
"PROXY_URL": "http://localhost:3000"
}
}
}
}
For a local unpublished copy, replace command and args with
"command": "node", "args": ["<path>/youtube-playlist-manager/dist/index.js"].
| Variable | Required | Description |
|---|---|---|
GOOGLE_CLIENT_ID |
yes | OAuth client ID (Google Cloud console) |
GOOGLE_CLIENT_SECRET |
yes | OAuth client secret |
PROXY_URL |
for the interface | URL of the proxy the interface registers with; without it the interface is disabled |
APP_PATH |
no | Path of the interface behind the proxy (default /youtube-playlist-manager, prefixed with APP_PATH_PREFIX when a hub sets it) |
APP_NAME |
no | Name of the interface in the proxy (default YouTube Playlist Manager) |
APP_GROUP |
no | Collapsible section of the proxy dashboard the interface is listed in |
Variables come from the MCP env block or from ~/.config/youtube-playlist-manager/.env. When both are present, the .env file wins (it is loaded with override: true).
Windows:
~refers toC:\Users\<YourName>\.config\youtube-playlist-manager\.env
Authorization
From the interface: Se connecter à YouTube. The OAuth client is a Web application client. Google's return address is derived from the address of the interface page:
| Interface served by | Address to declare once in the client's Authorized redirect URIs |
|---|---|
the self-register proxy, e.g. http://localhost:3000/youtube-playlist-manager/ |
http://localhost:3000/youtube-playlist-manager/oauth2callback |
an MCP Gateway Manager hub, under /_gui/… |
https://<hub>/_oauth-return — one address for every gateway of the hub, which sends the browser back to the interface named in state |
Available Tools
| Tool | Description |
|---|---|
list_playlists |
List all your YouTube playlists |
search_playlists |
Search playlists by title |
get_playlist_items |
Get videos inside a playlist |
get_video_details |
Get details of a specific video |
add_video_to_playlist |
Add a video to a playlist |
remove_video_from_playlist |
Remove a video from a playlist |
create_playlist |
Create a new playlist |
update_playlist |
Update title, description or privacy |
delete_playlist |
Permanently delete a playlist |
Config directory
All user data is stored in ~/.config/youtube-playlist-manager/:
| File | Purpose |
|---|---|
.env |
Your Google OAuth credentials |
tokens.json |
OAuth tokens (auto-managed) |
Moving to MCP Gateway Manager
Run this in the folder of the project whose .mcp.json declares the server:
npx -y @imenam/youtube-playlist-manager@latest --migrate-to-manager --name youtube-playlist-manager
It writes youtube-playlist-manager.mcp-import.zip in the current folder, to import from the gateway's MCP tab (« Importer un MCP »). --name picks the .mcp.json entry; it is required when the server is declared more than once, and the command fails listing the entries otherwise. An entry that still launches the former unscoped youtube-playlist-manager package is found, and exported with @imenam/youtube-playlist-manager.
- Carried over: the environment variables of the entry —
GOOGLE_CLIENT_SECRETis marked secret. The server has no storage folder: only its configuration is exported. - Left out: the config directory
~/.config/youtube-playlist-manager/(tokens.json,.env), which stays where it is; on a hub running under another user or on another machine, connect the YouTube account again from the interface.GUI_PORTandOAUTH_CALLBACK_BASE_URLare no longer read and are dropped. - Set by the hub:
PROXY_URL,APP_GROUP,APP_NAME,APP_PATH,APP_PORT,MCP_LOG_DIR(and the formerPROXY_APP_NAME/PROXY_APP_PATH).
The archive holds the secrets in clear text, readable by you only: delete it once imported.
Network exposure
The GUI server listens on 127.0.0.1 only. Other machines reach the GUI through the proxy or the gateway manager, which relay to localhost.
Every GUI request goes through the request guard of @imenam/mcp-gui-interface: it refuses (HTTP 403) a Host header other than localhost / 127.0.0.1 / ::1, and any modifying request (other than GET, HEAD, OPTIONS) that the browser marks as coming from another site (Sec-Fetch-Site, or Origin outside this machine and the proxy).
Development
git clone https://github.com/your-username/youtube-playlist-manager
cd youtube-playlist-manager
npm install
npm run install:gui
npm run build
Publishing
Every push to master, pull request merges included, publishes a new version of @imenam/youtube-playlist-manager to npm (.github/workflows/publish.yml): npm ci (root and gui), npm run build, then npm version patch, whose commit and tag are pushed to master, and npm publish. Publishing goes through npm trusted publishing (OIDC, no token), with provenance attestation.
On npmjs.com, the package declares this workflow as its trusted publisher (Settings → Trusted publishing → GitHub Actions: Matthieu-Pesnot-Pin, youtube-playlist-manager, publish.yml, with npm publish among the allowed actions). The version commit is pushed with GITHUB_TOKEN: if master is protected, the rule must allow GitHub Actions to push to it.
License
ISC