AI & MCP Preview

Give your AI a machine it can’t break.

Language models write G-code that looks right. Studio tells you whether it is. Its built-in MCP server lets an AI assistant set up a blank, run the program on a twin and read back what happened — alarms, collisions, forces, chatter, the shape of the part — and then make it faster.

Built into Studio 0.2.0 · 23 tools · MCP revisions 2024-11-05 to 2026-07-28 · stdio and local HTTP

How it fits together

Your AI client starts TwinwrightStudio.exe --mcp, which connects to a twin host on your computer. The host keeps its twins between conversations: a practice twin (sandbox) by default, and the machine in your window only when you switch its AI access on. Every simulation runs on a hidden copy of the setup that starts from a fresh blank, faster than real time.

Two ways to bring an AI

Use the AI client you already have, or talk to a model inside Studio. Both use the same tools on the same twins.

Your AI client, over MCP

Switch AI on, click Connect.

Studio writes the entry into your client's configuration, after showing you the change, or opens the client's own install link. Any other MCP client gets the command or the local address to paste.

  • Claude Desktop and ChatGPT desktop (Codex and Work modes): the configuration written for you
  • Cursor, VS Code (GitHub Copilot) and LM Studio: their one-click install links
  • Claude Code, Cherry Studio, Trae, Kimi Code and others: copy the command or the HTTP address
AI ▾ → Connect an AI client. The note at the bottom: the AI cannot reach a real machine, and changes to your window need your OK.
AI ▾ → Connect an AI client. The note at the bottom: the AI cannot reach a real machine, and changes to your window need your OK.
The assistant inside Studio

Bring your own key, or a local model.

The AI panel talks to Anthropic, OpenAI, DeepSeek, Qwen (Bailian), Kimi, Zhipu GLM or any OpenAI-compatible service, or to a model on your own computer in LM Studio or Ollama. It can attach the window's program, setup and check results, and it shows the twin's pictures in the conversation.

  • Keys are encrypted with Windows DPAPI and go only to the provider you choose
  • With a local model, nothing leaves your computer
  • Copy to AI and paste from AI work with any chat app, without MCP
The AI panel with a picture from result_image — in the self-test, which drives the panel with a scripted stand-in model.
The AI panel with a picture from result_image — in the self-test, which drives the panel with a scripted stand-in model.

What the AI can do

Twenty-three tools. Each returns a short summary the model can reason with and structured data with a schema, and every result names the machine it came from.

Machine
machine_statusstate, alarm and its meaning, homing, positions, tool, blank; the other machines
machine_controlhome, unlock, reset, hold, resume, stop, move, power, E-stop
machine_mdiMDI lines one at a time, an answer per line, stopping at the first refusal
Setup
setup_workpieceplace or remove a blank in a vise, under clamps, on tape — or your own STL
setup_toolthe tool in the spindle and the tool table for M6
setup_work_zeroG54 on a corner or the centre of the blank
setup_partthe design part (STL) to compare with
setup_copy · setup_examplecopy a setup to another twin; set up one of the 15 examples
Program
program_checkgrblHAL check mode, the path preview against the setup and the twelve static rules
program_simulaterun to the end on a hidden copy, from a fresh blank: time, alarms, collisions, rapids into material, loads, chatter, part deviation
program_run · program_loadrun or load on the machine itself (your window's machine asks you first)
program_debug · program_restartrun to a line, inspect, step; the start block for a restart
program_optimize · program_generatethe optimizer and the feature generator
program_versionslist, get, save and compare versions
Runs and results
run_status · run_profilewait for or stop a long run; the per-line profile
result_comparedeviation from the design part, in numbers
result_imagepictures: workpiece, toolpath, deviation map, slowest lines, curves over time, A/B comparison
log_querysearch the audit log: who did what, when, to which machine

A session, as it happened

Real calls to Studio 0.2.0 over MCP on 30 September 2026. A script plays the AI client; the tool results are the twin's, shortened.

You
Here is a pocket program for a 60 × 40 × 10 mm block of 6061 under clamps. Check it on the MC-1 before I cut it.
Assistant
I will put the blank under clamps on the practice twin, the 6 mm end mill in the spindle, G54 on the blank's front-left top corner, and run grblHAL's check mode.
Tool
setup_workpiece → {"placed": true, "material": "6061-T6", "fixture": "clamps", "mass_g": 64.8} setup_tool → {"tool": "flat 6 n3 L20", "stick_out_offset_mm": 4.5} setup_work_zero → {"g54_mpos": [-132.001, -97.001, -67.501]} program_check → {"refused": [{"line": 14, "code": 2, "text": "G1 X42 F", "error": "Missing the expected G-code word value or numeric value format is not valid."}]}
Assistant
Line 14 has an F without a value. With that fixed the controller accepts every line, but the preview against the setup still finds two problems before anything moves.
Tool
program_check → {"refused": [], "preview": {"issues": [ {"line": 9, "kind": "rapid_cut", "text": "line 9: a rapid move (G0) cuts 1.00 mm into the workpiece"}, {"line": 58, "kind": "collision", "text": "line 58: collision tool/clamp2_strap at X 80.966 Y 62.049 Z -60.501 (machine mm)"}]}, "static_rules": [{"line": 9, "rule": "S10", "severity": "warning"}]}
Assistant
To see what those would do, I ran it to the end on a hidden copy of the setup.
Tool
program_simulate → {"completed": false, "simulated_time_s": 85.87, "final_state": "Alarm", "issues": [ "1 collision(s): tool/clamp2_strap at machine position [80.97, 62.05, -60.50] mm", "spindle overload: cutting power peaked at 1117 W, above the spindle's 800 W rating", "chatter: stability margin 1.72 > 1 at 14220 rpm and 1.00 mm depth", "lost steps X/Y/Z: 315 16 0 (1.25 um each): the drives fell behind", "ALARM:17 - Motor fault."], "run": "r1"}
Assistant
Two real problems. The first layer plunges at rapid rate — 1117 W on an 800 W spindle, and it chatters — and the final G0 X0 Y0 drives the tool into the front-left clamp. I changed the plunge to G1 Z-1 F150 and park with G53 G0 Z-2, away from the clamps.
Tool
program_simulate → {"completed": true, "simulated_time_s": 88.82, "issues": [], "material_removed_mm3": 1776.62, "chatter": {"max_margin": 0.806}, "replay_hash": "e1a6b55c7bc9e5aa", "run": "r2"}
Assistant
Clean: 1 min 29 s of machine time and 1,777 mm³ removed — the 30 × 20 × 3 mm pocket less the tool's corner radii. The optimizer finds a little more.
Tool
program_optimize → {"optimized": true, "verdict": "0.84 s faster (0.9 %), no line cuts heavier than the original's heaviest", "changes": [{"line": 19, "what": "F", "before": 600, "after": 730, "why": "a lighter cut: up to the spindle load limit"}, …], "saved": {"name": "pocket_v3.nc", "version": 1}}
Assistant
Both versions are saved. The program is ready for the machine: you load it there, set the zero and press cycle start.

What the AI looks at

result_image draws the twin's results as pictures, with the key numbers in words beside them. These three came from the session above.

The first run over time (kind timeline): the rapid plunge at 12 s sends the spindle load to 153 % and the chatter margin to 1.72; at 86 s the tool meets the clamp.
The first run over time (kind timeline): the rapid plunge at 12 s sends the spindle load to 153 % and the chatter margin to 1.72; at 86 s the tool meets the clamp.
The corrected run's workpiece (kind workpiece), coloured by height, between the two clamps.
The corrected run's workpiece (kind workpiece), coloured by height, between the two clamps.
The twelve slowest lines of the corrected run and what limited each one (kind profile).
The twelve slowest lines of the corrected run and what limited each one (kind profile).

Set it up

In Studio: switch AI on, then AI ▾ → Connect an AI client, and pick yours. To configure a client by hand, point it at TwinwrightStudio.exe (installed in %LOCALAPPDATA%\Programs\Twinwright Studio) with the argument --mcp:

Claude Desktop · claude_desktop_config.json
{
  "mcpServers": {
    "twinwright": {
      "command": "C:\\Users\\<you>\\AppData\\Local\\Programs\\Twinwright Studio\\TwinwrightStudio.exe",
      "args": ["--mcp"]
    }
  }
}
ChatGPT desktop · %USERPROFILE%\.codex\config.toml
[mcp_servers.twinwright]
command = 'C:\Users\<you>\AppData\Local\Programs\Twinwright Studio\TwinwrightStudio.exe'
args = ["--mcp"]
VS Code · .vscode/mcp.json
{
  "servers": {
    "twinwright": {
      "type": "stdio",
      "command": "C:\\Users\\<you>\\AppData\\Local\\Programs\\Twinwright Studio\\TwinwrightStudio.exe",
      "args": ["--mcp"]
    }
  }
}
Command line
# Claude Code
claude mcp add twinwright -- "C:\Users\<you>\AppData\Local\Programs\Twinwright Studio\TwinwrightStudio.exe" --mcp
# any client over HTTP, on this computer only
"C:\Users\<you>\AppData\Local\Programs\Twinwright Studio\TwinwrightStudio.exe" --mcp-http 8766 --mcp-token <your token>
#   endpoint http://127.0.0.1:8766/mcp, header Authorization: Bearer <your token>
Audit log

Who did what, to which machine, and when.

Studio keeps an audit log on your computer: the operator's actions in the window, every AI tool call with the client's name, alarms, collisions, programs started and ended. Each record carries a SHA-256 hash of the one before it, across days, so a changed or missing record shows.

  • Five levels of detail, set per category: machine, operator, program, setup, AI, system
  • Verify the chain in the log window or with TwinwrightStudio.exe --audit-verify; export to CSV
  • Kept 180 days or up to 2 GB by default; API keys and tokens are masked
The audit log window (Ctrl+L). The footer: one file, 83 records, the hash chain matches from the first to the last.
The audit log window (Ctrl+L). The footer: one file, 83 records, the hash chain matches from the first to the last.

Designed so the AI stays in the twin

No path to hardware

The MCP server and the twin host start and drive simulated machines only. They have no serial or network connection to a real MC-1; in shadow mode the AI can only read.

Off until you switch it on

The window's AI switch is off by default. While it is off, AI clients work on a practice twin (sandbox) you do not see, and its results say so, so the AI does not mistake it for your machine.

Your OK for your window

When an AI wants to change the machine in your window, the header asks Allow or Decline; no answer within 60 s counts as declined. You decide whether it asks.

Simulations on copies

program_simulate runs on a hidden copy of the setup, starting from a fresh blank, so trying a program never changes the machine it was asked about.

People run the machine

A program the AI verified is a file. A person loads it on the real machine, sets the zero and presses cycle start.

Evidence that replays

Every run ends with a replay hash: the same program on the same setup gives the same hash on any computer, so a claim the AI makes can be checked.

Next

Planned

Twinwright Cloud

A hosted MCP endpoint for clients that can only reach the internet — claude.ai, ChatGPT on the web, Gemini, Microsoft Copilot — with sign-in and twins per user.

Planned

Interactive result cards

Pictures you can turn and click inside the chat, in clients that support MCP Apps.

Planned

A CNC benchmark for AI

Machining tasks scored automatically by the twin, to compare how well models write and fix G-code.

FAQ

Which AI clients work?

Any MCP client that can start a local program: Claude Desktop, Claude Code, ChatGPT desktop (Codex and Work modes), Cursor, VS Code, LM Studio, Cherry Studio, Trae and others. Web versions such as claude.ai or ChatGPT on the web only reach servers on the internet; the planned Twinwright Cloud will provide one. Every build is tested with automated MCP clients over stdio and HTTP and with local models in LM Studio; the one-click entries follow each client's documented configuration.

Does the AI see my files?

Only what you give it or what the tools return. The server runs on your computer and Twinwright receives nothing. With a cloud model, your prompts and the tool results go to that provider under its terms.

What does it cost?

The MCP server and the assistant are part of Studio and free. A cloud model is billed by its provider to your key; a local model costs nothing.

How long can a simulation take?

A call answers within 40 s; a longer run answers with a run id and run_status collects the result, because some clients give a tool call only 60 s. Simulations with material removal usually run several times faster than real time (example 02: about 5.8× on a current desktop PC); fine engraving can be slower than real time.

Is this an AI that writes G-code?

No. It is a way for any AI — or any program — to test G-code against a faithful machine and to improve it with evidence. Use it with your CAM, your own code or an assistant.