# MCP server

> Add Songcode to an AI assistant. The server address, how signing in works, and every tool it offers.

The Songcode MCP server lets an assistant that speaks the [Model Context Protocol](https://modelcontextprotocol.io/) ask Songcode for songs inside a conversation, change them and publish them. Its address is:

```
https://studio.songco.de/mcp
```

Songcode writes every song itself, on its own servers, the same way as in the app. Your assistant describes what you want and Songcode composes it; the assistant can then read the code, make exact edits and publish it. It works on the same text you see in the [code view](https://docs.songco.de/app/code/).

## Add it to an assistant

Any Songcode account can connect. Who pays for the writing is under [who writes the songs](https://docs.songco.de/developers/mcp/#who-writes-the-songs).

Add a custom connector (some apps call it an integration or a remote MCP server) with the address above. The assistant opens a Songcode page in your browser: sign in, read what it is asking for, and press **allow**. That is the whole setup. There is no key to copy.

- **Claude**: Settings, Connectors, Add custom connector.
- **ChatGPT**: Settings, Apps and connectors, with developer mode on, then Create.
- **Claude Code**: `claude mcp add --transport http songcode https://studio.songco.de/mcp`, then `/mcp` to sign in.
- **Cursor, VS Code and others**: add a remote server with the address. Clients that take a header instead of signing in can send an [API key](https://docs.songco.de/developers/api/#authentication): `Authorization: Bearer sc_your_key`. Without a plan, they can also send your model key in the same headers as the REST API, `x-provider` and `x-provider-key`, instead of saving one on the settings page.

Remove the connection from the assistant, or from **mcp** on the [settings page](https://docs.songco.de/account/), and it stops working at once.

## What it can do

Ask in plain words. "Make a slow lo-fi loop with a muted trumpet", "turn the bass down 3 dB and take out the clap", "write me a full drum and bass song and publish it".

| tool | what it does | changes anything |
|---|---|---|
| `get_account` | who is signed in, the plan and its weekly usage, and whether Songcode can write for the account | no |
| `list_genres` | every genre a song can be asked for | no |
| `check_code` | checks code you already have and says what is wrong, line by line | no |
| `compose_song` | Songcode writes a new song from the request and saves it as a draft | yes |
| `add_stem` | Songcode writes one new part into a draft | yes |
| `rewrite_stem` | Songcode rewrites one part of a draft | yes |
| `get_composition` | a song or stem Songcode is still writing, once it is done | no |
| `list_songs` | your drafts and published tracks | no |
| `get_song` | a draft or track, with its code and check | no |
| `save_draft` | saves code you already have, pasted or from a `.ode` file, as a new private draft | yes |
| `update_draft` | replaces a draft's code or title | yes |
| `edit_draft` | exact changes: tempo, key, mix, rename, remove, replace or add a stem | yes |
| `publish_song` | makes a public link anyone can play | yes |
| `delete_draft` | deletes a draft | yes |
| `export_song` | the song as `.ode`, `.songcode` or MIDI | no |

Each tool says whether it only reads, whether it can replace or remove something, and whether it reaches beyond your account (only `publish_song`, which makes a public link), so an assistant can ask you before the ones that change things.

## Who writes the songs

**Songcode does, always.** The assistant never writes ode itself: `compose_song`, `add_stem` and `rewrite_stem` send the request to Songcode, which writes, checks and fixes the song on its side and saves the draft. Songcode's writing instructions never leave its servers, so every song follows the same craft as the app's, whatever assistant asks for it.

What the assistant picks is the same as in the app. On a plan it sets `quality`:

| `quality` | what you get |
|---|---|
| `fast` | the quickest song, and the least of the week |
| `balanced` | between the two |
| `extra` | the strongest ordinary song (the default) |
| `ultra` | ultra compose: a longer, more composed full song that takes several minutes |

On your own key it sets `model` (`haiku`, `sonnet` or `opus` on an Anthropic key, `luna`, `terra` or `sol` on an OpenAI key; default the largest) and `reasoning` (`low`, `medium`, `high`, `xhigh` or `max` on every model, and `none` on `luna` and `terra`). `get_account` tells the assistant which of the two applies.

A loop is back in under a minute. A full song can take a few minutes, ultra compose up to fifteen, and then the tool returns a job that `get_composition` reads once it is done.

**What it costs depends on the account.**

- **On a plan**, there is no key to add. Songcode writes on models tuned for ode and takes the plan's weekly usage, by how much it writes: a loop takes little, a full song more, ultra compose several times that, a stem very little, and `fast` far less than `extra`. Once the week is used up, buy extra usage on the [settings page](https://docs.songco.de/account/) and it carries on.
- **Without a plan**, Songcode writes with your own Anthropic or OpenAI key, as the app does when you bring a key, and your provider bills you for it. Save the key under **model key for the API and MCP** on the [settings page](https://docs.songco.de/account/): it is stored encrypted, never shown again, and opened only to write your songs. Clients that can set headers may send the key with each call instead (`x-provider: anthropic` or `openai`, `x-provider-key: …`); it is used for that call and never stored, and the tool waits for the whole song, so it suits loops and shorter songs best.

With neither a plan nor a key, the writing tools answer what to add, and everything else still works.

## Hearing it

In assistants that show app widgets (Claude and ChatGPT do), every tool that returns a song shows the songcode player under the answer: the title, tempo and key, a play button and a link to open the song in the app. It plays the song's code with the [Songcode Audio Engine](https://docs.songco.de/audio-engine/), right in the conversation, drafts included. 
Every song also comes back with a link, `https://studio.songco.de/d/…` for a draft or `/t/…` once published. Open it to see the stems, edit the code and download audio. The server returns code and MIDI, not sound files: audio is rendered by the Songcode Audio Engine in the browser.

The player is the resource `ui://songcode/player.html` (MCP Apps, `text/html;profile=mcp-app`). It loads the Songcode Audio Engine and its sounds from `https://studio.songco.de` and nothing else.

## Sign-in for apps

The server is an OAuth 2.1 protected resource. Clients find everything from a `401`:

| | |
|---|---|
| protected resource metadata | `https://studio.songco.de/.well-known/oauth-protected-resource/mcp` |
| authorization server metadata | `https://studio.songco.de/.well-known/oauth-authorization-server` |
| authorize | `https://studio.songco.de/oauth/authorize` |
| token | `https://studio.songco.de/oauth/token` |
| dynamic client registration | `https://studio.songco.de/oauth/register` |
| revoke | `https://studio.songco.de/oauth/revoke` |

PKCE with S256 is required. Clients can register dynamically (RFC 7591) or use a client ID metadata document (an HTTPS URL as the `client_id`). Every authorization response carries `iss`. Access tokens last an hour, refresh tokens 30 days, and a refresh token is replaced each time it is used. Tokens are bound to the resource they were asked for.

Three scopes, all asked for unless a client asks for fewer:

| scope | allows |
|---|---|
| `songs:read` | reading songs, the account, the guide |
| `songs:write` | saving, editing, publishing and deleting drafts |
| `compose` | having Songcode write songs and stems, on your plan or your own model key |

The same token works on the [REST API](https://docs.songco.de/developers/api/).

## Transport

Streamable HTTP, stateless: every request is a JSON-RPC message (or a batch of up to 20) in a `POST`, and every answer is JSON. There are no sessions and no server-sent stream. Protocol versions 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05. 120 calls a minute for each connection.

## Your data

Songcode logs each tool call with its name, the status, how long it took and which app made it. Prompts and code are kept the same way as in the app. The assistant you use has its own policy for what you say to it. See the [privacy policy](https://songco.de/privacy#connections).

---

This page on the web: https://docs.songco.de/developers/mcp/
Every page of the Songcode docs, for agents: https://docs.songco.de/llms.txt (index) and https://docs.songco.de/llms-full.txt (all of it in one file).
