
从自然语言构建并驱动 Max/MSP 补丁 — MCP 服务器 + Max 内聊天。使用库存对象,无外部文件。早期实验(v0.4)。
概览
它能运行并附带测试套件,但实际应用很少:预计会有粗糙的部分,且预期会有所变化。它主要通过 Max 内的聊天来运行;外部 MCP 服务器运行同一引擎并通过测试,但实际使用较少。欢迎反馈和反馈。 用自然语言构建并驱动 Max/MSP 补丁,通过 MCP 客户端(Claude Desktop、Claude Code、MCP Inspector 等)。代理创建对象、布线、设置消息内容、切换音频,确保在编辑前查看实际内容,因此它停止猜测对象签名。 纯粹的Max机制——没有第三方外部设备,没有mxj,没有中继守护进程: - 补丁使用 [thispatcher] 脚本(脚本 newdefault、script connect、script disconnect、script delete、script send)。- 补丁使用 [v8] JavaScript 对象,通过官方 Max JS API(框框文本、补丁线)向补丁器传递,并返回为 JSON。
概述(AI 翻译)
早期实验 — v0.4,首次公开测试,尚未成品。 它能正常工作并附带测试套件,但实际应用非常有限: 预期会有棱角,也期待事情会改变。这大多是被锻炼的 通过 Max 内的聊天;外部 MCP 服务器运行相同的引擎并传递 测试,但实际使用很少。欢迎反馈和反馈。
用自然语言构建并驱动Max/MSP补丁, 来自MCP客户端(Claude Desktop、Claude Code、MCP Inspector等)或 来自存在于Max内部的聊天窗口。代理创建对象, 接线,设置消息内容,切换音频,读取实时补丁 在编辑之前,先看看实际存在什么,并且基于 官方对象引用,这样它就不再猜测对象特征。
纯粹的Max机制——没有第三方外部设备,没有mxj,没有继电器守护进程:
- 编写补丁使用
[thispatcher]脚本(script newdefault,script connect、script disconnect、script delete、script send)。 - 读取补丁使用
[v8]的JavaScript对象,该对象遍历补丁程序
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
maxmsp-mcp
Early experiment — v0.4, a first public test, not a finished product. It works and ships with a test suite, but it has had very little real-world use: expect rough edges, and expect things to change. It has been exercised mostly through the in-Max chat; the external MCP server runs the same engine and passes the tests but has seen little live use. Bug reports and feedback are very welcome.
Build and drive Max/MSP patches in natural language, from an MCP client (Claude Desktop, Claude Code, the MCP Inspector, …) or from a chat window that lives inside Max itself. The agent creates objects, wires them, sets message content, toggles audio, reads the live patch back to see what is actually there before it edits, and grounds itself on the official object reference so it stops guessing object signatures.
Pure Max mechanisms — no third-party externals, no mxj, no relay daemon:
- Writing the patch uses
[thispatcher]scripting (script newdefault,script connect,script disconnect,script delete,script send). - Reading the patch uses a
[v8]JavaScript object that walks the patcher via the official Max JS API (boxtext,patchcords) and returns it as JSON. - Transport to the external server is OSC over UDP between the Python server
and a stock
[udpreceive]/[udpsend]pair in the host patch. The in-Max chat drives the same plumbing directly from[node.script].
Two ways to use it
| Facade | What it is | Runs the LLM via |
|---|---|---|
| External MCP server | maxmsp_mcp.server, spoken to by Claude Desktop / Claude Code / the Inspector over stdio |
your Claude plan / MCP client |
| In-Max chat | a chat window inside the patch ([node.script chat.js] + [jweb]), no external client |
the Anthropic API (or a local model) |
Both facades share the same command vocabulary, the same host patch, and the same patching guide. Build with one, inspect or extend with the other.
Design notes
- Stable addressing. Every object the agent creates gets a scripting name.
You wire, set and delete by name, so the mapping never drifts when the user
edits the patch by hand. In the in-Max chat the model assigns its own readable
labels (
carrier,pack_main, …) and wires by those. - Single-object delete.
script deleteremoves exactly one object. - Closed loop. The agent dumps the live patch to confirm its own work and to discover objects the user added by hand, instead of building blind.
- Machinery stays hidden. Plumbing objects carry
mcp_*scripting names and are filtered out of every dump, so the agent only ever sees the musical patch. - Grounded on the docs. A parsed reference database lets the agent look up an object’s real inlets, outlets, arguments and attributes instead of inventing them.
Architecture
安装
npx @modelcontextprotocol/inspector \配置
{
"mcpServers": {
"maxmsp": {
"command": "/absolute/path/to/uv",
"args": ["--directory", "/absolute/path/to/max-mcp-server",
"run", "python", "-m", "maxmsp_mcp.server"],
"env": { "MAX_HOST": "127.0.0.1", "MAX_PORT": "7400", "MAX_RETURN_PORT": "7401" }
}
}
}