mcp-bridge-for-moi: let an AI agent model in MoI while you watch

 From:  Gabriel
12111.20 In reply to 12111.19 
Hey Larry,
what you're saying is absolutely right, and it's exactly why the MCP approach works differently.

Most commercially available AI models still have no geometry kernel, and mcp-bridge-for-moi doesn't pretend otherwise. It doesn't generate geometry at all. All the geometry is made by MoI's own kernel, in your open document, through MoI's scripting API. The AI's only job is to decide which MoI command to run and with what numbers — the same decisions you make when you type a value into a command's input field.

How it works in practice

Two pieces: a small script that sits in MoI's startup folder and connects out over a local WebSocket, and an MCP server that your AI client (Claude Code, Claude Desktop, anything that speaks MCP) launches. The server talks to the agent on one side and to MoI on the other. It listens on 127.0.0.1 only, with a token regenerated each start.

The agent gets a handful of tools. The important one runs JavaScript inside MoI, which is how it calls MoI's geometry factories — the same 110 commands the UI drives (box, loft, revolve, fillet, boolean, …). 103 of them can be driven from a script; the other 7 need an interactive viewport pick or produce nothing headless, and are documented as such. Every one of the 103 is committed with real inputs and its output checked by an automated test run.

The rest of the tools are: list the scene (id, type, whether an object is a closed solid, bounding size, document units), read your selection, set the selection or the view, render a viewport image so it can look at what it just made, and export to STEP/OBJ/STL etc.

On scale and precision specifically

- Every factory input is a number in document units. A box 3600 × 240 × 2700 mm is that, exactly, because MoI built it.
- If the open document has no unit system, modelling and export are refused with a no_units error until you pick one.
- Exports go through MoI's own translators, so a STEP out of it is a MoI STEP.

So the failure mode you hit with Grok — plausible-looking nonsense with no kernel underneath — isn't really available here. What can go wrong is different and more mundane: the agent picks the wrong command, mis-orders an operation, or misjudges a dimension it inferred rather than was given. You see it happen live in your viewport.

Cheers,
Gabriel

EDITED: 18 Sep 11:21 by GABRIEL