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 name | Purpose |
|---|---|
| search_tracks | Search tracks with text, artist, album, and pagination filters. |
| get_track | Fetch a single track by tune_id. |
| get_track_features | Retrieve audio features like tempo, energy, danceability, valence, and key. |
| get_track_analysis | Return deeper structural analysis for bars, beats, sections, and timing. |
| list_artists | Find artists by name or genre. |
| get_artist_tracks | Pull tracks for a specific artist. |
| list_albums | Search albums and filter by artist or album type. |
| get_recommendations | Generate recommendation sets from artist IDs and genres. |
Authentication
Recommended request shape
GET https://api.tune.dev/v1/tracks?q=afterimage&limit=5
Authorization: Bearer tune_live_sk_your_key
Accept: application/jsonFor 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
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.