Maxmsp MCPのロゴ

Maxmsp MCP

コミュニティ
ersatzben

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

公開者ersatzben
リポジトリmaxmsp-mcp
言語Max
フォーク
19
スター
166
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Maxmsp MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには166件のスターと19件のフォークがあります。

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.

Maxmsp MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Maxmsp MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Maxmsp MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Maxmsp MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "maxmsp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてMaxmsp MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Maxmsp MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Maxmsp MCPを使ってこのタスクを手伝ってもらえますか?
Maxmsp MCP
はい、読みました。
Maxmsp MCPで調べた結果をお伝えします。

よくある質問

Maxmsp MCP MCPサーバーは何に使いますか?

Maxmsp MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでMaxmsp MCP MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでMaxmsp MCPを利用できます。

TypingMindでMaxmsp MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Maxmsp MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Maxmsp MCP MCPをTypingMindに接続するにはどうすればよいですか?

Maxmsp MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでMaxmsp MCP MCPのどのようなツールを利用できますか?

Maxmsp MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Maxmsp MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Maxmsp MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇