sonic-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sonic-mcpplay a four-on-the-floor beat with a synth lead"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sonic-mcp
MCP server that connects Claude Code to Sonic Pi for AI-assisted beat making.
Requirements
Sonic Pi 3.x installed (tested on 3.2.2)
Ubuntu 24.04 with PipeWire audio (other Linux distros may work)
uv (recommended) or pip
Related MCP server: FL Studio MCP
Setup
1. Add to Claude Code
Add this to ~/.claude/mcp.json for global use, or a project's .mcp.json to keep it scoped:
{
"mcpServers": {
"sonic-pi": {
"command": "uvx",
"args": ["--from", "git+https://github.com/AJBogo9/sonic-mcp.git", "sonic-mcp"],
"env": {
"SONIC_PI_SONGS_DIR": "/home/yourname/songs",
"SONIC_PI_PATTERNS_DIR": "/home/yourname/patterns"
}
}
}
}SONIC_PI_SONGS_DIR defaults to ~/songs and SONIC_PI_PATTERNS_DIR defaults to ~/patterns.
2. Start Sonic Pi
Headless (recommended): no GUI required.
# Install the helper scripts once
cp scripts/sonicpi-headless scripts/sonicpi-stop scripts/sonicpi-status ~/.local/bin/
chmod +x ~/.local/bin/sonicpi-headless ~/.local/bin/sonicpi-stop ~/.local/bin/sonicpi-status
# Start / stop
sonicpi-headless
sonicpi-stop
sonicpi-statusQt GUI (alternative): use pw-jack sonic-pi on PipeWire systems. The desktop
shortcut fails to open the audio device on Ubuntu 24.04.
No listener buffer or manual setup is needed in either case. The MCP server connects directly to Sonic Pi's Spider server and auto-discovers the port from the boot log.
Tools
Playback
Tool | Description |
| Run Sonic Pi code |
| Run code in a specific buffer slot 0-9 |
| Stop all playing sounds (including GUI-run buffers) |
| Read the error log -- call after run_code to catch errors |
Mixer
Tool | Description |
| Master amplitude (1.0 = unity, 0.0 = silence, max 5.0) |
| Enable master high-pass filter at freq Hz |
| Disable master high-pass filter |
| Enable master low-pass filter at freq Hz |
| Disable master low-pass filter |
| Switch master output to stereo |
| Switch master output to mono |
OSC cues
Tool | Description |
| Send an OSC cue to trigger a |
Song and pattern library
Tool | Description |
| Save a full song (auto-increments version) |
| List all songs or versions of one song |
| Load a song's code (version 0 = latest) |
| Save a reusable snippet |
| List patterns, optionally filtered by category |
| Load a pattern's code |
Recording
Tool | Description |
| Start recording via PipeWire -- returns the output path |
| Stop recording and save to disk |
How it works
The MCP server sends OSC messages over UDP to two endpoints:
Spider server (port discovered from
~/.sonic-pi/log/server-output.log): handlesrun_code,stop_all,run_in_buffer, and all mixer controls. The Qt GUI uses a dynamically allocated port (around 51235); headless mode uses fixed port 4557.Erlang OSC cues port (fixed UDP 4560): handles
send_cue, which triggerssyncpoints in running Sonic Pi code.
get_log reads ~/.sonic-pi/log/server-errors.log, which captures runtime errors from
evaluated code. Calling it after run_code lets Claude catch and fix errors automatically.
Scripts
See scripts/ for the headless management scripts.
Script | Description |
| Start Sonic Pi without the Qt GUI (PipeWire/JACK audio) |
| Stop a headless instance |
| Show running status, port, and recent log |
Local development
git clone https://github.com/AJBogo9/sonic-mcp.git
cd sonic-mcp
pip install -e .License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AJBogo9/sonic-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server