FreestyleDevelopers Open the app

Connect an AI assistant

The Freestyle MCP server lives at one URL. Add it to your assistant, sign in when Freestyle asks, and the assistant can open, edit, mix and export your projects.

https://freestyle.audio/api/mcp

MCP is for AI agents and assistants (ChatGPT, Claude, Claude Code and other MCP clients), where a model picks the tools. If you are writing an app or a DAW user interface yourself, use the Studio API v1 instead; it takes the same OAuth token.

Before you start. You need a Freestyle account with Pro access. In the app, Account → Connected apps shows this URL with copy buttons, the same recipes as below, and every client you have connected.

Claude Code and Claude Desktop

claude mcp add --transport http freestyle https://freestyle.audio/api/mcp

Then, inside a session, run /mcp, pick freestyle and choose Authenticate. Your browser opens the Freestyle consent page; Claude Code listens on a loopback port (http://localhost:<port>/callback) for the redirect, which the server accepts per RFC 8252. Tokens are stored by Claude Code and refreshed automatically.

Claude.ai

  1. Settings → Connectors → Add custom connector.
  2. Paste https://freestyle.audio/api/mcp as the server URL. Claude registers itself with the server (dynamic client registration) — no client id or secret to copy.
  3. Sign in to Freestyle and approve the requested access on the consent page.

Claude.ai's servers must be able to reach the MCP URL and the OAuth endpoints, so this works on a public Freestyle host.

ChatGPT

  1. Settings → Connectors → Advanced → Developer mode, then Create.
  2. Use https://freestyle.audio/api/mcp as the MCP server URL and choose OAuth authentication.
  3. Connect: ChatGPT registers a client, opens the Freestyle consent page and stores the token.

ChatGPT connectors can also use the legacy file tools (apply_audio_template, crossfade_audio_files, …) that take a ChatGPT file attachment; see the tools reference.

MCP Inspector and other clients

Any client that speaks MCP Streamable HTTP and OAuth 2.1 with dynamic client registration works the same way: point it at the URL, let it discover /.well-known/oauth-protected-resource from the first 401, register, authorize and call tools. Cursor-style custom-scheme:// redirect URIs are not accepted; use a loopback or https redirect.

If your client cannot do OAuth itself, obtain a token once with the flow on the Authentication page and send it as a bearer token. Talking to the server by hand looks like this:

curl -s https://freestyle.audio/api/mcp \
  -H "Authorization: Bearer fst_at_EXAMPLE…" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
  • Only POST carries messages. GET /api/mcp answers 405 (there is no server-initiated event stream) and DELETE answers 204 (there is no session to tear down).
  • initialize negotiates protocolVersion 2025-11-25 (or 2025-06-18) and returns serverInfo, capabilities (tools, resources, prompts — prompts/list is empty) and the server's instructions for the model.
  • Browser-origin requests are rejected unless the Origin header is on Freestyle's allow-list; server-side clients should simply omit it.

Your first session

The server's own instructions to the model say it best: start with whoami, then list_projects or create_project; read before you mutate; ask the user before anything destructive; and use listen_to_project to actually hear a result before calling it done. A complete loop:

1. Who is connected

{"jsonrpc":"2.0","id":1,"method":"tools/call",
 "params":{"name":"whoami","arguments":{}}}
{
  "id": "u_…", "username": "ada", "handle": "@ada", "displayName": "Ada",
  "proMode": true, "proRecordingDefaults": true,
  "plan": {"pro": true, "accessType": "manual", "proTrialExpiresAt": null, "quarantined": false},
  "organization": null, "projectCount": 3,
  "scopes": ["ai:use", "audio:listen", "daw:read", "daw:write", "exports:read", "media:upload",
             "profile:read", "projects:list", "projects:read", "projects:write"],
  "appUrl": "https://freestyle.audio", "libraryUrl": "https://freestyle.audio/"
}

Tool results come back as a JSON object inside a text content block and, identically, as structuredContent. The examples below show only that object.

2. Create a project with a backing track

Search the beat catalog (instant) or YouTube (imported in the background), then create the project from the result.

{"name":"search_beats","arguments":{"query":"dark trap","limit":5}}
{"name":"create_project",
 "arguments":{"title":"Night drive","source":{"type":"catalog","beatId":"beat_…"}}}
{
  "ok": true, "created": true,
  "project": {"id": "p_…", "title": "Night drive", "bpm": 140, "key": "F", "scale": "minor", "backing": {…}, …},
  "projectUrl": "https://freestyle.audio/p_…/studio",
  "studioUrl": "https://freestyle.audio/p_…/studio"
}

With source.type = "youtube" (or "url") the reply may carry an importJob and a nextStep telling you to poll get_import_status with the job_id and project_id until status is succeeded; the backing is attached automatically.

3. Add a lane and some audio

Track-scoped tools need a track_id. A brand-new project has no lanes, so create one; a vocal lane gets the account's default effects chain.

{"name":"create_track","arguments":{"project_id":"p_…","kind":"vocal","name":"Lead"}}
{"name":"add_audio_from_url",
 "arguments":{"project_id":"p_…","url":"https://cdn.example.com/take.wav","kind":"vocal","title":"Take 1"}}

4. Ask Mozart AI to mix

{"name":"mozart_ai_command",
 "arguments":{"project_id":"p_…","track_id":"t_…","command":"less reverb on the lead and tighten the low end"}}
{
  "ok": true, "projectId": "p_…", "trackId": "t_…",
  "reply": "Pulled the lead reverb down and added a gentle high-pass on the bass.",
  "needsClarification": false, "provider": "…",
  "steps": [{"action": "set_plugin_parameter", "summary": "…", "ok": true, "verified": true}],
  "executedActions": [...], "undoActionId": "a_…", "canUndo": true,
  "projectUrl": "https://freestyle.audio/p_…/studio/edit/t_…",
  "nextStep": "Call listen_to_project to hear the result, or undo_last_ai_action with the same project_id and track_id to revert it."
}

If needsClarification is true, answer the question with a new command. Destructive steps are refused until the user agrees; then repeat the command with confirm_destructive: true.

5. Listen before you say it sounds right

{"name":"listen_to_project",
 "arguments":{"project_id":"p_…","track_id":"t_…","length_sec":8,"question":"Is the vocal sitting in the mix?","include_audio":true}}
{
  "ok": true, "window": {…}, "summary": "…", "heard": "…", "reports": […], "mixOf": 3,
  "measured": {"audible": true, "peakDb": -1.1, "rmsDb": -15.4, "truePeakDbtp": -1.0, "integratedLufs": -12.8,
               "limiterGrDb": 3.2, "preMaster": {"peakDb": 2.1, "truePeakDbtp": 2.2, "rmsDb": -14.9, "overCeiling": true},
               "meter": "post-master: …"},
  "clip": {"id": "…", "seconds": 8, "mimeType": "audio/mpeg", "bytes": 131072,
           "playbackUrl": "https://freestyle.audio/api/mcp/listen/…/audio?token=…", "expiresInSec": 3600},
  "projectUrl": "…"
}

For the mix, measured meters what export_mix writes over the same window: every part at its track fader, pan and bus gain, the backing at its fader, muted or un-soloed tracks left out, then the master fader (masterGainDb appears when it is not at unity) and Mozart's export master limiter (-1 dBTP). peakDb and rmsDb are stereo dBFS after that limiter, and clipping appears only when the limited output is still within 0.3 dB of full scale. preMaster is the summed mix before the limiter. A pre-master peak over 0 dBFS is caught by the limiter, and limiterGrDb shows how hard it is working; it is not clipping in the export. The parts are rendered offline from the saved project, so bus inserts are not in the measurement. Per-track reports[] levels are pre-master stem levels.

The excerpt is at most 30 seconds. With include_audio: true and a clip of at most 1 MB the result also carries an MCP audio content block, so a model that can hear audio can judge it directly.

6. Export the mix

{"name":"export_mix","arguments":{"project_id":"p_…","idempotency_key":"night-drive-v1"}}
{"ok": true, "projectId": "p_…", "jobId": "j_…", "status": "queued",
 "nextStep": "Poll get_export_status with this job_id every few seconds until status is complete, then use downloadUrl (valid for one hour)."}
{"name":"get_export_status","arguments":{"project_id":"p_…","job_id":"j_…"}}

When status is complete the reply includes export.downloadUrl, a signed link valid for one hour. list_exports returns earlier renders with fresh links.

Generating audio with AI models

Ask Mozart AI to make something new (a song, beat, instrumental, jingle, loop…) and it is made in that one call; nothing is asked back. generator picks the model (list_music_models returns the catalog with live availability). Without it Mozart AI writes the music, unless the command itself names a model ("make a rock song with suno").

{"name":"mozart_ai_command",
 "arguments":{"project_id":"p_…","track_id":"t_…","command":"make a dark hip hop beat"}}
  • mozart — Mozart AI composes editable MIDI parts with the DAW's own instruments (the normal synchronous command).
  • elevenlabs_music, lyria (Google Lyria 3), stable_audio_25, ace_step, yue2 — the model renders audio, which lands on a new audio lane at bar 1 named after the model. This takes from under a minute to several minutes, so the call returns at once with a jobId:
{"name":"mozart_ai_command",
 "arguments":{"project_id":"p_…","track_id":"t_…","command":"make a dark hip hop beat","generator":"elevenlabs_music"}}
{"ok": true, "jobId": "…", "status": "running", "generator": "elevenlabs_music",
 "nextStep": "Generation is running. Poll get_mozart_ai_job with project_id and job_id every few seconds; …"}
{"name":"get_mozart_ai_job","arguments":{"project_id":"p_…","job_id":"…"}}

When status is done, reply describes what was made and laneId / clipId name the new lane. Plain "hip hop" or "rap" is produced as modern trap unless the command asks for boom bap. A model that is not available answers with an error instead of starting a job. Generations count against a per-user daily cap on top of the Mozart AI limits.

What the model is told

The initialize response includes server instructions. In short: all ids must come from these tools; get_project and get_pro_state are the reads to do before changing anything; delete_project and destructive execute_pro_action calls need confirmed_destructive: true only after the user agrees; mozart_ai_command and execute_pro_action are both undoable with undo_last_ai_action; search_youtube / search_beats plus create_project or import_youtube_backing add a backing track; add_audio_from_url adds vocals or audio from a public https link; export_mix renders the full mix.

Live-engine tools and headless sessions

Tools that touch the running engine (transport_control, get_pro_state, execute_pro_action, the plugin tools) need the project loaded in a Mozart session. A browser tab with the project open provides one; otherwise the server opens the session itself on first use and retries the call. A cold start takes a few seconds. If it fails, the tool answers "Couldn't open this project in the live engine" and you should ask the user to open the project in the Studio once.

Disconnecting

Account → Connected apps lists every grant with the client's name and kind, its organization (for partner apps) and its scopes. Disconnect revokes the grant and all of its tokens immediately; the client has to authorize again to continue. Invalidating the account's sessions (for example after a security event) also invalidates every grant on the account.

Freestyle developer documentation. Base URL https://freestyle.audio. Generated from the server's own registry and configuration.