MCP API Access

What is MCP?
Model Context Protocol (MCP) lets AI agents — like Claude, ChatGPT, or custom bots — connect to your YouTube Music library. Once connected, an agent can list playlists, search for music, add or remove tracks, and create new playlists on your behalf.
Manual setup
  1. Generate an API token below — this is the key your AI agent will use to authenticate.
  2. Copy the endpoint URL and token, then add them to your AI agent's MCP configuration.
  3. The agent can now call any of the available tools listed below to manage your library.
One-click install for Claude Desktop
Download the extension file and double-click it (or drag into Claude Desktop) to install automatically. No config files needed.
Download Sortune.mcpb

After installing, Claude Desktop will ask for your API token. Generate one in the section below.

Connect AI to Sortune

Claude Code (CLI)

Run in terminal:

claude mcp add sortune \
  --transport http \
  /api/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"

Claude Desktop

In Settings → Developer → Edit Config (claude_desktop_config.json):

{
  "mcpServers": {
    "sortune": {
      "url": "/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}

After connecting

Just tell Claude:

"Organize my liked music into playlists by season, year and genre"
"Analyze my liked music and sort into playlists like winter-2026-ambient"

Claude will read the MCP server instructions, fetch your liked tracks, classify genres for each one, group by season + year + genre, create playlists and add tracks.

Get your token from the API Token section below.

Endpoint
/api/mcp
API Token
Available tools
list_playlistsGet a list of all your playlists with track counts
get_playlist_tracksGet all tracks in a playlist with artist, genre, and metadata
create_playlistCreate a new playlist with a title and privacy setting
add_tracks_to_playlistAdd one or more videos to a playlist
remove_tracks_from_playlistRemove tracks from a playlist by video ID
move_tracks_between_playlistsMove tracks from one playlist to another
search_youtube_musicSearch YouTube Music for videos matching a query
get_track_detailsGet detailed metadata for specific videos
delete_playlistDelete a playlist
save_track_genresSave AI-classified genres for tracks to the database
get_saved_genresRetrieve previously classified genres from the database
mark_tracks_sortedMark tracks as sorted into a season-year-genre playlist
0:00--:--