Skip to main content
Glama
azzacalvin

YouTube Music MCP

by azzacalvin

YouTube Music MCP — Cloudflare Worker (free)

A purpose-built remote MCP server that runs on a genuinely free Cloudflare Worker (no card required) using Cloudflare's official OAuth-for-MCP pattern (@cloudflare/workers-oauth-provider + agents' McpAgent, both backed by a free-tier SQLite Durable Object + a free KV namespace).

It exposes 8 tools to Claude: search_youtube_music, list_playlists, get_playlist_items, create_playlist, edit_playlist, delete_playlist, add_song_to_playlist, remove_song_from_playlist.

This is a from-scratch, YouTube Data API v3-only implementation — it does not include the original repo's Spotify-based recommendations or Postgres- backed adaptive playlist history, since those need paid infrastructure.

Prerequisites

  • Node.js installed locally (or use npx without a global install)

  • A GitHub account (to hold this code)

  • Your Cloudflare account

Related MCP server: YouTube Music MCP Server

Setup

  1. Get the code into your own GitHub repo. Done — this repo is it.

  2. Install dependencies (from your machine, in the repo folder):

       npm install
          ```
             Then run `npm run type-check` before deploying.
    
                Also run `npx wrangler types` once — it regenerates the `Env` type from your actual `wrangler.jsonc` bindings/secrets, which is more reliable than the hand-written `src/env.d.ts` I included as a placeholder (safe to delete `src/env.d.ts` once you've done this).
    
                3. **Create the KV namespace:**
                   ```
                      npx wrangler kv namespace create OAUTH_KV
                         ```
                            This prints an `id`. Paste it into `wrangler.jsonc` in place of the placeholder.
    
                            4. **Set secrets** (these prompt you interactively — nothing typed into chat):
                               ```
                                  npx wrangler secret put GOOGLE_CLIENT_ID
                                     npx wrangler secret put GOOGLE_CLIENT_SECRET
                                        npx wrangler secret put COOKIE_ENCRYPTION_KEY
                                           ```
                                              For `COOKIE_ENCRYPTION_KEY`, generate a random value first, e.g. `openssl rand -hex 32`.
    
                                              5. **Google Cloud Console — OAuth client:**
                                                 - Application type: **Web application**
                                                    - Authorized redirect URI: `https://<your-worker-name>.<your-subdomain>.workers.dev/callback`
    
                                                    6. **Deploy:**
                                                       ```
                                                          npx wrangler deploy
                                                             ```
                                                                This gives you your live URL, e.g. `https://youtube-music-mcp.<your-subdomain>.workers.dev`.
    
                                                                7. Go back to Google Cloud Console and add the exact redirect URI from step 6 (`.../callback`) to the OAuth client's Authorized redirect URIs.
    
                                                                8. **Connect it to Claude:** the MCP endpoint is `https://<your-worker>.<your-subdomain>.workers.dev/mcp`.
    
                                                                ## Local development (optional)
                                                                ```
                                                                npx wrangler dev
                                                                ```
                                                                Runs at `http://localhost:8788`.
    
                                                                ## Why no Spotify / Postgres requirement
                                                                Those were hard requirements in the original repo purely due to how its
                                                                startup validation was written, not because they're needed for core
                                                                playlist management. This version only needs Google credentials.
F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/azzacalvin/youtube-music-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server