Make your web DAW work with agents
A step-by-step guide for teams building a DAW in the browser: the project model, the operations to expose, the Connect agent button and how to get listed in DAWMCP.
This page is for teams building a DAW or music app that runs in the browser. Follow it and a musician's agent (Claude Code, Codex, Cursor or Claude Desktop) can read the project open in your app, create tracks and write MIDI, with one click from the musician. The agent uses the same operations it uses in REAPER, Ableton Live or Logic Pro, so whatever the musician already asks of their agent works in your app too.
You add three things to your app:
- A project model an agent can address: a session ID, stable object IDs and positions in beats.
- Handlers for DAWMCP's operations: plain functions that read your project and change it.
- A Connect agent button that runs
connectDawmcpfrom thedawmcp/bridgelibrary.
Desktop DAWs and the rules behind each requirement are covered in Integrate your DAW.
How the connection works
DAWMCP runs on the musician's computer, started by their agent. Your page can't be reached from there, so your page connects out to DAWMCP on 127.0.0.1. Nothing goes through your servers or ours.
- The musician chooses Connect agent in your app.
- Your page connects to DAWMCP with the
dawmcp/bridgelibrary, which knows where to find it. It tells DAWMCP your app's ID and version, and which operations your page answers. DAWMCP checks that the page's origin is one you declared. - The musician asks their agent something, such as "Write a bassline under the verse".
- The agent calls DAWMCP's operations, such as
read_daw_sessionandwrite_daw_midi. DAWMCP checks permissions and inputs, then sends the same calls to your page. - Your page answers with a snapshot or a receipt. DAWMCP checks it and returns it to the agent.
For the musician:
- Once your app is listed in DAWMCP, connecting is one click on Connect agent. The first time, the browser asks to allow your site to reach apps and devices on their local network. After that, the browser is remembered and reconnects after reloads, project changes and agent restarts.
- Until you're listed, the musician adds your declaration file once with
npx dawmcp provider add. The first time their browser connects, your app shows a short line, such as "Connect Your DAW with code 482913", with a button to copy it. They paste it into their agent chat, and the agent connects the tab.
DAWMCP is read-only until the musician allows more. They grant editing on their computer; your app never implements permissions for DAWMCP.
Step 1: Model your project for an agent
An agent works from what it reads, then edits by ID. Before writing any connection code, make sure your project model has:
| Requirement | What it means in practice |
|---|---|
| A session ID | One ID per project, stored with the project. It stays the same across renames, reloads and copies being edited, and two projects never share one. |
| Stable object IDs | Every track, clip and device keeps its ID when others are added, removed, reordered or renamed. An array index isn't an ID. |
| Positions in beats | Zero-based quarter-note beats from the start of the project, never seconds or pixels. Your app converts with its own tempo and meter maps. |
| One undo step per write | Each change the agent makes can be undone in one step, named after the request. |
| No side effects | A write never starts playback, opens a dialog, changes focus or depends on what the musician has selected. It acts on the IDs it was given. |
| The result, not "sent" | After a write, read your project again and return the new state, including the ID of anything you created. |
Step 2: Implement the operations
Each operation is a function in your app. The library calls it with input that DAWMCP has already checked, and checks what you return against DAWMCP's schema before sending it. Start with the first three; add the rest as your app supports them.
| Operation | Input | Returns | Musician grants |
|---|---|---|---|
read_daw_session | nothing | A snapshot | Reading (on by default) |
create_daw_track | sessionId, name, type (midi or audio) | A receipt with the new track's ID | Composition |
write_daw_midi | sessionId, trackId, name, startBeat, lengthBeats, notes | A receipt with the new clip's ID | Composition |
control_daw_transport | sessionId, action: play, stop, or tempo with bpm | A receipt | Transport |
import_daw_audio | sessionId, trackId, filePath, startBeat | A receipt | Media |
list_daw_plugins, list_daw_track_plugins | sessionId, optional paging | Devices or effects | Reading |
insert_daw_plugin, set_daw_plugin_parameter | sessionId, trackId, device and parameter IDs | The inserted device, or the value read back | Mixing |
read_daw_plugin_parameters | sessionId, trackId, device ID | Parameters with normalized and display values | Reading |
A note in write_daw_midi is {startBeat, durationBeats, pitch, velocity, channel}: startBeat counts from the clip start, pitch is MIDI 0–127, velocity is 1–127, and channel is 0–15 (default 0).
import_daw_audio gives a path on the musician's computer, which a browser page can't open. Leave it out unless your app has a way to receive local files.
The snapshot
read_daw_session returns the project as the agent should see it. The more of the musical frame you fill, the better the agent places things: "the second verse" only works if it can read your markers.
{
"sessionId": "proj_8f2c41",
"name": "Night drive",
"version": "Your DAW 3.2.0",
"bpm": 104,
"playing": false,
"tracks": [
{ "id": "trk_drums", "name": "Drums", "kind": "audio" },
{ "id": "trk_keys", "name": "Keys", "kind": "instrument", "instrument": "Electric Piano" }
],
"selectedTrack": { "id": "trk_keys", "name": "Keys" },
"capabilities": ["read", "createTrack", "writeMidi"],
"observedAt": "2026-11-27T14:02:11.000Z",
"frame": {
"meters": [{ "atBeat": 0, "bar": 1, "numerator": 4, "denominator": 4 }],
"tempos": [{ "atBeat": 0, "bpm": 104, "linear": false }],
"markers": [
{ "id": "mk_intro", "name": "Intro", "startBeat": 0, "bar": 1, "endBeat": 32 },
{ "id": "mk_verse", "name": "Verse", "startBeat": 32, "bar": 9, "endBeat": 96 }
],
"loop": { "startBeat": 32, "endBeat": 48 },
"timeSelection": null,
"playheadBeat": 36
}
}
kindisinstrument,midi,audio,folderorbus. With it, the agent never writes MIDI onto an audio track.frameis optional, field by field. Tell DAWMCP which parts you fill when you connect (Step 3).- The library adds the
dawfield. Don't set it yourself.
What we'd like DAWs to show lists what else helps an agent, in priority order.
The receipt
Every write returns a receipt: the outcome, an ID for this write, the snapshot after the change and the ID of what was created.
{
"status": "confirmed",
"requestId": "w_5d1e",
"createdId": "clip_31aa",
"snapshot": { "sessionId": "proj_8f2c41", "...": "the snapshot after the change" }
}
When a write fails, throw an error with a message the musician would understand ("Track trk_bass no longer exists"). The library reports it to the agent as a failed call. Don't return a receipt for a write that didn't happen.
Step 3: Add the Connect agent button
Install the dawmcp package and import the browser library from dawmcp/bridge. It bundles everything it needs, and its TypeScript types match DAWMCP's schemas, so your editor checks your handlers.
import { connectDawmcp, isRemembered, type DawmcpConnection } from "dawmcp/bridge"
let connection: DawmcpConnection | undefined
export async function connectAgent(project: Project) {
connection = await connectDawmcp({
provider: "your-daw", // the id in dawmcp-provider.json (Step 4)
sessionId: project.id,
app: { version: APP_VERSION, surface: "1.0.0" },
// What your handlers can't show: the guarantees from Step 1 and the frame you fill.
declaration: {
session: {
stableId: true,
revision: true,
writePreconditions: true,
idempotentRequests: true,
undoPerWrite: true,
},
frame: ["meters", "tempos", "markers", "loop", "timeSelection", "playhead"],
trackKinds: true,
},
waitForAgent: true,
onStatus: (status) => agentIndicator.show(status),
onCode: ({ prompt }) => agentIndicator.showCopyLine(prompt),
onClose: () => agentIndicator.show("disconnected"),
operations: {
read_daw_session: () => project.snapshot(),
create_daw_track: (input) => project.createTrack(input),
write_daw_midi: (input) => project.writeMidi(input),
},
})
}
Everything about the connection lives in the library: DAWMCP's address, the protocol and the browser's remembered key. You pass your app's ID and version, and your handlers:
operationshas one handler per operation you implement. The library tells DAWMCP which ones you have.declaration.sessionstates the guarantees from Step 1. DAWMCP holds back writes untilstableId,revisionandwritePreconditionsare all true, and tells the agent why. Leave out any you don't keep.declaration.frameandtrackKindssay which parts of the snapshot you fill.nativelists extra typed tools specific to your app, each with aname, adescription, the permissioncategoryit needs, a JSON Schema for its input and a handler.
// When the musician opens another project, connect again for it.
// A remembered browser needs no code.
project.onSwitch(async (next) => {
connection?.close()
await connectAgent(next)
})
// On load, reconnect only a browser that has connected before.
if (isRemembered("your-daw")) connectAgent(currentProject)
Show the connection state somewhere small and always visible, such as an icon in your toolbar:
onStatus | Show |
|---|---|
connecting | "Connecting to your agent…" |
waiting-for-agent | "Waiting for your agent. Start it, and allow local network access if your browser asks." |
code-needed | The line from onCode, with a Copy for your agent button. Only before you're listed. |
connected | "Agent connected", with Disconnect (connection.close()) |
If the connection closes with BRIDGE_CLOSE.replaced, another tab of your app took over; show "Connected in another tab". connectDawmcp rejects with a DawmcpConnectError whose reason is unreachable, refused or cancelled.
Two rules for the button:
- Connect only when the musician asks: on Connect agent, or on load once
isRememberedis true. Never on a first visit. The browser's local network prompt must follow their own action. - Answer within a few seconds. DAWMCP gives each call five seconds. A write that times out counts as uncertain, and the agent reads the project before trying again.
Chrome asks once per site for local network access. Test every browser you support.
Step 4: Declare your integration
Describe your app in a dawmcp-provider.json file and publish it with your documentation. It holds only what DAWMCP has to trust before your page connects: who you are and where your app runs.
{
"schema": "https://dawmcp.com/schemas/provider-v1.json",
"id": "your-daw",
"name": "Your DAW",
"kind": "web",
"homepage": "https://yourdaw.example",
"connection": {
"type": "browser-bridge",
"origins": ["https://app.yourdaw.example"]
},
"setup": ["Open a project and choose Connect agent in the toolbar."],
"contact": "https://yourdaw.example/support"
}
idis theprovideryou pass toconnectDawmcp.originsare the exact https origins your app runs on, with no path. DAWMCP refuses every other site.setupis optional: what the agent tells the musician to do in your app.
Your operations, guarantees and native tools aren't in this file. Your page reports them each time it connects, from the handlers you pass, and DAWMCP checks them by the same rules. A new version of your app needs no new declaration file.
Check it:
npx dawmcp provider check dawmcp-provider.json
The check confirms the file is valid. To see what DAWMCP does with your operations, connect a tab and ask the agent to list your app's capabilities: it reports which writes DAWMCP holds back and why.
Step 5: Try it end to end
- In any folder, set up DAWMCP for your agent:
npx dawmcp setup. - Add your declaration:
npx dawmcp provider add dawmcp-provider.json. - Start your agent, open your app and choose Connect agent. Allow local network access if the browser asks.
- Copy the line your app shows and paste it into the agent chat.
- Ask the agent: "What's in my session?", then "Create a Bass track and write a four-bar bassline under the verse."
- Check the result in your app, then undo it in one step.
- Reload the page and connect again: no code this time.
npx dawmcp doctor shows the connection, the connected site and the remembered browsers.
Step 6: Get listed
Once you're listed in DAWMCP, musicians skip the declaration file and the code: Connect agent is the whole setup. To be listed, your app:
- connects only after the musician chooses Connect agent, or has connected before
- passes
npx dawmcp provider checkwith your published declaration - passes our test drive on a real project: create a track, write MIDI, read it back, undo, reload, switch projects, and recover from a dropped connection mid-write
- serves only your own app on the origins it declares, never pages or scripts other people upload
Each listed app is marked experimental until a real session passes the test drive. To start, open an issue with your app, its origins and the operations you implement.
Agents in the cloud
The browser bridge serves agents running on the musician's computer. For Claude or ChatGPT on the web, run your own remote MCP connector instead, and implement the same operations on it. Online platforms explains when to choose which; many apps offer both.
Checklist
- A session ID per project, stable IDs for tracks and clips, positions in beats
-
read_daw_session, with as much of the musical frame as you can fill -
create_daw_trackandwrite_daw_midireturning receipts with the new IDs - One undo step per write, no playback, dialogs or selection dependence
- A Connect agent button and an always-visible connection indicator
- Connect only after the musician asks, or once
isRememberedis true - A
dawmcp-provider.jsonthat passesnpx dawmcp provider check - Tested end to end in every browser you support