Sandbox
@linxule/mcp-music-studio

MCP music studio for ABC notation and Strudel

This repo provides an MCP server that turns chat requests into two kinds of music work: scored composition with ABC notation and live performance with Strudel. The widget renders inline in supported MCP clients, and the server also exposes music guides, harmony analysis, conversion, and audio or MIDI export.

70 stars9 forksTypeScriptUpdated 9d ago
Who it's for

Builders who want their MCP client to compose, edit, and perform music in the same chat.

What it delivers

You can ask an agent to generate, play, revise, and export music without leaving the MCP client.

What it does

Scored composition mode

Takes ABC notation, renders sheet music, plays it with instruments, and supports transpose, swing, count-in, and style presets.

Live performance mode

Runs Strudel code in a live REPL with patterns, effects, visuals, and optional Hydra shaders.

Interactive widget UI

Shows the music app inline in supported MCP clients, with edit-in-place and live updates.

Harmony and docs tools

Adds chord analysis, ABC-to-Strudel conversion, and semantic search over ABCJS and Strudel docs.

Export and sharing

Can export MIDI or WAV and return click-to-play links for clients that cannot render the widget.

How to get it

  1. 1Paste this URL into any MCP client that supports remote servers
    https://mcp-music-studio.linxule.workers.dev/mcp
  2. 2Claude Code
    claude mcp add --transport http music-studio https://mcp-music-studio.linxule.workers.dev/mcp

README

MCP Music Studio

smithery badge

Two-mode creative music studio for AI: scored composition (ABC notation with sheet music) and live performance (Strudel live coding with TidalCycles). Interactive UI renders inline in Claude Desktop, claude.ai, and other MCP clients.

A Strudel pattern with its piano roll fed into a Hydra shader, then Stage mode taking the whole frame

One continuous live set through the widget — every section a hot-swapped re-evaluation on the same clock. Full video: 16:9 1080p60 · 3:4 for phones. Made with dev/perform.html and an OBS Browser Source (see scripts/showcase/).

Quick Start — No Install Required

Paste this URL into any MCP client that supports remote servers:

https://mcp-music-studio.linxule.workers.dev/mcp

Claude Desktop / claude.ai: Settings → Connectors → Add Connector → paste the URL above → done.

Claude Code:

claude mcp add --transport http music-studio https://mcp-music-studio.linxule.workers.dev/mcp

That's it — ask Claude to play a song or create a beat.


What You Get

Scored Composition (ABC Notation)

Write sheet music → see it rendered → hear it played with multi-instrument audio.

  • 8 style presets — rock, jazz, bossa, waltz, march, reggae, folk, classical — one parameter adds drums + bass + chord accompaniment
  • All 128 General MIDI instruments — named and fuzzy-matched ("sax" → Soprano Sax); the result text says what it actually resolved to when that isn't what you asked for
  • Visual sheet music — notes highlight as they play
  • Streaming render — sheet music appears as the AI types
  • Edit in place — open the ABC source pane in the widget, fix a bar, re-render without another tool call
  • Real transpositiontranspose rewrites the notation and the key signature, so the printed score matches what plays
  • Swing and count-inswing is the share of the beat given to its first half (50 = straight, 66 = triplet, 75 = max; ≤50 is no swing), drumIntro adds up to 8 bars of count-in from the style's drum kit
  • Selectable sound banks — FluidR3 (default), MusyngKite (fuller), or a lightweight dry bank, switched live from the toolbar
  • WAV download — export audio as WAV files directly from the UI
  • MIDI download — export a standard MIDI file straight from the score, no playback needed first. It is the score: abcjs applies swing during playback only, so the exported file has none
  • get-music-guide — 7 reference topics (instruments, drums, ABC syntax, arrangements, genres, styles, MIDI directives)

Live Performance (Strudel)

Write code → hear it play → edit in a live REPL.

  • TidalCycles mini-notation in JavaScript
  • 71 drum machine banks + 128 GM instruments + 128 VCSL orchestral/world/percussion samples + built-in synths
  • Full effects chain — filters, reverb, delay, FM synthesis
  • Editable REPL — users can tweak the code and hear changes instantly
  • Live visuals — add .pianoroll() / .punchcard() / .scope() / .spectrum() to animate behind the code (native strudel.cc overlay)
  • Hydra shader backgroundsawait initHydra() + Hydra code for fully custom, music-synced WebGL visuals. H(pattern) locks a shader parameter to the sequence, feedStrudel post-processes the piano roll
  • Audio-reactive shadersa.fft[0], a0(), a.setBins(6) and the rest of Hydra's audio API work verbatim, driven by Strudel's own output rather than the microphone (no permission prompt, no room noise)
  • visuals preset — one enum value (pianoroll, punchcard, scope, spectrum, hydra-kaleid, hydra-pulse, hydra-wash, hydra-feed) gives a bare pattern something to paint. Never overrides code that already visualises itself
  • theme — 39 CodeMirror colour schemes; the visuals stage and its readability scrim are derived from the active theme, so light themes stay readable
  • Stage mode — hide the code and let the visuals fill the frame (composes with the host's fullscreen)
  • Honest runtime feedback — evaluation errors, unknown sound names, and stops the user triggered are reported back to the model as they happen, so it never answers about a silent widget as if the music were still playing
  • Server-side validation — the local server evaluates every Strudel pattern headlessly before answering: the tool result reports layers, events per cycle, tempo, and which sound names are registered (or a syntax error with line:column), so terminal clients get real diagnostics too. (The hosted worker can't — Cloudflare forbids dynamic code generation — and says so.)
  • Record & download — capture live audio and export as WAV
  • get-strudel-guide — 8 reference topics (mini-notation, sounds, effects, patterns, genres, tips, visuals, advanced)

Shared

  • analyze-harmony — chord detection, key detection, progressions, chord scales; answers in both ABC chord symbols and Strudel chord()/note() form
  • convert-abc-to-strudel — take a scored melody into the live REPL: bars become mini-notation groups, durations become @ weights, chord symbols become a chord().voicing() line
  • search-music-docs — semantic search over strudel.cc and ABCJS documentation
  • Click-to-play links — in clients that can't render the inline widget (terminals, CLIs), both play tools return a hosted URL that actually plays. Short pieces travel in the link itself; longer ones are stored for 30 days

Local Install (Optional)

The remote URL above works without any local setup. If you prefer running locally (offline use, lower latency), install via npm:

CLI One-Liners

# Claude Code
claude mcp add music-studio -- npx -y mcp-music-studio --stdio

# Codex CLI
codex mcp add -- npx -y mcp-music-studio --stdio

# Gemini CLI
gemini mcp add -- npx -y mcp-music-studio --stdio

# OpenCode
opencode mcp add music-studio -- npx -y mcp-music-studio --stdio

JSON Config (Claude Desktop, Cursor, Windsurf, etc.)

Claude Desktop — edit config file
OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "music-studio": {
      "command": "npx",
      "args": ["-y", "mcp-music-studio", "--stdio"]
    }
  }
}
VS Code / Trae / PearAI

Add to .vscode/mcp.json — note: uses "servers" not "mcpServers":

{
  "servers": {
    "music-studio": {
      "command": "npx",
      "args": ["-y", "mcp-music-studio", "--stdio"]
    }
  }
}
Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "music-studio": {
      "command": "npx",
      "args": ["-y", "mcp-music-studio", "--stdio"]
    }
  }
}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "music-studio": {
      "command": "npx",
      "args": ["-y", "mcp-music-studio", "--stdio"]
    }
  }
}
Windows

On Windows, npx is a .cmd file and requires a shell wrapper:

{
  "mcpServers": {
    "music-studio": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "mcp-music-studio", "--stdio"]
    }
  }
}
Render modes (for non-ext-apps clients)

Clients that support ext-apps render the interactive UI inline automatically (auto mode). For clients that don't (Cherry Studio, CLI environments), use --render-mode:

ModeBehavior
auto (default)Inline UI for Claude Desktop, VS Code
browserSaves HTML and opens in system browser
htmlReturns HTML as embedded resource
{
  "mcpServers": {
    "music-studio": {
      "command": "npx",
      "args": ["-y", "mcp-music-studio", "--stdio", "--render-mode", "browser"]
    }
  }
}

Clients without a widget also get a click-to-play link in the tool result, served by the hosted worker — no local render mode needed.

HTTP mode (--host, --allow-origin)

Without --stdio the server listens over Streamable HTTP. That endpoint is unauthenticated, so it binds 127.0.0.1:3001 by default and only accepts browser requests from loopback origins.

FlagDefaultPurpose
--host ADDR127.0.0.1Bind address. A non-loopback value prints a warning and turns off the SDK's DNS-rebinding protection — put a proxy that authenticates in front of it
--allow-origin ORIGINloopback pages onlyExtra CORS origins (comma-separated, repeatable; * opts back into a wildcard)
PORT (env)3001Listen port

Tools

ToolDescriptionParameters
play-sheet-musicABC notation → visual sheet music + multi-instrument audioabcNotation, title?, instrument?, style?, tempo? (40–240), swing? (0–75), drumIntro? (0–8), transpose? (−12–12)
play-live-patternStrudel code → live-coded patterns with synthesis + effectscode, title?, bpm? (40–300), autoplay?, visuals?, theme?
get-music-guideABC reference (7 topics: instruments, drums, syntax, genres...)topic
get-strudel-guideStrudel reference (8 topics: sounds, effects, visuals, genres...)topic
search-music-docsSemantic search over strudel.cc and ABCJS docsquery, library (strudel | abcjs)
analyze-harmonyName a chord, guess the key, get a progression or chord scale — in ABC and Strudel spellingstask, notes?, chords?, key?, romanNumerals?
convert-abc-to-strudelTurn a scored ABC melody into a Strudel mini-notation patternabcNotation, voice?, sound?

visualsnone, pianoroll, punchcard, scope, spectrum, hydra-kaleid, hydra-pulse, hydra-wash, hydra-feed. theme — any of the 39 schemes the Strudel REPL ships (strudelTheme, nord, sonicPink, teletext, gruvboxDark, githubLight, …). stylerock, jazz, bossa, waltz, march, reggae, folk, classical.

Prompts

Slash-command / menu entry points, in clients that surface MCP prompts:

PromptWhat it does
compose-beatGenerate + play a Strudel pattern in a genre (args: genre, mood?)
harmonize-melodyAdd chords/accompaniment to an ABC melody and play it (args: melody, style?)
arrange-tuneTurn a melody/idea into a multi-voice arrangement (args: tune, instrumentation?)

Development

bun install
bun run dev      # watch + serve (hot reload)
bun run build    # production build (widgets must be built before the tests)
bun run test     # run tests

dev/ is a local ext-apps host harness for driving the widgets outside a real client — see dev/README.md.

Attribution

Forked from the Sheet Music Server example from MCP ext-apps by Anthropic, licensed under MIT.

Live coding is powered by Strudel — canonical repo at codeberg.org/uzu/strudel (the project moved off GitHub, so the GitHub mirror can be stale). Notation and playback use abcjs; shader backgrounds use hydra-synth.

License

MIT

Files in the repo

Repository payload23 top-level entries
  • .github
  • assets
  • dev
  • scripts
  • src
  • tests
  • worker
  • .gitignore
  • bun.lock
  • grid-cell.png
  • LICENSE
  • main.ts
  • mcp-app.html
  • package.json
  • README.md
  • screenshot.png
  • server.json
  • server.ts
  • strudel-app.html
  • tsconfig.json
  • tsconfig.server.json
  • vite.config.ts
  • vitest.config.ts

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k