Sonic Pi MCP Server

MCP server for Sonic Pi: natural-language DJ sessions, OSC, queue runner, tools and prompts

Local serverstdio

What is the Sonic Pi MCP MCP server?

MCP server for Sonic Pi: natural-language DJ sessions, OSC, queue runner, tools and prompts. That is what the sonic pi mcp mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

Model Context Protocol (MCP) server for Sonic Pi. Describe music in natural language in your LLM client; the model generates Sonic Pi code and this server sends it over OSC. Use the included queue runner in Sonic Pi for crossfades between segments.

  • queue_segment — — send the next full musical segment (named live_loops, use_bpm, etc.)
  • run_code — — same as queue_segment (compatibility)
  • stop_all — — hard stop via OSC (/stop-all-jobs), like Sonic Pi’s Stop
  • play_note — — quick test note
  • Resource — — DJ session craft, vocabulary, and tool usage (read from the MCP client)
  • Prompt — next_performance_segment — help frame the next block for longer sets

The tools it exposes

The server publishes 8 tools. What each one is for:

  • Resource — DJ session craft, vocabulary, and tool usage (read from the MCP client)
  • Env — OSC_HOST, OSC_PORT, OSC_CODE_PATH, OSC_STOP_ALL_PATH
  • Variable — Default
  • OSC_HOST — 127.0.0.1
  • OSC_PORT — 4560
  • OSC_CODE_PATH — /run-code
  • OSC_STOP_ALL_PATH — /stop-all-jobs
  • Cursor — Run chmod +x bin/mcp-dev.sh once. The script changes into the repo and runs bun run src/server.ts

What it needs from you

Configuration is passed through the environment: OSC_CODE_PATH, OSC_STOP_ALL_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

  • Sonic Pi v4.x - Node.js 18+ (npx / node) - An MCP-capable client (Cursor, Claude Desktop, VS Code with MCP, etc.) Optional: Bun for local development (bun run dev).

Getting it running

The server ships on npm as sonic-pi-mcp, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

How it compares

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Sonic Pi MCP's toolset — Resource, Env, Variable and 5 more — is a fair guide to whether it matches your workflow. It is maintained by abhishekjairath; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Sonic Pi MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
ResourceDJ session craft, vocabulary, and tool usage (read from the MCP client).
EnvOSC_HOST, OSC_PORT, OSC_CODE_PATH, OSC_STOP_ALL_PATH.
VariableDefault
OSC_HOST127.0.0.1
OSC_PORT4560
OSC_CODE_PATH/run-code
OSC_STOP_ALL_PATH/stop-all-jobs
CursorRun chmod +x bin/mcp-dev.sh once. The script changes into the repo and runs bun run src/server.ts.

How to install the Sonic Pi MCP MCP server

{
  "mcpServers": {
    "sonic-pi": {
      "command": "npx",
      "args": ["-y", "sonic-pi-mcp"],
      "env": {
        "OSC_CODE_PATH": "your-value",
        "OSC_STOP_ALL_PATH": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Sonic Pi v4.x - Node.js 18+ (npx / node) - An MCP-capable client (Cursor, Claude Desktop, VS Code with MCP, etc.) Optional: Bun for local development (bun run dev).
VariableDescriptionRequired
OSC_CODE_PATHFilesystem location the server is allowed to use.Optional
OSC_STOP_ALL_PATHFilesystem location the server is allowed to use.Optional

Example prompts to try

  • Use Sonic Pi MCP to Resource.
  • Use Sonic Pi MCP to Env.
  • Use Sonic Pi MCP to Variable.

Frequently asked questions

It connects Sonic Pi MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 8 tools (Resource, Env, Variable, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Sonic Pi MCP directly.