# For agents

> For an AI agent working on music with its person. What ode is, why it suits an agent, what to read in one fetch, and how to work with Songcode over MCP and the API.

Songcode makes music as code. A song is a short text file in ode, Songcode's language for a song, and the Songcode Audio Engine turns that text into a session of stems and into sound. If you are an agent, this page is written for you: what to read, what you can do, and why ode is a good way for you and your person to work on music.

## Read this first

1. **The whole language in one fetch:** [ode reference](https://docs.songco.de/ode/reference/), as Markdown at `https://docs.songco.de/ode/reference/index.md`. How it is written, every statement, row, setting and sound name, and two complete tracks.
2. **Everything else:** `https://docs.songco.de/llms.txt` lists every docs page as Markdown, and `https://docs.songco.de/llms-full.txt` is all of them in one file. Every page here also has its Markdown at its own address plus `index.md`.
3. **To work on songs:** the MCP server at `https://studio.songco.de/mcp`, or the REST API at `https://studio.songco.de/api/v1`. See [connect](https://docs.songco.de/agents/#connect).

None of the docs need an account.

## Why ode suits an agent

**It is text, and it is small.** A loop is about a hundred lines and a two minute track is a few kilobytes, so a whole song fits in your context with room to spare. You read it, quote it, diff it and keep it in git like any other source file. Nothing about the music is hidden in a binary: every note and every filter setting is on the page.

**It says what it means, and it tells you when it does not.** ode has one grammar and no exceptions. A track declares music and runs nothing: there are no loops, conditions or functions, so opening someone else's track is safe. Anything ode does not know is an error, and every error names its line. Every count is checked: steps in a bar, note lengths in a bar, bars in a section. You never have to guess whether a change was understood.

**It is written in a musician's terms.** A track has a `key`, a `form` with named sections and a `chords` chart written as on a lead sheet. A bass written `tones [root]` plays each chord's root, so changing one chord changes every part that follows the chart. `degrees [1 3 5]` are steps of the scale. A melody is `c5/4 eb5/8 f5`. You reason about the music the way a person describes it: "darker in the verse", "a fill before the drop", "the chorus a step higher".

**Every part is a stem.** A stem is one instrument with its own name, its own rows and its own row in the mix table. That one stem can be read, explained, muted, rewritten or regenerated without touching the rest of the song, and it is a separate file in a stems export. "Make the bass busier" is a change to one named block.

**Changes are local and exact.** Where a stem plays is one `arrange` table. How loud it is and where it sits is one `mix` table. A section change is an `in chorus { }` block. A fill is a `last 1bar into drop { }` block. Each fact is written once, so an edit lands in one place and nothing drifts.

**The same text gives the same song.** Randomness in ode (`chance`, `humanize`, `loose`) draws from the track's `seed`, so the same track plays the same way every time and an export matches what was heard. What you change is the only thing that changes.

**The code and the music go both ways.** The Songcode Studio shows a track as code or as stems, and they are the same track. Dragging a fader rewrites the level in the mix table, and typing a level moves the fader. Your person can work in the stems view while you work in the text, and neither loses the other's changes.

**It is versioned.** A track starts with `ode`, and can name the version it needs, as in `ode 0.3.0`. ode is on 0.3.0 and the Songcode Audio Engine on 0.1.1. The engine a platform runs can be older than the Studio's, and every check says which engine read the song. See [versions](https://docs.songco.de/ode/versions/).

**What it makes is your person's.** Every track made or edited with Songcode belongs to the person who made it, with full commercial rights, on any plan and with their own key. See the [terms](https://songco.de/terms). Songcode has no audio model and trained nothing on anyone's music: a general-purpose language model writes ode, and the Songcode Audio Engine plays it.

## What you can do today

Over MCP or the API, with your person's account:

| to | use |
|---|---|
| have Songcode write a new song | `compose_song`, with a genre from `list_genres` |
| add or rewrite one stem | `add_stem`, `rewrite_stem` |
| read a song's code and its check | `get_song`, `list_songs` |
| make exact changes: tempo, key, mix, rename, remove, replace or add a stem | `edit_draft` |
| check code and get every error by line, saving nothing | `check_code` |
| save code your person already has, from a paste or a `.ode` file | `save_draft`, `update_draft` |
| make a public link that plays anywhere | `publish_song` |
| get the song as `.ode`, `.songcode` or MIDI | `export_song` |

[The MCP page](https://docs.songco.de/developers/mcp/) lists every tool and its arguments, and [the API page](https://docs.songco.de/developers/api/) the same for REST.

## Who writes the songs

Songcode writes every new song and every new stem itself, on its own servers. You describe what your person wants, in their words, and Songcode composes it, checks it and fixes it before it comes back. What you do with ode is everything around that: read a track and explain it, answer questions about it, make the exact edits your person asks for, check the result and publish it.

On a Songcode plan, Songcode writes from the plan's weekly usage at the composition quality your person picks: fast, balanced, extra or ultra compose. Without a plan, Songcode writes with your person's own Anthropic or OpenAI key, which their provider bills; Songcode charges nothing for that. `get_account` says which applies.

## Hearing it

Audio is rendered by the Songcode Audio Engine in the browser, not on a server, so no tool returns a sound file. Every song comes back with a link that plays it in the Songcode Studio, and in apps that show MCP widgets a player appears in the conversation. The Studio exports WAV, MP3, every stem and MIDI from there. See [export](https://docs.songco.de/app/export/).

## Connect

- **MCP:** add `https://studio.songco.de/mcp` as a remote MCP server. Your person signs in on a Songcode page and allows it; there is no key to copy. Clients that send a header instead can use an API key as `Authorization: Bearer sc_…`. Setup for each app is on [the MCP page](https://docs.songco.de/developers/mcp/#add-it-to-an-assistant).
- **REST:** `https://studio.songco.de/api/v1`, with an API key from the settings page. See [the API page](https://docs.songco.de/developers/api/).

The app, the API and the MCP server need a Songcode account. Songcode is in [early access](https://docs.songco.de/account/early-access/): people get in by invite, and anyone can ask for one at [songco.de](https://songco.de/). The docs, published tracks and these pages are open to everyone.

## Files

| file | holds |
|---|---|
| `.ode` | The song's code, the text on these pages. |
| `.songcode` | The project: the code with its title, the prompt, the settings it was written with, the seed and which view it was in. A JSON file. |
| WAV, MP3, stems, MIDI | Outputs, rendered from the code. |

---

This page on the web: https://docs.songco.de/agents/
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).
