Skip to main content
Glama
YouTube Music MCP

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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Spotify MCP server for ChatGPT, Claude and any AI agent: search songs and artists, list playlists, read playlist songs, create playlist, add songs to playlist, remove songs from playlist, set playlist public or private and save to Liked Songs in your own Spotify account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Spotify yourself; Cotlet does not store your password and you need no Spotify API key. About the official Spotify API: Spotify has a full Web API and, since 23 Apr 2026, an official connector for Claude (checked 5 Nov 2026). The API needs an app you register, and in development mode the app owner must have Premium and the app allows 5 users; unlimited users need a registered business with at least 250,000 monthly users. Setup and FAQ: https://cotlet.dev/integrations/spotify-api-mcp-server

      https://cotlet.dev/mcp/v1/spotify
    • DistroKid MCP server for ChatGPT, Claude and any AI agent: list releases, get release status, get earnings by store, list earnings rows, get daily stats, get splits, set splits and get HyperFollow stats in your own DistroKid account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to DistroKid yourself; Cotlet does not store your password and you need no DistroKid API key. About the official DistroKid API: DistroKid has no public API, no developer docs and no official MCP server (checked 28 Oct 2026). Everything runs in the web dashboard, and earnings leave it only as a CSV file you download from the Bank page. Setup and FAQ: https://cotlet.dev/integrations/distrokid-api-mcp-server

    • Vimeo MCP server for ChatGPT, Claude and any AI agent: search videos, edit video details, move videos to folder, upload captions, add videos to showcase and get video analytics in your own Vimeo account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Vimeo yourself; Cotlet does not store your password and you need no Vimeo API key. About the official Vimeo API: Vimeo has a full REST API with OAuth 2.0 and an official remote MCP server in public beta that covers only part of it (checked 17 Oct 2026). The MCP server needs a Pro plan or above. Setup and FAQ: https://cotlet.dev/integrations/vimeo-api-mcp-server

      https://cotlet.dev/mcp/v1/vimeo
    • Plex MCP server for ChatGPT, Claude and any AI agent: search libraries, list library items, add to Watchlist, mark item watched, add to playlist, list collections, grant library access and revoke library access in your own Plex account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Plex yourself; Cotlet does not store your password and you need no Plex API key. About the official Plex API: Plex has a documented HTTP API for Plex Media Server and no official MCP server (checked 5 Nov 2026). The API covers libraries, playlists, collections and playback history on one server and needs an X-Plex-Token. Setup and FAQ: https://cotlet.dev/integrations/plex-api-mcp-server

      https://cotlet.dev/mcp/v1/plex

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables users to search the YouTube Music catalog and manage playlists using natural language. It provides tools for searching songs, albums, and artists, as well as performing playlist operations like creating, adding, and deleting tracks.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables searching YouTube Music and managing playlists: create/delete playlists, add/remove/reorder tracks, and more via natural language.
      -
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to search YouTube Music, manage playlists, and retrieve listening history using the ytmusicapi library.
      6
      MIT