Maxmsp MCP logo

Maxmsp MCP

Community
ersatzben

This project uses the Model Context Protocol (MCP) to let LLMs directly understand and generate Max patches.

Publisherersatzben
Repositorymaxmsp-mcp
LanguageMax
Forks
19
Stars
166
Available tools
0
Transport typestdio
LicenseMIT
Links
  • Connect tools to AI workflows

    Maxmsp MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    166 stars and 19 forks from the linked repository.

MaxMSP-MCP Server (Extended Fork)

This project uses the Model Context Protocol (MCP) to let LLMs directly understand and generate Max patches.

Fork Notice: This is an extended fork of the original MaxMSP-MCP-Server by Haokun Tian and Shuoyang Zheng. See Acknowledgements for details.

What's New in This Fork

This fork significantly extends the original with new tools, safety features, and Claude Code integration:

New MCP Tools (+11)

ToolDescription
create_subpatcherCreate a new p (subpatcher) object
enter_subpatcherNavigate into a subpatcher context
exit_subpatcherReturn to parent patcher
get_patcher_contextGet current depth and navigation path
add_subpatcher_ioAdd inlet/outlet objects inside subpatchers
get_object_connectionsQuery all connections for an object
recreate_with_argsChange creation-time arguments, preserving connections
move_objectReposition an object
autofit_existingApply auto-sizing to existing objects
check_signal_safetyAnalyze patch for dangerous signal patterns
encapsulateEncapsulate selected objects into a subpatcher

Safety & Validation Features

  • Float enforcement: Math objects (+, -, *, /, %, pow, scale) and pack/unpack objects require float arguments. Use STRING args to preserve floats (JSON strips .0): ["0", "127", "0", "25."]. Use int_mode=True to explicitly allow integers. Exception: scale with output range ≤ 2 auto-detects float intent.
  • dial range enforcement: Rejects live.dial (suggests dial with inline attributes); requires @size on dial objects; rejects @size > 255 (unusable UI - use extend=True to bypass)
  • trigger/t acknowledgment: Requires trigger_rtl=True flag to confirm understanding that outlets fire right-to-left
  • random acknowledgment: Requires random_bang=True flag to confirm understanding that numbers set range but bangs trigger output
  • coll embed enforcement: Requires @embed 1 in args to ensure data persists on save
  • line~ message validation: Rejects messages with odd numeric count (likely malformed target-time pairs)
  • Object validation: Rejects invalid objects (e.g., times~ → suggests *~)
  • Argument validation: Enforces minimum arguments for complex objects (e.g., comb~ requires 5 args)
  • Parameter range checks: Catches common mistakes like svf~ Q >= 1 or onepole~ frequency < 10 Hz
  • Large patch warnings: Alerts when root patcher exceeds 80 objects
  • Signal safety analysis: Detects feedback loops, high gain, unsafe comb~ feedback, and missing limiters before dac~

Quality of Life Improvements

  • Auto-sizing: Objects and comments automatically fit their content
  • Increased timeouts: Better handling of large patchers (5s vs 2s)
  • Subpatcher support: Full navigation and creation within nested patchers
  • Alias preservation: Encapsulate preserves user-facing names (*~ not times~, t not trigger)

Demo Videos

Understand: LLM Explaining a Max Patch

img

Video link. Acknowledgement: the patch being explained is from MaxMSP_TeachingSketches.

Generate: LLM Making an FM Synth

img

Full video with audio.


Installation

Prerequisites

Installing the MCP Server

  1. Install uv:
bash
# macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. Clone and set up:
bash
git clone https://github.com/tiianhk/MaxMSP-MCP-Server.git
cd MaxMSP-MCP-Server
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
  1. Connect to your MCP client:

For Claude Code (recommended):

As of Claude Code v2.1.47, MCP servers must be registered via the CLI (the mcpServers key in ~/.claude/settings.json is no longer read). Run:

bash
claude mcp add --scope user maxmsp -- uv --directory /path/to/MaxMSP-MCP-Server run server.py

Verify with /mcp inside a Claude Code session.

Alternatively, for project-scoped configuration, create a .mcp.json at your project root:

json
{
  "mcpServers": {
    "maxmsp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/MaxMSP-MCP-Server",
        "run",
        "server.py"
      ]
    }
  }
}

For Claude Desktop or Cursor:

python install.py --client claude
# or
python install.py --client cursor

Installing to a Max Patch

  1. Open MaxMSP_Agent/demo.maxpat in Max 9
  2. Click script npm version to verify npm is installed
  3. Click script npm install to install dependencies
  4. Click script start to begin communication

Once connected, the LLM can explain, modify, or create Max objects within the patch.


Architecture

┌─────────────────┐     Socket.IO      ┌─────────────────┐
│   Claude Code   │ ←───────────────→  │    server.py    │
│  (MCP Client)   │     (port 5002)    │  (FastMCP/Python)│
└─────────────────┘                    └────────┬────────┘
                                                │
                                       ┌────────▼────────┐
                                       │ max_mcp_node.js │
                                       │   (Node.js)     │
                                       └────────┬────────┘
                                                │
                              ┌─────────────────┴─────────────────┐
                              │                                   │
                     ┌────────▼────────┐              ┌───────────▼───────────┐
                     │   max_mcp.js    │              │ max_mcp_v8_add_on.js  │
                     │  (Max js object)│              │   (Max v8 runtime)    │
                     └─────────────────┘              └───────────────────────┘
  • server.py - Python FastMCP server with Socket.IO, validation, and tool definitions
  • max_mcp_node.js - Node.js bridge running inside Max's node.script
  • max_mcp.js - Main Max-side JavaScript handler for most operations
  • max_mcp_v8_add_on.js - V8 JavaScript with boxtext access for encapsulation

MCP Tools Reference

Object Creation & Manipulation

ToolDescription
add_max_object(position, obj_type, varname, args)Create an object
remove_max_object(varname)Delete an object
connect_max_objects(src, outlet, dst, inlet)Connect two objects
disconnect_max_objects(src, outlet, dst, inlet)Disconnect objects
move_object(varname, x, y)Reposition an object
recreate_with_args(varname, new_args)Change creation-time args
autofit_existing(varname)Auto-size existing object

Object Properties

ToolDescription
set_object_attribute(varname, attr, value)Set an attribute
set_message_text(varname, text_list)Set message box content
set_number(varname, num)Set number box/slider value
send_bang_to_object(varname)Send a bang
send_messages_to_object(varname, message)Send message list

Query Tools

ToolDescription
get_objects_in_patch()Get all objects and connections
get_objects_in_selected()Get selected objects
get_object_attributes(varname)Get object's attributes
get_object_connections(varname)Get object's connections
get_avoid_rect_position()Get bounding box for placement
list_all_objects()List available Max objects
get_object_doc(name)Get Max documentation

Subpatcher Navigation

ToolDescription
create_subpatcher(position, varname, name)Create a p object
enter_subpatcher(varname)Navigate into subpatcher
exit_subpatcher()Return to parent
get_patcher_context()Get current depth/path
add_subpatcher_io(position, io_type, varname)Add inlet/outlet

Safety & Organization

ToolDescription
check_signal_safety()Analyze for dangerous patterns
encapsulate(varnames, name, varname)Encapsulate objects

Development

After making code changes:

  1. Reload js objects in Max (double-click to open editor, then close)
  2. Restart node.script (script stop, then script start)

Acknowledgements

This fork is based on the original MaxMSP-MCP-Server created by Haokun Tian and Shuoyang Zheng.

The original project is licensed under the MIT License. See LICENSE for details.

Original repository: https://github.com/tiianhk/MaxMSP-MCP-Server


Disclaimer

This is a third-party implementation and not made by Cycling '74.

Use Maxmsp MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Maxmsp MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Maxmsp MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Maxmsp MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "maxmsp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Maxmsp MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Maxmsp MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Maxmsp MCP to help me with this task?
Maxmsp MCP
Sure. I read it.
Here is what I found using Maxmsp MCP.

Frequently asked questions

What is the Maxmsp MCP MCP server used for?

Maxmsp MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Maxmsp MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Maxmsp MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Maxmsp MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Maxmsp MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Maxmsp MCP MCP to TypingMind?

Maxmsp MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Maxmsp MCP MCP provide in TypingMind?

Maxmsp MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Maxmsp MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Maxmsp MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇