DJ Opus logo

Live-coded music for AI agents, MCP clients, and the browser

DJ Opus started as an open-source MCP server that connects AI coding agents to Strudel, a live-coding music environment running in your browser. You talk to your AI. It writes music code. You hear it. The original project is open source and works across multiple MCP clients today, while a ChatGPT-native mode is under active development as one more way to use it.

Try the hosted instance → or deploy your own for free — it's open source

Two tracks

Open source now

DJ Opus core project

The original DJ Opus repo is an MCP-first, browser-based live-coding music system for Claude Code, OpenCode, Codex, Cursor, and other MCP clients.

Under development

DJ Opus for ChatGPT

A dedicated ChatGPT Apps mode is in progress for people who want the REPL inline in ChatGPT. It is one client experience among several, built on top of the same open DJ Opus idea.

The goal is not to replace the open project. It is to keep DJ Opus portable across clients while making each mode feel native where it runs, whether that is a terminal agent, an IDE, or a conversation-first app.

What's MCP

MCP (Model Context Protocol) is an open standard that lets AI assistants connect to external tools. Build one MCP server and any compatible client can use it — Claude Code, Codex, Cursor, local models, whatever comes next.

DJ Opus is an MCP server that happens to speak music. The same pattern works for anything: databases, IoT devices, CI pipelines, home automation. The protocol is the interesting part. The client is interchangeable.


How it works

You AI Agent DJ Opus (MCP server) Strudel in your browser

Your agent sends commands through MCP to the DJ Opus server (a Cloudflare Worker). The server pushes them over WebSocket to a Strudel session in your browser. Patterns update live — you hear changes as the AI makes them.

What does the AI actually send?

The MCP server exposes tools the AI can call. It doesn't need to know Strudel syntax in advance — the tool descriptions tell it what's available and how to format patterns. The AI generates Strudel code based on those descriptions and your prompts.

Example

You say "give me a chill lo-fi beat" and the AI writes:

// Strudel pattern — drums, hats, bass

stack(
s("bd sd:2 bd bd sd:2").gain(0.9),
s("hh*8").gain("0.4 0.6 0.3 0.7"),
note("c3 eb3 g3 bb3")
.s("sawtooth").lpf(800).gain(0.3)
).slow(2)

You don't need to know Strudel syntax — the AI handles it. But if you're curious, Strudel's docs are great.


Use any agent

MCP is a standard protocol, so DJ Opus works with anything that supports it.

Terminal

Claude Code

Anthropic's CLI agent. Add the MCP server in your config and go.

Terminal

OpenCode

Open-source terminal agent. Same MCP config, any model provider.

Terminal / IDE

Codex CLI

OpenAI's open-source agent. Supports MCP servers out of the box.

IDE

Cursor / Windsurf

AI code editors with built-in MCP. Add the server in settings.

Anything else

Any MCP-compatible client

Claude Desktop, local models through Ollama, custom agents — if it speaks MCP, it works.

Example config (Claude Code)

Add this to your project's .mcp.json or ~/.claude/settings.json:

// .mcp.json
{
"mcpServers": {
"djopus": {
"url": "https://djopus.moore.nyc/sse"
}
}
}

Other agents follow the same pattern — point them at the MCP server URL. Check each agent's docs for where the config lives.

Get started

Open the player

Go to djopus.moore.nyc in your browser. This is where the music plays.

Connect your agent

Add the MCP server URL to your agent's config. See the example above.

Make some noise

Tell your AI to play something. "Start with a four-on-the-floor kick" or "build me a ambient pad" — plain English.


Features

Natural language

Describe what you want to hear. The AI writes the code.

Live updates

Patterns change in real time over WebSocket. No reloads.

Save & recall

Name and store patterns. Build a library across sessions.

Undo / redo

Full history stack. Rewind to any previous state.

No lock-in

Standard MCP. Switch agents or models whenever you want.

Free to run

Deploys on Cloudflare's free tier. Zero hosting costs.


Support & privacy

Questions about DJ Opus, the hosted player, or the in-progress ChatGPT app mode? Reach us at support@djopus.party.

For submission and user review purposes, we maintain a public privacy policy and a simple support page.

Under the hood

Why Cloudflare Workers

DJ Opus runs on Cloudflare Workers. It's a good fit for a few specific reasons:

  • Free tier covers real usage. 100k requests/day, no credit card required.
  • Native WebSocket support. Workers hold open connections, which is how patterns stream to your browser in real time.
  • Durable Objects for state. Each session gets its own persistent container — stores patterns, history, and undo stacks without an external database.
  • Edge deployment. Runs in 300+ locations. Low latency wherever you are.
  • One-command deploys. npx wrangler deploy — no containers, no build pipelines.

You can also run this locally with wrangler dev for development. Or host it anywhere that runs a WebSocket server — Cloudflare is just the easiest free option.

What's a Durable Object

A Durable Object is a single-instance JavaScript class with its own persistent storage. In DJ Opus, each session is one. It holds:

  • The current playing pattern
  • Undo/redo history
  • All saved/named patterns
  • Active WebSocket connections

When you reconnect, your state is still there. When there's no activity, it sleeps and costs nothing.

Self-hosting

Clone the repo, run npm install, and npx wrangler dev for local development. To deploy your own instance:

git clone https://github.com/jmoore2333/djopus
cd djopus
npm install
npx wrangler deploy

That's it. You'll get a .workers.dev URL, or add a custom domain in the Cloudflare dashboard.


View on GitHub

Open source · MIT · contributions welcome