maxmsp-mcp — State-of-the-Art MCP Server for Max/MSP
Control Max/MSP patches from natural language. 75 tools, zero externals, Python-based. Build, analyze, modify, and debug Max patches through an LLM agent.
pip install uv
git clone https://github.com/pawelknorps/maxmsp-mcp
cd maxmsp-mcp
uv venv && source .venv/bin/activate
uv pip install -e .
Then open max/mcp_host.maxpat in Max and connect your MCP client.
Why This Server?
| Feature |
maxmsp-mcp |
tiianhk/MaxMSP-MCP-Server |
ersatzben/maxmsp-mcp |
signalcompose/MaxMCP |
| Tools |
75 |
~25 |
30 |
~30 |
| Architecture |
Python + OSC |
Python + Max JS |
Python + Max JS |
C++ external |
| Externals |
None (stock Max) |
Node.js |
Node.js |
Build from source |
| Undo/Redo |
✅ Batch undo |
❌ |
❌ |
❌ |
| Templates |
6 built-in |
❌ |
❌ |
❌ |
| MCP Prompts |
4 workflow prompts |
❌ |
❌ |
❌ |
| Safety Analysis |
✅ Full |
❌ |
Partial |
❌ |
| Subpatcher Targeting |
✅ |
❌ |
Partial |
❌ |
| Multi-patcher |
✅ List, navigate, encapsulate |
❌ |
Partial |
❌ |
| Console Feedback |
✅ Clear, log, error count |
❌ |
✅ |
❌ |
| Live Bridge |
✅ Tempo, track, send |
❌ |
❌ |
❌ |
| Chunked Dump |
✅ Patches of any size |
❌ |
❌ |
❌ |
| Self-healing |
✅ Auto-retry connections |
❌ |
❌ |
❌ |
| Test Suite |
❌ |
❌ |
❌ |
❌ |
| Setup |
uv pip install |
npm + Python |
npm + Python |
cmake + brew |
Quick Start
1. Install
# Requires Python 3.11+ and uv
uv venv
source .venv/bin/activate
uv pip install -e .
2. Open the host patch in Max
Open max/mcp_host.maxpat in Max 9+ (or Max 8+). Turn on DSP.
3. Connect your MCP client
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"maxmsp": {
"command": "uv",
"args": ["--directory", "/path/to/maxmsp-mcp", "run", "python", "-m", "maxmsp_mcp.server"],
"env": {
"MAX_HOST": "127.0.0.1",
"MAX_PORT": "7400",
"MAX_RETURN_PORT": "7401"
}
}
}
}
4. Start patching
The LLM will call max_init() first to get the orientation guide, then you can:
"Create a 440Hz sine wave oscillator connected to dac~"
"Add a delay effect with 300ms and 0.4 feedback"
"Analyze this patch for safety issues"
"Encapsulate the filter section into a subpatcher"
"What's the current tempo in Live?"
Tools Reference (75 tools + 4 prompts)
Core (19) — max_init, max_build_patch etc.
| Tool |
Description |
max_init() |
Initialize connection to Max. Call this first. |
max_create_object(cls, args, x, y) |
Create any Max object |
max_create_message(text, x, y) |
Create a [message] box |
max_create_comment(text, x, y) |
Create a [comment] label |
max_create_toggle(x, y) |
Create a [toggle] |
max_create_bang(x, y) |
Create a [button] |
max_create_number(initial, x, y) |
Create a [number] |
max_create_slider(initial, x, y) |
Create a [slider] |
max_connect(from_name, outlet, to_name, inlet) |
Connect two objects |
max_disconnect(from_name, outlet, to_name, inlet) |
Disconnect objects |
max_delete(name) |
Delete an object |
max_set_dsp(on) |
Turn DSP on/off |
max_send(name, value) |
Send a value to a named receive |
max_clear_canvas() |
Delete all created objects |
max_get_state() |
Show server's object registry |
max_dump_patch() |
Read back everything in the patch |
max_verify() |
Compare server state vs actual patch |
max_build_patch(objects, connections) |
Create multiple objects + connections at once |
max_doc(classname) |
Get Max documentation for an object |
Undo (6)
| Tool |
Description |
max_undo() |
Undo last operation (batch-aware) |
max_redo() |
Redo last undone operation |
max_history() |
Show undo/redo history |
max_begin_batch() |
Group operations as one undo unit |
max_commit_batch() |
End batch and commit |
max_cancel_batch() |
Cancel current batch |
Subpatcher Navigation (3)
| Tool |
Description |
max_enter_subpatcher(name) |
Navigate into a subpatcher |
max_exit_subpatcher() |
Return to parent patcher |
max_create_subpatcher(name, x, y) |
Create a new subpatcher |
Multi-Patcher (3)
| Tool |
Description |
max_list_patchers() |
List all open patcher windows |
max_switch_patcher(name) |
Bring a patcher window to front |
max_get_patcher_context() |
Show current patcher depth and stack |
Encapsulation (1)
| Tool |
Description |
max_encapsulate(object_names, name) |
Group objects into a subpatcher |
Attributes & Scripting (3)
| Tool |
Description |
max_set_attribute(name, attr, value) |
Set an object attribute |
max_set_number_properties(name, min, max) |
Set number range |
max_script(command) |
Send raw thispatcher command |
UI Creation (7)
| Tool |
Description |
max_create_receive(name, x, y) |
Create [r name] |
max_create_send(name, x, y) |
Create [s name] |
max_create_buffer(name, frames, ch, x, y) |
Create [buffer~] |
max_create_flonum(init, min, max, x, y) |
Create number box |
max_create_dial(init, min, max, x, y) |
Create [live.dial] |
max_create_gain(init, x, y) |
Create [gain~] |
max_create_ui(class, args, x, y) |
Create any UI object |
Snapshots (2)
| Tool |
Description |
max_snapshot(name) |
Capture current patch state |
max_load_snapshot(name) |
Restore a saved snapshot |
Search & Analysis (5)
| Tool |
Description |
max_search(query, cls, text) |
Find objects by name/class/text |
max_get_connections(name) |
List all connections for an object |
max_list_classes() |
Show object class distribution |
max_patch_stats() |
Statistics about the current patch |
max_find_issues() |
Detect common patching problems |
max_explain() |
Explain signal flow of the patch |
Safety & Validation (3)
| Tool |
Description |
max_analyze_safety() |
Check for missing dac~, high gain, orphan sends, clipping risk |
max_feedback_loops() |
DFS-based cycle detection on connection graph |
max_patch_report() |
Comprehensive report: classes, types, UI vs audio count |
Modification (5)
| Tool |
Description |
max_move(name, x, y) |
Reposition an object |
max_resize(name, width, height) |
Resize an object |
max_set_text(name, text) |
Change object text/arguments |
max_set_color(name, color) |
Set object color |
max_clone(name, x, y, off_x, off_y) |
Duplicate an object |
File & DSP (2)
| Tool |
Description |
max_get_dsp_status() |
Query DSP on/off state |
max_save(filepath) |
Save the patch to a .maxpat file |
Templates (3)
| Tool |
Description |
max_list_templates() |
List built-in patch templates |
max_apply_template(name, params, title) |
Instantiate a template |
max_get_template(name) |
Get template details |
Console Feedback (4)
| Tool |
Description |
max_clear_console() |
Clear the Max Console |
max_error_count() |
Check for new errors since last query |
max_console_log(lines) |
Read the server-side command log |
max_clear_log() |
Clear the server-side log |
Ableton Live Bridge (4)
| Tool |
Description |
max_live_info() |
Get Live session info |
max_live_tempo(bpm) |
Get or set tempo |
max_live_track_info(index) |
Get track details |
max_live_send(path, message) |
Send a message to Live API |
MCP Prompts (4)
| Prompt |
Description |
build_delay |
Step-by-step delay patch builder |
build_synth |
Step-by-step synth builder |
build_filter |
Step-by-step filter builder |
explore_patch |
Analyze and explain a patch |
Architecture
MCP Client (Claude, Cursor, etc.)
↕ JSON-RPC over stdio
maxmsp_mcp.server (Python, FastMCP)
↕ OSC over UDP (port 7400 → Max, 7401 ← Max)
max/mcp_host.maxpat (Max/MSP patch)
↕ [udpreceive] → [route] → [thispatcher]
Max/MSP
Everything runs on stock Max objects — no externals, no compilation, no npm install (except for the optional chat.js). The Python server sends OSC messages to Max's [udpreceive], which routes them through [thispatcher] scripting commands.
Files
maxmsp-mcp/
├── maxmsp_mcp/
│ ├── server.py # Core server (19 tools)
│ ├── extensions.py # Extension tools (56 tools, 4 prompts)
│ ├── operations.py # Undo/redo history system
│ ├── patch_state.py # Patch state tracking + subpatcher stack
│ ├── templates.py # 6 patch templates
│ ├── transport.py # OSC UDP transport layer
│ └── guide.py # GUIDE.md contents as Python module
├── max/
│ ├── mcp_host.maxpat # Main host patch (19 OSC routes)
│ ├── dump.js # Chunked patch dumper (V8 JS)
│ ├── chat.js # Optional in-Max chat interface
│ ├── console_capture.maxpat # Console logger (port 7402)
│ └── live_bridge.maxpat # Ableton Live bridge (port 7403)
├── tests/ # Test suite
├── pyproject.toml
└── README.md
Roadmap
v0.9 ✓ — Current
- 75 tools across 21 categories
- Undo/redo with batch semantics
- 6 patch templates + 4 MCP prompts
- Safety analysis, feedback loop detection
- Multi-patcher navigation
- Object encapsulation
- Console feedback (clear, error count, log)
- Ableton Live bridge (tempo, track, send)
- 19 OSC routes (all wired)
- Chunked dump for large patches
- Self-healing connection retry
v1.0 — Next
- Test suite (pytest for all 75 tools)
- CI/CD (GitHub Actions)
- Auto-init (detect Max on first tool call)
- Real DSP state readback (
/dspstatus OSC route)
- Persistent object naming for stable references
- RNBO compilation tools
- Jitter/GL matrix operations
- Max Package release
- Homebrew tap
Credits
Built on the shoulders of:
- tiianhk — Original MaxMSP-MCP-Server (230 ★)
- ersatzben — Extended fork with safety features (126 ★)
- gluon — FastMCP-based server architecture
- jpoindexter — ableton-mcp Live API bridge (32 ★)
License
MIT