AI + MCP

README AI / MCP

Use Tune API as a music intelligence layer inside AI agents, assistant products, and MCP-powered workflows. The easiest pattern is to expose a small set of task-oriented tools that call Tune API endpoints and return compact JSON back to the model.

Connect an HTTP-capable MCP

Expose Tune API through your MCP server or agent runtime so the model can call REST endpoints on demand.

Pass the API key as a bearer token

Send Authorization: Bearer YOUR_API_KEY on every request and keep the key server-side whenever possible.

Map tools to user intent

Use separate MCP tools for track search, artist lookup, album lookup, recommendations, and audio feature retrieval.

Suggested MCP tool surface

Keep tools narrow and explicit

Tool namePurpose
search_tracksSearch tracks with text, artist, album, and pagination filters.
get_trackFetch a single track by tune_id.
get_track_featuresRetrieve audio features like tempo, energy, danceability, valence, and key.
get_track_analysisReturn deeper structural analysis for bars, beats, sections, and timing.
list_artistsFind artists by name or genre.
get_artist_tracksPull tracks for a specific artist.
list_albumsSearch albums and filter by artist or album type.
get_recommendationsGenerate recommendation sets from artist IDs and genres.

Authentication

Recommended request shape

HTTP example
GET https://api.tune.dev/v1/tracks?q=afterimage&limit=5
Authorization: Bearer tune_live_sk_your_key
Accept: application/json

For MCP deployments, keep the API key in the MCP server or proxy layer. Let the model choose parameters, but do not expose secrets directly in the client prompt.

Best practices

How to keep agent calls reliable

Prefer structured tool calls over freeform scraping or web search when the user needs exact track, artist, album, or audio feature data.
Return compact result sets first, then let the model request follow-up lookups for features, analysis, lyrics, or related records.
Use tune_id values as the stable handoff between search tools and deeper enrichment tools.
Cap pagination for assistant workflows so responses stay fast and easy for the model to summarize.

Prompt ideas

Good tasks for MCP assistants

  • Find high-energy electronic tracks around 128 BPM for a workout playlist.
  • Given this artist, pull their top catalog context and recommend similar music.
  • Compare the audio features of these two tracks and summarize the differences.
  • Find albums released by this artist and return the ordered track list for the latest release.