Modo MCP
# modo-mcp
Let an LLM work inside Foundry Modo: inspect the scene and shader tree, run
commands and Python, build and edit geometry, and check the result in the
viewport.
It is the Modo counterpart to BlenderMCP, with one addition that matters more
for Modo than for Blender: models know Blender's Python API well and Modo's
barely at all. So the server can look up the exact signature of any Modo
command at runtime, and search your own Modo scripts and kits for working
examples, instead of letting the model guess.
## Requirements
- Modo 17.x (tested on Modo 17.1, macOS) and Python 3.10 or newer
- An MCP client such as Claude Desktop or Claude Code
## ⚠️ Security: read this first
This tool lets an AI model execute code on your computer. Treat it like
giving someone access to a terminal logged in as you.
- **No sandbox.** `modo_run_python` runs inside Modo with your user
account's permissions. Code can read, change or delete any file you can,
access the network and start other programs. Modo's own command language
can also run script files, so switching Python off (`MODO_MCP_ALLOW_PYTHON=0`)
narrows the risk but does not remove it.
- **Prompt injection.** The model can be steered by text it reads: a web
page, a document, even item names or notes inside a scene someone sent
you. Be careful when it works on content you did not create.
- **Your scene.** The model can delete or overwrite scene content and save
files. Save your work before a session, or work on a copy.
What helps:
- **Keep tool approval on in your client.** Claude Desktop asks before each
tool call; do not choose "always allow" for `modo_run_python` or
`modo_run_command`, and read the code before approving it.
- Stop the bridge when you are not using it (`mcpBridge.stop`).
- The bridge requires a token, created automatically in
`~/.modo_mcp/bridge_token`. On macOS and Linux only your account can read
it; on Windows it is protected by your user profile's access rights. Keep that
file private: whoever can read it can drive Modo. The bridge also only
listens on `127.0.0.1`. Without the token, other
programs and users on the same machine could otherwise connect.
You use this software at your own risk; see the MIT license's warranty
disclaimer.
## How it fits together
```
MCP client (Claude Desktop, ...)
| MCP over stdio
modo_mcp ---- NDJSON over TCP, 127.0.0.1 only ----> mcp_bridge kit inside Modo
```
Two parts to install: the **kit** goes into Modo, the **server** is a Python
package your MCP client starts. Nothing listens on the network.
## Installation
You need Modo 17.x and Python 3.10 or newer.
**1. Kit.** Download `mcp_bridge_0.5.0.lpk` from the
[latest release](https://github.com/Hesekiel2517/modo-mcp/releases/latest) and
drag it into a Modo viewport (or double-click it). Restart Modo.
An **MCP** button now sits at the start of Modo's top toolbar. It is orange
while the bridge runs and grey when it is stopped; clicking it opens the bridge
menu: **Start**, **Stop** and **Status**, a **Bridge Running**
checkbox that shows and switches the state, **Announce Calls in Event Log**,
**Start with Modo** (off by default), and diagnostics (recent activity, manual
queue processing, the data folder, help).
Click **MCP** and choose **Start**; the button turns orange and the event log
reports the bridge as ready with `pump=idle`.
Every menu entry is also a command (`mcpBridge.start`, `mcpBridge.status`,
`mcpBridge.running`, `mcpBridge.announce`, `mcpBridge.log`, ...) for scripts,
hotkeys or the command line.
The kit ships its own documentation page (`kit/mcp_bridge/docs/index.html`),
which opens from the menu's **Help** entry or from Modo's Help menu. It works
offline and always matches the installed version.
**2. Server.** From the repository root:
```bash
pip install -e .
```
**3. Knowledge index** (optional, strongly recommended).
```bash
python -m modo_mcp.knowledge.build_index \
--scripts "/Applications/Modo17.1v1.app/Contents/Resources/python3kit" \
--repo ~/path/to/one/of/your/kits \
--out ~/.modo_mcp/index.json
```
`--scripts` should point at a directory containing Modo's `modo/` and `lxu/`
packages somewhere below it; it is searched recursively. Add `--repo` for any
of your own kits or script folders, as many as you like. The `sdk` count
printed at the end should be in the thousands. If it is 0, the path contains
no SDK and the index is missing its most useful part.
A set of verified facts about Modo ships with the server and is available even
without building an index.
The index contains source code from your Modo installation (Foundry's SDK and
bundled scripts, some by third-party authors). It is built locally for that
reason: **do not publish or share an `index.json`.**
**4. Connect your client.** In the same terminal environment you installed
the server in:
```bash
modo-mcp setup # Claude Desktop
modo-mcp setup --client lmstudio # LM Studio
modo-mcp setup --print # entry to paste into any other client
```
This writes the entry with the absolute path of the Python the server is
installed in, so it works with conda and virtualenvs, whose PATH the client
does not inherit. It backs up the file first, touches only its own `modo`
entry, moves an `mcpServers` block that ended up nested inside another object
to the top level, and refuses to write over a file that is not valid JSON.
`--dry-run` shows the changes first; `--remove` takes the entry out again.
Quit the client completely (Cmd+Q on macOS) and reopen it. Then ask for
`modo_bridge_status`: it should report the bridge as reachable and list the
active toolsets.
No token needs configuring. The kit creates one on first start in
`~/.modo_mcp/bridge_token`, readable only by your user account, and the
server reads it from there.
## Working with the assistant
A few things that make a real difference, several of them echoing Maxon's
advice for Cinema 4D's built-in MCP server:
- **Leave Modo alone while the assistant works.** Clicking around changes the
selection and the active scene underneath it. Wait, or stop the task first.
- **Check the result yourself.** A model can describe its own work with more
confidence than it deserves. Look at the viewport and the item list before
accepting that something is done.
- **Expect a conversation.** The second or third request usually lands much
better than the first. Describe objects, sizes, frame ranges and how you
plan to edit the result afterwards.
- **Ask for many objects in batches.** Hundreds of separate creations in one
go are slow and fragile.
- **Prefer standard Modo setups for handoff.** Something built from generated
Python is hard for a colleague to change; ask for regular items and tools
where the result has to be edited later.
- Every call appears in Modo's event log as `mcp > ...`.
## Tools
| Group | Tools |
|---|---|
| Scene | `modo_get_scene_summary`, `modo_get_scene_graph`, `modo_get_item`, `modo_get_shader_tree`, `modo_get_selection` |
| Discovery | `modo_get_command_info`, `modo_find_commands`, `modo_search_examples`, `modo_get_sdk_source` |
| Execution | `modo_run_command`, `modo_run_python`, `modo_set_channels`, `modo_save_scene` |
| Undo | `modo_undo_last`, `modo_begin_action`, `modo_commit_action`, `modo_rollback_action` |
| Visual | `modo_capture_viewport`, `modo_capture_ui`, `modo_render`, `modo_get_job_status` |
| App | `modo_restart`, `modo_close_dialog`, `modo_launch_instance` |
| Diagnostics | `modo_bridge_status`, `modo_get_bridge_log`, `modo_get_event_log`, `modo_get_crash_reports`, `modo_list_dialogs`, `modo_list_instances`, `modo_use_instance` |
Scene tools return the hierarchy first and channels on request, because a
single material carries well over a hundred channels. Responses are capped
(see `MODO_MCP_MAX_CHARS`) and always say when they were trimmed and how to
ask more narrowly.
## Several Modo instances
Several chats can work at the same time, each in its own Modo. Every bridge
(kit 0.5.0+) takes the first free port from 15678 on and announces itself in
`~/.modo_mcp/instances/<pid>.json`. Each chat's MCP server takes a free
instance and records its claim in `<pid>.lease`; the claim lapses when that
chat's server quits or has been idle for `MODO_MCP_LEASE_S` (600 s). A chat
never takes an instance another chat holds unless told to
(`modo_use_instance(..., take_over=true)`). When all are busy,
`modo_launch_instance` starts another Modo with `-dbon:noconfig`, so it never
writes Modo's settings when it quits (verified on 17.1). Needs "Start with
Modo". `MODO_MCP_PORT` still ties a server to one Modo. The shared
`bridge.log` carries each line's process id; crash reports are matched to the
instance that crashed.
## Configuration
| Variable | Default | Purpose |
|---|---|---|
| `MODO_MCP_INDEX` | `~/.modo_mcp/index.json` | knowledge index |
| `MODO_MCP_PORT` | unset | ties the server to one Modo on this port (`mcpBridge.start port:N`); unset = choose among instances |
| `MODO_MCP_LEASE_S` | `600` | idle seconds before another chat may take this chat's Modo |
| `MODO_MCP_TOOLSETS` | `all` | `readonly`, or groups: `scene`, `discovery`, `edit`, `python`, `viewport`, `render`, `app` (diagnostics always on) |
| `MODO_MCP_TOKEN` | from `~/.modo_mcp/bridge_token` | override the token file |
| `MODO_MCP_ALLOW_PYTHON` | `1` | `0` removes `modo_run_python` |
| `MODO_MCP_ALLOW_CAPTURE` | `1` | `0` removes the screenshot tool, for text-only models |
| `MODO_MCP_MAX_CHARS` | `40000` | response budget; lower it for local models |
| `MODO_MCP_WATCHDOG_S` | `20` | seconds without a reply before Modo is sampled; `0` disables |
## Known issues
- **Occasional freezes with Python-based mesh operations.** If the scene
contains Python mesh ops (for example the qkCableKit), commands that wait
for scene evaluation -- `scene.new`, `scene.open`, `scene.close`, time
changes, viewport framing, deletions -- can deadlock Modo. The cause is in
Modo's Python integration, which does not release Python's GIL while a
command waits; the same command from the menu is safe. It is a race and
usually succeeds. The server adds a note when such a command is used, and
on macOS a watchdog recognises the deadlock within about 20 seconds and
says so, instead of a silent timeout after minutes. Modo then has to be
force-quit. A report for Foundry is in
[docs/foundry_bug_report.md](docs/foundry_bug_report.md).
- **"Modo quit unexpectedly" at quit (macOS)** is fixed by the kit for all
kits: once anything touched Modo's windows through PySide, Qt aborted in
`exit()` after Python had finished. The kit detaches PySide from Modo's
widgets while Modo quits, even when the bridge is not running. Off with
`~/.modo_mcp/qtfix.off`.
- **`deformer.freeze`** fails intermittently and has crashed Modo. The server
refuses it until the scene is saved and the call is repeated with
`acknowledge_risk=true`. If you find the trigger, please report it.
- **Rendering is experimental.** The frame buffer export path has not been
verified on every build.
- **Screenshot size.** On 17.1 `gl.snapshot` takes no size arguments; the
image is whatever size the viewport is.
- **Undo.** Each tool call runs inside a command declared undoable, but how
many Ctrl+Z steps one call takes has not been verified systematically. Save
before large changes.
- Tested on macOS; a user reports it running on Windows 11 (Modo 17.1)
without hangs. Reports from Linux are welcome.
On Windows: freezes are not diagnosed automatically (the watchdog relies on
macOS `sample`), so they show up as a plain timeout; and if `modo-mcp setup`
seems to have no effect, open the config through Claude Desktop (Settings >
Developer > Edit Config) and paste the entry from `modo-mcp setup --print`.
## Troubleshooting
**"Unknown Command mcpBridge.start"** — the kit did not load. Restart Modo
after installing, then check System > Event Log for the reason.
**"Port 15678 is already in use"** — usually a Modo instance that did not fully
quit after a crash. `lsof -i :15678` names it. Or start on another port with
`mcpBridge.start port:15679` and set `MODO_MCP_PORT` to match.
**Server list in Claude Desktop is empty, or "No executable file at ..."** —
the client configuration is wrong. Run `modo-mcp setup` from the environment
the server is installed in; it fixes both a wrong path and a misplaced
`mcpServers` block, with a backup.
**"invalid or missing token"** — the MCP server predates the token file or
reads a different one. Update the server, or set `MODO_MCP_TOKEN` to the
content of `~/.modo_mcp/bridge_token`.
**Bridge stops answering** — a modal dialog in Modo blocks the main thread,
and with it the bridge. The bridge suppresses dialogs for everything it runs,
so this should be rare; click the dialog away if one appears.
**Modo crashed or froze** — ask for `modo_get_crash_reports` (macOS, works
while Modo is down): it classifies Modo's crash reports and names the bridge
operation that was running and never finished. Or restart Modo, run
`mcpBridge.start`, then ask for `modo_get_bridge_log`. The last `op_start` without a matching `op_ok` is what
was running when Modo went down, including a preview of the command or code.
If the watchdog reported a GIL deadlock, see Known issues.
**`mcpBridge.status` reports `pump=manual`** — idle scheduling is not
available on this build. Bind `mcpBridge.pump` to a key or form button; queued
requests only run when it fires.
## Development
```bash
python3 tests/test_integration.py # socket, protocol, dispatch, ops
python3 tests/test_plugin_load.py # kit config, command registration, menu toggles
python3 tests/test_menu.py # menu configuration and icons
python3 tests/test_pump.py # main-thread pump, re-entrancy, forensics
python3 tests/test_lifecycle.py # start/stop, reload, port conflicts
python3 tests/test_risky.py # unstable-command gate, bundled facts
python3 tests/test_watchdog.py # hang diagnosis from stack samples
python3 tests/test_setup.py # client configuration edits
python3 tests/test_toolsets.py # which tools the model is offered
python3 tests/test_windows.py # Windows port and path handling
python3 tests/test_knowledge.py # index building, ranking, lookup
python3 tests/test_compat.py # pre-flight check against Modo's Python
python3 tests/test_crashguard.py # no commandservice query for unknown names
python3 tests/test_pitfalls.py # Modo bug workarounds, crash reports
python3 tests/test_qtfix.py # Modo's crash at quit (PySide property)
python3 tests/test_instances.py # several Modo instances and chats
```
The tests run without Modo: `tests/fakemodo/` stubs `lx`, `lxu` and `modo`
closely enough to exercise everything except the correctness of individual
Modo calls. Build the installer with `python3 kit/mcp_bridge/build_lpk.py`.
How it works and why: [docs/DESIGN.md](docs/DESIGN.md).
## Credits
Many thanks to **Sylvain Bergeon**, author of the
[ShaderTreeToUSD](https://github.com/SylvainBergeon/ShaderTreeToUSD) kit. The scene walker, the channel reader and the curated
per-type channel table are generalised from his exporter. That code solved
the hard parts of reading Modo's channel model -- channel triples, gradient
keys, the shadeLoc graph -- and this project would have taken much longer
without it. See the design notes for what was carried over and what changed.
Undo of the assistant's own steps, the wait before screenshots and a number
of Modo facts come from **modo-tools** by its contributors
([scoomboot/agentic-tools](https://github.com/scoomboot/agentic-tools), MIT),
a project that builds on this bridge. The code here is ours; see
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## Trademarks
Modo is a trademark of The Foundry Visionmongers Ltd. Claude is a trademark
of Anthropic. This project is independent and not affiliated with or endorsed
by either company.
## Contributing
Bug reports, crash logs and Windows/Linux test results are welcome as issues.
## License
MIT © 2026 Leonard Billeke. See [LICENSE](LICENSE).
Ported and adapted third-party code: see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
TDQS
Scored across 31 tools
Most tools target clearly distinct facets of Modo control: scene reading, command discovery/inspection, execution, rendering, diagnostics, and instance management are well separated. Some mild overlap exists among the three diagnostic log tools (modo_get_event_log, modo_get_bridge_log, modo_get_crash_reports) and between modo_undo_last and modo_rollback_action, though the descriptions do differentiate them.
Names consistently use snake_case with the modo_ prefix and a predictable verb_noun structure (get_scene_summary, run_command, set_channels, list_instances). A couple of exceptions like modo_render and modo_bridge_status lack an explicit verb but remain readable and unsurprising.
At 31 tools this set is heavy, but the domain is broad: scene introspection, command execution, rendering, undo/rollback, diagnostics, crash analysis, UI/dialog control, and multi-instance management all justify dedicated tools. Still, several groups could be consolidated (for example the three log/diagnostic tools or the four instance tools), making the count borderline rather than ideal.
The surface covers the major lifecycle needs: scene overview and graph reading, item and shader inspection, command discovery and execution, Python scripting, channel setting, saving, rendering with job polling, undo/begin/commit/rollback, viewport and UI capture, dialogs, and instance management. Minor gaps exist—no dedicated scene open/close or item create/delete tools—but these are reachable through modo_run_command or modo_run_python.