Sonic Pi

by abhishekjairath

4 stars
552 downloads
Not rated
GitHub

About

Enables music creation and sound manipulation through Sonic Pi by sending OSC messages for playing notes with customizable synth parameters and executing arbitrary code.

Details

Author
abhishekjairath
Repository
abhishekjairath/sonic-pi-mcp
GitHub stars
4
Downloads
552
License
MIT License
Categories
Developer Tools, Other, Design, AI, Infrastructure, Frontend
Tags
#mobile

- 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.
- EnvOSC_HOST, OSC_PORT, OSC_CODE_PATH, OSC_STOP_ALL_PATH.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Sonic Pi
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 sonic-pi-mcp
    Environment
    • OSC_HOST 127.0.0.1
    • OSC_PORT 4560
    • OSC_CODE_PATH /run-code
    • OSC_STOP_ALL_PATH /stop-all-jobs

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install Bun and ensure Sonic Pi v4+ is running. Add the provided live_loop :code_runner code to a Sonic Pi buffer and execute it. Configure your MCP client (e.g., Cursor or Claude Desktop) with the command bunx sonic-pi-mcp and stdio transport. Then use the play_note and run_code tools to control Sonic Pi.

queue_segment

Send the next full musical segment (named `live_loop`s, `use_bpm`, etc.)

run_code

Same as `queue_segment` for compatibility.

stop_all

Hard stop via OSC (`/stop-all-jobs`), similar to Sonic Pi’s Stop.

play_note

Quick test note for sound output.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "sonic pi": {
            "env": {
                "OSC_HOST": "127.0.0.1",
                "OSC_PORT": "4560",
                "OSC_CODE_PATH": "/run-code",
                "OSC_STOP_ALL_PATH": "/stop-all-jobs"
            },
            "args": [
                "-y",
                "sonic-pi-mcp"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": {
        "OSC_HOST": "127.0.0.1",
        "OSC_PORT": "4560",
        "OSC_CODE_PATH": "/run-code",
        "OSC_STOP_ALL_PATH": "/stop-all-jobs"
    },
    "args": [
        "-y",
        "sonic-pi-mcp"
    ],
    "command": "npx"
}

Macos

{
    "env": {
        "OSC_HOST": "127.0.0.1",
        "OSC_PORT": "4560",
        "OSC_CODE_PATH": "/run-code",
        "OSC_STOP_ALL_PATH": "/stop-all-jobs"
    },
    "args": [
        "-y",
        "sonic-pi-mcp"
    ],
    "command": "npx"
}

Windows

{
    "env": {
        "OSC_HOST": "127.0.0.1",
        "OSC_PORT": "4560",
        "OSC_CODE_PATH": "/run-code",
        "OSC_STOP_ALL_PATH": "/stop-all-jobs"
    },
    "args": [
        "/c",
        "npx",
        "-y",
        "sonic-pi-mcp"
    ],
    "command": "cmd"
}

Model Context Protocol (MCP) server forSonic Pi. Describe music in natural language in your LLM client; the model generates Sonic Pi code and this server sends it overOSC. Use the includedqueue runnerin Sonic Pi for crossfades between segments.

- queue_segment— send the next full musical segment (namedlive_loops,use_bpm, etc.).
- run_code— same asqueue_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).
- Promptnext_performance_segment— help frame the next block for longer sets.
- EnvOSC_HOST,OSC_PORT,OSC_CODE_PATH,OSC_STOP_ALL_PATH.

- Sonic Piv4.x
-
Node.js18+ (npx/node)
- An MCP-capable client (Cursor, Claude Desktop, VS Code with MCP, etc.)

Optional:Bunfor local development (bun run dev).
- Open Sonic Pi.
- Copy
sonic-pi-queue.rbinto a buffer.
- PressRunand leave it running.

The buffer listens on the default OSC port and crossfades between segments sent by the MCP.

Point your client at this command overstdio(see below).

Use~/.cursor/mcp.jsonand/or.cursor/mcp.jsonin a project:

{ "mcpServers": { "sonic_pi_mcp": { "command": "npx", "args": ["-y", "sonic-pi-mcp"] } } }

Local clone(afternpm installorbun installandbun run build):

{ "mcpServers": { "sonic_pi_mcp": { "command": "node", "args": ["/absolute/path/to/sonic-pi-mcp/bin/cli.mjs"] } } }

Bun without building— some clients ignorecwd; use anabsolutepath tosrc/server.ts, or use the launcher:

{ "mcpServers": { "sonic_pi_mcp": { "command": "/absolute/path/to/sonic-pi-mcp/bin/mcp-dev.sh", "args": [] } } }

Runchmod +x bin/mcp-dev.shonce. The script changes into the repo and runsbun run src/server.ts.

~/Library/Application Support/Claude/claude_desktop_config.json(paths differ on Windows):

{ "mcpServers": { "sonic_pi_mcp": { "command": "npx", "args": ["-y", "sonic-pi-mcp"] } } }

For alocal clone, preferbin/mcp-dev.sh(see above) if you seeModule not found "src/server.ts"orspawn bunx ENOENT. Remove and re-add the MCP in the app if an old definition is cached.

Configure your MCP extension to runnpxwith-yandsonic-pi-mcp,stdiotransport, per the extension’s docs.

Allowincoming OSCin Sonic Pi if you connect from another machine; setOSC_HOSTaccordingly.

git clone https://github.com/abhishekjairath/sonic-pi-mcp.git cd sonic-pi-mcp bun install # or npm install bun run build bun run dev

OSC smoke test (Sonic Pi + runner running):

Usenodewith argumentbin/cli.mjsand this directory as the working directory (afterbun run build).

- No sound— Sonic Pi open? Queue buffer running? Port4560reachable?
- Nothing happens— OSC enabled in Sonic Pi;OSC_HOST/OSC_PORTmatch.
- Layers pile up— Usequeue_segmentwithnamedlive_loops; usestop_allonly for a full reset.
- Module not found "src/server.ts"(Claude)— Usebin/mcp-dev.shascommandwith emptyargs, or absolute paths; don’t rely oncwdalone.
- resources/list/prompts/list→ Method not found— You’re on an older build that only exposed tools. Reinstall/restart the MCP from this repo or npm so resources and prompts are registered.
- Ruby errors in Sonic Pi log— The generated code failed to parse or run; fix the snippet (brackets, samples, syntax) and send again. The queue runner prints a code snippet on failure.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Deterministic music-theory engine for AI agents to analyze, resolve, voice, and reharm chords.

An MCP server exposing @playbykey/theory as AI-callable, computed music theory tools, includes chords, scales, progressions, transpositions, and MIDI/frequency conversions.

An MCP server for the SuperCollider programming language that executes synths using supercolliderjs.

Control Ableton Live with AI prompts for music production, track creation, and session manipulation.

Analyzes audio files and extracts metadata, tailored for game audio development workflows.

AI-powered audio generation using the MiniMax Music API.

Pronunciation dictionary for developer jargon - IPA, respelling and audio for 1,650+ sourced entries (kubectl, nginx, JSON).

A server for quantum physics simulation and animation, using QuTip for computations and Manim for visualizations.

Official MCP server for Very Good FFmpeg

A server providing tools for weapon recoil generation and visualization via HTTP endpoints.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.