AI & MCP

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, have Studio's CAM write the program, run it 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 1.2 · 47 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 — from the workpiece as it is now, or from a fresh blank if asked — 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

Forty-seven 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
licence_statusthe edition, until when it holds and which features it includes
machine_librarythe window's machine library
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, cut material included; set up one of the examples
CAM
geometry_importkeep a shape — SVG, DXF, text, a formula, simple shapes or points — with a name, a version, a summary and a preview
program_generatethe CAM: a program from shapes and operations, 2.5 or 3 axes, with the reason for every cutting value, proven in a trial run
geometry_nestlay parts out on a plate, small ones inside the holes of large ones, with tabs (Pro)
job_get · job_editread a program's CAM job and change it — values, operations added, removed or moved — as the program's next version
Probe and inspection
probe_cycleedge, corner, bore, boss, top face or ring-gauge calibration, tried in the twin first; the work zero set only with your OK
inspect_partmeasure the finished part against the design: pockets, contours, holes, bosses, chamfers, V grooves, by ISO 2768 or ISO 286 (Pro)
inspect_reportthe inspection record as CSV and PDF, regenerated byte for byte and chained in the audit log (Pro)
setup_sheeta printable setup sheet: blank, fixture, tools, zero, room above the blank, operations and times (Pro)
Program
program_checkthe controller's check mode, the path preview against the setup and the 15 static rules
program_simulaterun to the end on a hidden copy, from the part as it is or 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_edit · program_optimizechange a program by intent (feeds, speeds, Z shift, safe height) as a new version; the optimizer
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
result_exportthe machined part as an STL file or a height map
Part library
part_save · part_list · part_getkeep a cut part with its program version, work zero, blank, set-up and measurements; list the records, read one
part_load · part_exportset the machine up to make the part again; export a record's part
part_update · part_deletename, tags and notes; delete or restore a record
The window and help
window_showshow you a workspace, a side of the 3D view, the program's path or a step of the Setup panel as it explains
settingsread the window's settings; change the language, region, units, currency or machine-hour rate only after you click Allow
manual_searchsearch Studio's manual and answer from it
report_draft · report_listdraft a problem report for you to read and send; the state of your reports and our replies

A session, as it happened

Real calls to Studio 1.0 over MCP on 9 October 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 the controller'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": [-130.002, -95.002, -65.501]} program_check → {"refused": [{"line": 14, "code": 2, "text": "G1 X42 F", "error": "A number is missing or is not a valid number."}]}
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: tool hit clamp 2 strap (X 80.966 Y 62.049 Z -60.501)"}]}, "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.64, "final_state": "Alarm", "issues": [ "1 collision(s): tool/clamp2_strap at machine position [80.97, 62.05, -60.50] mm", "5 rapid move(s) into material (28.215 mm3 cut at rapid rate)", "drive alarm(s): X following error", "lost steps X/Y/Z: 320 34 0 (1.25 um each): the drives fell behind", "chatter on 27 line(s) (10-18, 26-34, 42-50), worst at line 26: stability margin 1.88 > 1 - the cut there is 1.00 mm deep, 1.9 times the stable depth (about 0.53 mm) at S15300; cut at most 0.43 mm deep there …", "ALARM:17 - A motor drive reports a fault.", …], "run": "r1"}
Assistant
Two real problems, and a third to know about. The first layer plunges into the blank at rapid rate, and the final G0 X0 Y0 drives the tool into the front-left clamp — the drives fault and the machine stops. I changed the plunge to G1 Z-1 F150 and park with G53 G0 Z-2, away from the clamps. The twin also sees chatter: 1 mm layers are about twice the stable depth of this tool at 15,300 rpm.
Tool
program_simulate → {"completed": true, "simulated_time_s": 88.51, "issues": [ "chatter on 27 line(s) (10-18, 26-34, 42-50), worst at line 42: stability margin 1.88 > 1 - … cut at most 0.43 mm deep there …"], "material_removed_mm3": 1776.79, "replay_hash": "964c15c53873b6b6", "run": "r2"}
Assistant
No collision and no cut at rapid rate: 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 chatter stays until the layers are thinner: 0.43 mm at most. The optimizer changes only feeds, so it finds a little time and leaves the depth to you.
Tool
program_optimize → {"optimized": true, "verdict": "3.22 s faster (3.6 %), no line cuts heavier than the original's heaviest", "plan": {"changes": [{"line": 19, "what": "F", "before": 600, "after": 750, "why": "a lighter cut: up to the spindle load limit"}, …], "notes": "Tool 0 still chatters (margin 1.88): … a shallower cut does."}, "saved": {"name": "pocket_v3.nc", "version": 1}}
Assistant
Both versions are saved. Before you cut, I would make the layers 0.4 mm deep so that the twin no longer sees chatter — shall I?

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 — from the part as it is now, or from a fresh blank if asked — 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 release is tested with automated MCP clients over stdio and HTTP; 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 (the 1.0 examples: 8–28× on a current desktop PC); dense stretches such as helical entries into a deep pocket can briefly run slower than real time (example 14: 0.6× over its slowest five seconds).

Is this an AI that writes G-code?

No. It is a way for any AI — or any program — to have Studio's CAM write G-code from a shape, to test G-code against a physics model of the machine, and to improve it with evidence. Use it with your CAM, your own code or an assistant.

Will an AI ever run my real machine?

AI is bold in the twin and careful on the machine. In Studio, assistants work on twins — that is where they may try anything. Connected to a real MC-1 (shadow mode, a preview in 1.0), AI only reads: what the machine measures and records, and its analysis; it never starts a program or changes a setting. Its calls go into the audit log, which is on by default.