Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SolidCraft and AI agents (MCP)

SolidCraft speaks the Model Context Protocol over stdio (JSON-RPC 2.0, one message per line; protocol revisions 2025-06-18, 2025-03-26 and 2024-11-05). An agent models exactly like a person does: every tool runs engine commands, the same ones the toolbar, palette, scripts and control channel use, and never opens a dialog.

Persistent headless and bridged sessions expose asynchronous product images through the ordinary execute tool: render.preflight, render.start, render.status, render.cancel and render.export. Keep the complete returned job ID; image bytes remain in the session until explicit PNG export. See render jobs.

For sandboxed plugins and parametric timeline features that also use run(command, args), see RFC 0002. Desktop MCP in this document remains the reference implementation today.

Choosing a mode

If you only want an interactive chat docked inside the desktop window—with viewport selection pills, per-message undo, and built-in Ask / Edits / All approvals—use the in-app Agent chat panel instead of configuring an external MCP client.

Use solidcraft-cli mcp (or uvx solidcraft mcp) directly when you want an external coding agent (Claude Code, Codex, Cursor, Claude Desktop, OpenCode, VS Code, Zed, etc.) or your own program to drive SolidCraft:

ModeCommandWhen to use
Auto (default)uvx solidcraft mcp or solidcraft-cli mcpEveryday use with an external coding agent. Bridges to the running desktop app if Preferences → Assistant → Agents through MCP → Let AI agents connect is on; otherwise starts a headless session and upgrades to the app on the next call as long as no design work has happened yet.
Bridged (explicit)solidcraft-cli mcp --connect 127.0.0.1:7878Watch an agent model live in a specific desktop window (solidcraft --control 7878), or start the MCP server before launching SolidCraft without falling back to headless. Supports window screenshots, selection context, and desktop app management tools.
Headlesssolidcraft-cli mcp --headless (or --in part.sc)Deterministic automation, CI, multi-part batch generation, or machines without a desktop window. Runs in-process with no GUI; add --structured for programmatic clients and --render-gpu when headless GPU render jobs are needed.

Start it

With uv there is nothing to install first: uvx solidcraft mcp runs the MCP server over stdio from the solidcraft package on PyPI, whose wheel carries solidcraft-cli on Linux (x86_64, aarch64), macOS and Windows (elsewhere the package finds an installed solidcraft-cli on PATH or through SOLIDCRAFT_CLI) (pip install solidcraft installs the same solidcraft command). Any MCP client takes it as command uvx, args ["solidcraft", "mcp"]:

{
  "mcpServers": {
    "solidcraft": { "command": "uvx", "args": ["solidcraft", "mcp"] }
  }
}

uvx solidcraft <args> is solidcraft-cli <args>, so every flag below works the same way. Claude Code: claude mcp add solidcraft -- uvx solidcraft mcp.

# Headless: an in-process design session, no window (screenshots are drawn on the GPU).
solidcraft-cli mcp

# Headless, starting from a design file or a command script.
solidcraft-cli mcp --in part.sc

# Bridged to the running app, so you can watch the agent model. Turn on the app's control
# channel first (see below); then no flag is needed on either side:
solidcraft &
solidcraft-cli mcp          # finds the running app; headless when none runs (--headless forces that)

# A fixed port, or a second app: name it.
solidcraft --control 7878 &
solidcraft-cli mcp --connect 127.0.0.1:7878

# Local Streamable HTTP server: multiple local clients share one warm headless session
# (for example a large .sc assembly kept hot in RAM, optionally with --render-gpu).
solidcraft-cli mcp --http 127.0.0.1:8765 --http-info-file ~/.cache/solidcraft-mcp.json --in assembly.sc --render-gpu

Streamable HTTP (--http)

solidcraft-cli mcp --http <addr> serves the standard MCP Streamable HTTP transport on /mcp so multiple local MCP clients (Claude Code sessions, Codex, Python scripts) can share one persistent warm SolidCraft session in RAM without reloading a large .sc assembly per client:

# Fixed loopback port + generated bearer token written to an info file
# (stderr logs the ready URL and info-file path; generated tokens are never printed to stderr).
solidcraft-cli mcp --http 127.0.0.1:8765 --http-info-file ~/.cache/solidcraft-mcp.json --in assembly.sc --render-gpu

# Ephemeral loopback port + connection metadata file:
# writes {"url": "http://127.0.0.1:<port>/mcp", "token": "...", "pid": ...}.
solidcraft-cli mcp --http 127.0.0.1:0 --http-info-file ~/.cache/solidcraft-mcp.json --in assembly.sc

# Explicit bearer token from a file or environment variable (no --http-info-file required;
# preferred over command-line arguments).
solidcraft-cli mcp --http 127.0.0.1:8765 --http-token-file ~/.config/solidcraft/mcp.token --in assembly.sc
SOLIDCRAFT_MCP_TOKEN="..." solidcraft-cli mcp --http 127.0.0.1:8765 --in assembly.sc

Security model:

  • Loopback only: --http accepts only loopback bind addresses (127.0.0.1:PORT, 127.0.0.1:0, [::1]:PORT, or localhost:PORT). Non-loopback addresses (0.0.0.0, [::], LAN IPs) are refused at startup.
  • Mandatory Bearer authentication: every HTTP request must carry Authorization: Bearer <token> (verified in constant time; missing or wrong tokens receive 401 Unauthorized). Pass --http-token-file or SOLIDCRAFT_MCP_TOKEN to supply a token explicitly; otherwise the server generates a random 32-byte hex token from OS entropy and requires --http-info-file to write url, token and pid. Generated tokens are never printed to stderr (MCP clients often record a server’s stderr in log files); stderr prints only the ready URL and the info-file path. On Unix the info file is created with owner-only permissions (0600); on Windows it does not get an owner-only ACL (it inherits its parent directory’s permissions), so on shared Windows machines place --http-info-file inside a user-private directory (for example under %LOCALAPPDATA% or %USERPROFILE%).
  • DNS rebinding protection: requests with a non-loopback Host or Origin header are refused with 403 Forbidden.
  • File scope: --allow-path, --require-allow-path and --allow-any-path apply identically to stdio mode.

Endpoints and multi-client serialization:

  • POST /mcp accepts JSON-RPC requests and notifications (up to 16 MiB). initialize creates a new per-client Mcp-Session-Id returned in the response header; subsequent requests must send that Mcp-Session-Id. Requests return 200 OK (application/json, or text/event-stream when Accept requests SSE only); notifications return 202 Accepted.
  • DELETE /mcp with Mcp-Session-Id closes that client’s MCP session (204 No Content) without shutting down the shared SolidCraft server or disrupting other connected clients.
  • GET /mcp returns 405 Method Not Allowed (Allow: POST, DELETE) because this server does not push unsolicited server-initiated SSE streams.
  • Serialized shared session & atomic batch guidance: all connected clients share the same in-memory design session, and concurrent HTTP requests are dispatched serially in strict FIFO order so the session is never corrupted. When multiple clients edit the same design, wrap multi-step edits (such as sketch creation, geometry, sketch.finish and solid.extrude) in a single atomic batch (default rollback: true) so another client’s request cannot interleave mid-sequence, and check document.revision when coordinating reads and writes across clients.

execute view.pick with rays: [{origin, dir}…] answers in every session, headless too: for each world ray, the body, face index, world point, outward normal and depth where it first meets the design’s shown bodies, decided on their exact faces (null where it meets nothing; all: true lists every body it meets, nearest first). With --headless, or when automatic discovery starts a headless session, the engine answers; connected, the app does. bodies: [names] picks among those bodies only, headless and connected alike (a name that is no body is refused; [] meets none). Picking screenshot pixels requires a connection to the running SolidCraft app; frame: "model" chooses the pixels of a rendered model image and does not enable headless pixel picks. See ui.pick in the control protocol for pixel and ray parameters.

Reuse a headless session from another program

For a program that makes many parts, keep one solidcraft-cli mcp --headless process running and use its stdio connection for successive tool calls. The server holds one active design, including its parameters and history, until the process exits. Use new_design or open between independent jobs, and save each result before replacing the active design. Use separate server processes for independent concurrent jobs; do not interleave edits to different designs on one connection.

For example, install the Python MCP SDK (pip install mcp==2.3.0 for this example) in your application’s environment and run this script with the CLI on your PATH. It creates two independent parts, measures them, and saves a design and STEP file for each:

import asyncio
import json
from pathlib import Path

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client


async def main():
    output = Path("headless-parts").resolve()
    output.mkdir()  # A fresh directory: do not overwrite an earlier job.
    server = StdioServerParameters(
        command="solidcraft-cli",
        args=["mcp", "--headless", "--allow-path", str(output),
              "--require-allow-path"],
    )
    async with stdio_client(server) as (read, write):
        async with ClientSession(read, write) as session:
            info = await session.initialize()
            print("SolidCraft version:", info.server_info.version)

            async def call(name, arguments):
                result = await session.call_tool(name, arguments)
                if result.is_error:
                    raise RuntimeError(result.content)
                return result

            # Both parts use the same server process and connection.
            for length in (10, 20):
                name = f"Part-{length}"
                await call("new_design", {"name": name})
                await call("execute", {
                    "command": "solid.box",
                    "params": {"length": length, "width": 5, "height": 2},
                })
                measured = await call("measure", {})
                print(json.loads(measured.content[0].text)["total"]["volume_mm3"])
                await call("save", {"path": str(output / f"{name}.sc")})
                await call("export", {"path": str(output / f"{name}.step")})


asyncio.run(main())

Expected volumes are 100 and 200 mm³. The output directory is explicitly allowed; see file access rules. For sheet-metal jobs, call the flat-pattern and bend-table commands through execute, using describe_command to discover their inputs.

The MCP protocol revision is negotiated at initialization. For production integrations, record the server version, pin the SolidCraft release used for your jobs, and test your command inputs and result handling before upgrading. Use tools/list, list_commands and describe_command to discover the available tools and command contracts. Check tool errors before proceeding. A negotiated MCP revision does not pin SolidCraft’s command schemas or CAD results across releases. This example uses the process interface; it does not require Python bindings to the Rust engine.

The app listens when turned on

The desktop app opens its control channel on 127.0.0.1:27878 (or the next free port when that one is taken) when Preferences > Assistant > Agents through MCP > “Let AI agents connect” is on. It is off for a new install; the setting and its port take effect at once. It is reachable from this computer only, and every connection must show the token made fresh for that launch, readable only by your user account (control-protocol.md). The app writes the port to control/current.port in the same folder as its token file; solidcraft-cli mcp with no arguments reads it. --control PORT and SOLIDCRAFT_CONTROL_PORT still choose the port and apply even when the setting is off. With the setting off and no flag, the app listens on nothing.

Bridged, the server finds the app’s control token in the token file the app wrote for that port (control-protocol.md); --token T or SOLIDCRAFT_CONTROL_TOKEN give it explicitly when the app runs in a sandbox whose data folder the server can’t see (prefer the variable: command-line arguments are visible to other users in the process list).

A bridged server starts even when no app listens on that port yet, so an MCP client that launches it before the app (or after the app was closed) keeps its tools. The server’s instructions then say the app was not running, and every tool call answers with an error that starts no SolidCraft app is listening at HOST:PORT and says how to start it (solidcraft --control PORT). The first call after the app starts connects to it, reading that launch’s token. When the app quits or crashes mid-session, the next call says the same; a call that was running when it went away says the app did not answer and may have quit or crashed, after running the call or not, so inspect the design before sending a change again. A batch that could not be sent says the app is not running, so it is safe to send again. The app serves 16 connections at once, and every bridged server, CLI run or script connected to it holds one; a call past that says the app refused it without running it, so it is safe to send again once one of them has ended.

stdout carries only protocol messages; errors go to stderr. Bridged screenshots are written to a temporary file by the app and read back by the server, so both must run on the same machine.

Parameter checking

Commands with a typed parameter contract (every new command, and more of the older ones as they are converted; describe_command shows a command’s schemas) can be checked as they are called. --param-check off|warn|strict sets the level for a headless session, including a script or recipe given with --in, and for calls bridged to the app; the default is off, which changes nothing. warn runs the call and adds param_warnings to its result, such as unknown key `operaton`; did you mean `operation`? (a starting script’s warnings go to stderr). strict refuses the call, and the design is left as it was. Bridged, the server asks the app once per connection whether it checks a request’s own level (control.capabilities and param_check in control-protocol.md). If it does, every call and batch is sent with the level and the app checks it against its own commands, so a newer app’s keys are not refused. At strict, a reply that doesn’t say the app checked the call at that level is an error (it may have run unchecked: inspect the design), and the server checks the next calls itself. An older app is checked here instead, against the server’s own commands’ contracts, before anything is sent: strict sends nothing that breaks one, and a command the server has no contract for goes to the app unchecked. With such an app, use the server from the same release: an app newer than the server may take keys the server’s contracts don’t know yet, and strict would refuse them.

Which files the agent can reach

Tool calls read, write and delete files only inside the server’s folders:

  • the folder of the open design (the --in design, the design open in the app, or whatever the agent last opened or saved), when it lies strictly inside your home folder (or the temporary folder) and not in a hidden folder, or on Windows at least two folders below the root of another local drive (neither your home drive nor the system drive) outside system and hidden folders. Home itself, a folder above it (/, /home, /Users, a drive’s root), a top-level folder on another drive, Windows system folders, hidden folders such as ~/.config, and folders elsewhere don’t count. Hidden files and folders inside the design’s folder (.env, .git, AppData) are out of reach too;
  • on the same terms, every folder the agent opened or saved a design file in during this server’s run (open, save, or doc.open, file.save and file.save_as through execute or batch, with the path given in full) and, headless, every folder a design was open in, until the server stops (the 16 most recent). So after a new design, an opened STEP file or a save-as elsewhere, the agent can still save beside the design it worked on. Such a call succeeded only because its folder was already one of the agent’s, so no folder joins just because the agent names it;
  • SolidCraft’s own recovery folder, so doc.recovery_list, doc.recover and doc.recovery_discard work out of the box (discarding deletes only real recovery entries);
  • the server’s own scratch folder (a new private solidcraft-mcp-* folder in the temporary folder), where screenshot without a path goes;
  • every --allow-path DIR (repeat it for more). A folder named here is reached in full, hidden files included. A folder that does not exist (or can’t be resolved) is left out and stderr says so (allow-path DIR ignored: it doesn't exist); the server still starts. In a server that decides paths itself (not bridged to the app with --connect), a refused path under it names that --allow-path in the error. A folder that does not exist yet is not accepted: create it, then name it. --require-allow-path makes the server refuse to start when every --allow-path is unusable.

The CLI removes its own scratch folder if it is empty when the MCP command returns, including after a startup error. A nonempty scratch folder is kept, so saved files are not deleted.

The working folder the server was started in does not count by itself, so ~/.ssh, ~/.aws, ~/.bashrc and other dotfiles are never in reach by default. stderr lists the folders at start-up and says when the --in design’s folder was left out; --allow-path adds it back.

Paths are resolved before they are compared, so .. and symlinks that lead out are refused (saving through a link writes the file it points to, so the link’s target is what counts), and a new file must go into a folder that exists (a missing folder inside an allowed one is reported as missing; it is not created and does not call for a wider --allow-path). On Windows a path must be on a local drive (C:\… or \\?\C:\…): UNC, device and NT paths in any spelling (\\server\share, //server/share, \\?\UNC\…, \??\…, \\.\…), drive-relative paths (C:file), a : in a file name (alternate data streams), reserved device names with any extension (NUL, CON, COM1.txt, …) and short 8.3 names (PROGRA~1) are refused before any file system call, and the resolved path is checked again, so a link or junction that leads to a share is refused too. This includes a sketch.text font given as a file path and the font file a design’s text names when the design is opened; installed fonts named by family still work. The server spells its own folders (scratch, recovery) with long names, so they work when the temporary folder’s path has a short name (…\NAME~1.XYZ\AppData\Local\Temp, as Windows often gives when the user folder’s name is long). A refused path is a tool error saying why.

A KiCad board’s component models are read from the board’s folder (in reach, because the agent opened the board there) and from KiCad’s own 3D model library on this machine: the installed 3dmodels folder, and the folders the shell’s and KiCad’s own KICAD<n>_3DMODEL_DIR and KISYS3DMOD variables name. Nothing else outside the agent’s folders opens that way: only model files (.wrl, .wrz, .step, .stp, .stpz) inside those folders, with links and .. resolved first. A model in any other folder is refused with the folder named in the board’s warnings; add it with --allow-path.

A hard link inside an allowed folder can’t be told apart from an ordinary file, so a hard link to a file elsewhere is reachable through it; don’t keep such links in a folder you allow.

solidcraft-cli mcp --allow-path ~/designs --allow-path ~/exports
solidcraft-cli mcp --allow-any-path   # no limit (the behaviour before this option existed)

When a save (or any other call) is refused with … outside the folders this agent may use …, add the folder to the server’s args in your MCP client’s configuration (the mcpServers entries below, or what solidcraft-cli mcp setup wrote), for example "args": ["mcp", "--allow-path", "/Users/NAME/Documents/Designs"], and restart the client. An agent should ask you to do that rather than save through the app’s control port, which knows nothing of these folders.

Bridged, the server sends its folders with every request (allow_paths, and the folders the agent opened or saved a design in as design_folders, see control-protocol.md) and the app adds its own recovery folder and the folder of the design open in it, under the same rules, so give absolute paths: a relative one resolves against the app’s working folder, not the server’s. The app’s own file dialogs are never limited.

Compact output

Compact output is for agents that pay for every byte. It is off by default, and then every tool behaves as described below. Any one of these turns it on:

  • Preferences › AI › Agents through MCP › Compact output in the app, for every server bridged to it (--connect, and the agents its chat starts). The server asks the app (mcp.options on the control channel) when the agent first lists or calls a tool, and keeps the answer for the session, so the tools it listed keep their shape: a change applies to agent sessions started after it. An app that is not running yet is asked again on the next call.
  • solidcraft-cli mcp --compact.
  • The environment variable SOLIDCRAFT_MCP_COMPACT=1 (true, yes and on work too; 0, false, no, off or empty leave it off; any other value is an error at start-up).

The command line can only turn it on: with the preference on, a server started without --compact is compact too. With it on:

  • inspect_design summarises each sketch (id, name, plane, the number of points, curves, constraints and profiles, dof, status, visible) instead of returning its contents: a sketch of 720 points is some 4 KB in the summary and over 80 KB in full. sketches takes a list of sketch names or ids to return in full (as execute sketch.inspect gives them), true for all of them, or false / "summary" (the default). bodies (a list of names) keeps only those bodies and measures only them; "names" and false work as without compact output. An unknown sketch or body name is an error that lists the names there are.
  • Tool results that are JSON are compact, not pretty-printed.
solidcraft-cli mcp --connect 127.0.0.1:7878 --compact
SOLIDCRAFT_MCP_COMPACT=1 solidcraft-cli mcp --connect 127.0.0.1:7878

Core tools

solidcraft-cli mcp lists eight tools: find_commands and call_command, which reach every command, and batch, measure, inspect_design, body_topology, skill_reference and pending. Every other tool (execute, list_commands, save, screenshot, …) still answers when a client calls it by name, and --all-tools (or SOLIDCRAFT_MCP_ALL_TOOLS=1) lists them all, with the instructions that speak of them. An agent pays for the tool list and the instructions on every request, and most of the tools it never calls. Measured with Claude Sonnet 5.5 in Claude Code, the core listing and its instructions cost about 6,800 tokens against 18,900 for the full one.

solidcraft-cli mcp --all-tools
  • find_commands {query, limit?, detail?} ranks the commands by the query’s words (in the id most, then the label, the toolbar tab and panel, the parameter notes) and gives the best five (limit, at most 25): {matches: [{id, label, planned?, input, types, doc}], total}. input is the command’s parameters as a signature read from its schema, such as {height: LengthExpr, length: LengthExpr, width: LengthExpr, corner?: PointExpr3, ...} (? is optional, a|b the choices, T[] a list), and types spells out each named type once ("LengthExpr": "num | str"). doc is the first 400 characters of the parameter notes, all of them with detail: true.
  • call_command {id, params?} checks params against the command’s schema, as --param-check strict does, and refuses a mismatch naming the field, without running anything. Otherwise it runs the command as execute does with verbose: false. It is a batch step too ({"command": "call_command", "params": {"id", "params"}}). It goes through the same path as execute: the same folders, the same in-app permission prompts.

Structured results

solidcraft-cli mcp --structured is for programs that call the tools, such as a Python client, rather than for chat clients. Every tool result then also carries its reply as data, in MCP’s structuredContent:

{"result": <the reply as JSON, or its text when the reply is a message>, "notes": ["<a notice>", "<the selection>"]}

result is read from the first text block, the one the tool itself returns; notes holds the text blocks the server adds after it and is left out when there are none. An image result keeps its image block, and its text block is the result. An error keeps isError: true, and keys an error already carries (panel_error, plugin_error) stay. The text blocks are unchanged, so the same tools, current and future, reach a program and an agent alike.

It is off by default, and only the command line turns it on: some chat clients show the model both the text and the structured copy, which would double what it reads.

Desktop app management

External MCP clients connected to the desktop app can also use:

  • documents {} lists tabs. action: "switch" selects index; "close" closes it (the active tab if omitted); "new" opens an empty design.
  • quit_app {} exits cleanly, avoiding crash recovery on the next launch.
  • preferences {} reads the display and unit preferences: default_units, theme, language, up_axis, ui_scale, zoom_to_cursor, smooth_wheel_zoom and show_frame_rate. Named keys set them and return the updated values.
  • agent_cursor {} reads cursor settings; show, speed (1–5 or "instant"), and follow_camera change them.

Closing or quitting with unsaved changes is refused and names the designs unless force: true explicitly discards them, including their recovery copies. These calls never open dialogs. preferences refuses every other key before changing any settings, so an AI client cannot change plugin access, graphics, file limits, signing or file paths, or use the interactive open, button and stand_up actions. Headless servers return an error saying they need the desktop app. Confined clients cannot start persistent theme_follow reads; use inline theme_import instead. These tools cannot be used as batch steps or wrapped in execute. The in-app Assistant does not offer them: its permission gate excludes app management.

Delegating to the per-tab Assistant

A harness can hand small local CAD work to the desktop app’s built-in Assistant (one conversation per design tab) and read back what it did. Six tools, for external clients connected to the desktop app only:

  • assistant_list {} lists the tabs this client may use, each with document (the design’s id), tab_id, title, path, active, connected, running, queued, waiting_approvals_count, revision and shared_session. A tab whose design lies outside the server’s folders (--allow-path) is not listed.
  • assistant_read {document?, since?, limit?, summary_only?, include_model_summary?} returns the tab’s state, a page of its transcript (items with their monotonic index; next is the since of the next page; truncated is true when items ahead of since were evicted from the transcript buffer; without since the newest limit), changes (the summary of each turn’s changes), waiting_approvals, failures (failed tool calls and error notices, with command, params, error, document_id and revision) and feature_errors (the features that fail to build now). Pass summary_only: true to return only the latest assistant reply, error notices and pending approvals in items (skipping intermediate tool-call noise). Pass include_model_summary: true to include a compact model snapshot (document_revision, bodies_count, features_count, failed_features). document is a document id, tab id, path or title; the active tab when left out.
  • assistant_send {prompt, document?} sends a prompt as if it had been typed in that tab’s Assistant: it starts at once when the Assistant is ready, queues behind a running turn, and starts the agent first when it is not running. It returns at once with a status; wait for completion with assistant_wait or read the outcome with assistant_read. A lost reply is never sent again by the server, so read the conversation before sending twice.
  • assistant_stop {document?} stops the running turn, as the Stop button does. A lost reply is never sent again by the server so a stale stop cannot cancel a later turn.
  • assistant_reset {document?, agent?} stops any running turn, declines pending approvals and clears the tab’s conversation to a fresh zero-context session (leaving the person’s unsent composer draft and the design geometry/undo history untouched), and optionally switches the tab’s agent profile by id or display name (refusing unknown names with the available list). A lost reply is never sent again by the server.
  • assistant_wait {document?, documents?, since?, timeout_ms?, limit?, summary_only?, include_model_summary?} waits without polling until the watched Assistant tab(s) settle (idle, failed, exited, sign-in required, or paused awaiting approval), emit items past since, close, or timeout_ms elapses (0 to 120000 ms, default 30000). Single-tab returns the assistant_read snapshot (automatically including model when settled, or whenever include_model_summary: true) plus timed_out, closed and awaiting_approval; multi-tab (documents, 1 to 64 tabs, mutually exclusive with document and since) returns {timed_out, shared_session, tabs} as soon as any watched tab settles, asks for approval or closes.

assistant_read returns the conversation as the Assistant had it, including its tool inputs and outputs, which may name files the Assistant reached with its own permissions rather than this client’s folders; only tabs outside the client’s folders are filtered, not what a visible tab’s history says.

Approvals stay with the person: there is no tool to answer an Assistant’s question, and what the Assistant’s permission mode (Ask, Edits or All, or the organization’s policy) asks about waits in the window. Sending leaves the person’s message box, picks and attachments alone, and is refused while they have messages waiting in that Assistant, while it needs a sign-in, and for a tab other than the active one when Preferences › Keep one chat across design tabs is on. The tools are not offered to the in-app Assistant, which cannot prompt itself, and are not batch steps. Headless servers return an error saying they need the desktop app.

Tool annotations

Each tool says what it may do, for clients that ask before running tools (or auto-approve on these hints). list_commands, describe_command, find_commands, inspect_design, measure, body_topology, skill_reference, crash_reports, assistant_list, assistant_read, assistant_wait, pending and running are read-only. assistant_send, assistant_stop and assistant_reset change the app (not read-only, not destructive). set_parameter, undo and redo change the design undoably, and so does check_parameters (it changes the design and puts it back: not read-only, not destructive). new_design replaces it (destructive). documents and quit_app are also destructive because forced closes can discard unsaved work. preferences and agent_cursor change app settings (not read-only, not destructive). execute, call_command, batch, open, save, export, screenshot (whose path writes a file) and compare_picture (which reads the reference picture) can read, write, overwrite or delete files: they are not read-only, destructiveHint and openWorldHint are true.

cancel changes the design only by keeping a change from landing; it touches no files.

Client configuration

solidcraft-cli is on PATH after every package install: the Windows installer adds its folder, the deb, rpm and FreeBSD packages install it in /usr/bin, the Homebrew cask links it, the AppImage writes a small solidcraft-cli launcher into ~/.local/bin on its first run, and the macOS app links it into /opt/homebrew/bin or /usr/local/bin when it starts (Help > Install solidcraft-cli command does it with an administrator prompt when those are not writable). Two packages keep it out of PATH by design: Snap exposes it as solidcraft.cli, and Flatpak runs it as flatpak run --command=solidcraft-cli io.tangencylabs.solidcraft; use those as the client’s command (with mcp as the arguments).

The quickest way: Help > Connect AI assistants… in the app, or

solidcraft-cli mcp setup            # every client found on this computer
solidcraft-cli mcp setup --dry-run  # show what it would write, change nothing
solidcraft-cli mcp setup --client opencode --live

(mcp install is the same.) It adds a solidcraft server, using the full path of the solidcraft-cli that runs it, so nothing has to be on PATH. A client counts as installed when its configuration folder exists, and no client program is started. Supported:

--clientConfiguration file
opencode~/.config/opencode/opencode.json (or .jsonc)
claude-desktop%APPDATA%\Claude\claude_desktop_config.json, ~/Library/Application Support/Claude/, ~/.config/Claude/, and the Microsoft Store package’s folders (%LOCALAPPDATA%\Packages\Claude_…\LocalCache\Roaming\Claude and %LOCALAPPDATA%\Claude-Data\claude_…)
claude-code~/.claude.json (user scope mcpServers)
cursor~/.cursor/mcp.json
codex$CODEX_HOME or ~/.codex, config.toml (CLI, IDE extension and desktop app)
gemini~/.gemini/settings.json
copilot~/.copilot/mcp-config.json (GitHub Copilot CLI)
windsurf~/.codeium/windsurf/mcp_config.json
zedZed’s settings.json (context_servers)
vscodeVS Code’s user mcp.json

Only the solidcraft entries change; everything else in the file (other servers, comments, order) stays as it was. Updates replace the file atomically and keep the previous version as <name>.bak. A failed write leaves the configuration intact. A file that does not parse is left alone. Setup also checks for changes since it read the file and refuses a stale edit. This check narrows the race with another program writing its settings; it cannot exclude a write after the check. After an update moves the program, running setup again only refreshes the path of an entry it wrote. An entry you changed (extra arguments, another program) is left as you have it. --live also adds solidcraft-live, which bridges to the open app (port 7878, see below). Restart the client afterwards.

SolidCraft also does this by itself: when the app starts it adds the solidcraft entry to each installed client (and refreshes its path after an update), and says once which clients it connected. It never touches an entry you changed. Settings > Assistant > Make SolidCraft available to AI apps on this computer turns it off, which removes the entries it added. Runs with --control or SOLIDCRAFT_CONTROL_PORT (automation) leave your clients alone.

To configure a client by hand instead, these are the entries. OpenCode (opencode.json):

{
  "mcp": {
    "solidcraft": { "type": "local", "command": ["/path/to/solidcraft-cli", "mcp"], "enabled": true }
  }
}

Claude Code (project .mcp.json, or claude mcp add solidcraft -- solidcraft-cli mcp; a setup added under the previous name keeps working, see the compatibility notes):

{
  "mcpServers": {
    "solidcraft": { "command": "solidcraft-cli", "args": ["mcp"] }
  }
}

If a terminal doesn’t find solidcraft-cli (older Windows installers don’t put its folder on PATH; see below for where it is), give its full path (by default C:\Program Files\SolidCraft\solidcraft-cli.exe): claude mcp add solidcraft -- "C:\Program Files\SolidCraft\solidcraft-cli.exe" mcp.

Claude Desktop (claude_desktop_config.json), bridged to a running app:

{
  "mcpServers": {
    "solidcraft": { "command": "/path/to/solidcraft-cli", "args": ["mcp", "--connect", "127.0.0.1:7878"] }
  }
}

On Windows the installer puts solidcraft-cli.exe next to solidcraft.exe in C:\Program Files\SolidCraft (the portable zip has both too). Give the full path, with each backslash doubled in JSON. This configuration declares two servers: solidcraft models headless (no window; steadier for timings), solidcraft-live drives the app you have open, so you can watch the agent model. --allow-path names a folder where the agent may save and export; it must already exist.

{
  "mcpServers": {
    "solidcraft": {
      "command": "C:\\Program Files\\SolidCraft\\solidcraft-cli.exe",
      "args": ["mcp", "--allow-path", "C:\\Users\\NAME\\SolidCraft-Agent"]
    },
    "solidcraft-live": {
      "command": "C:\\Program Files\\SolidCraft\\solidcraft-cli.exe",
      "args": ["mcp", "--connect", "127.0.0.1:7878", "--allow-path", "C:\\Users\\NAME\\SolidCraft-Agent"]
    }
  }
}

Start the app with its control channel for solidcraft-live, from PowerShell: & "C:\Program Files\SolidCraft\solidcraft.exe" --control 7878, or once for every launch: setx SOLIDCRAFT_CONTROL_PORT 7878.

Open claude_desktop_config.json with Claude Desktop’s Settings > Developer > Edit Config rather than by its path: the Microsoft Store (MSIX) build of Claude Desktop can keep its data in its own folders (%LOCALAPPDATA%\Claude-Data\claude_…, or in older versions %LOCALAPPDATA%\Packages\…\LocalCache\Roaming\Claude) instead of %APPDATA%\Claude, and Edit Config opens the file the app actually reads. mcp setup writes to each of these that exists. Quit Claude Desktop completely (from the notification area) and start it again to load the servers.

Agent skills

skills/ holds six Agent Skills for agents that model through this server:

  • solidcraft-modeling covers building a new part.
  • solidcraft-sheetmetal covers sheet-metal parts: base, edge and contour flanges, segments, hems, fold/unfold, flat patterns, DXF export, and bend tables.
  • solidcraft-editing covers changing an existing design.
  • solidcraft-checking adds checks for errors SolidCraft does not report, regression tests and porting, next to the other two.
  • solidcraft-mechanisms covers assemblies: joints placed by world coordinates, motion links, closed loops such as actuators, contact sets and motion studies, checked against analytic values.
  • solidcraft-reporting turns a problem the user hit into a bug report: it reproduces it in a fresh design, shrinks it to a minimal command script, checks the numbers with measure and a screenshot, and searches existing issues first.

They cover the workflow, the command shapes, how to verify with measure, and the known traps. With them an agent builds a part in a few batch calls and reads far less output. To install them for Claude Code, copy the folders into ~/.claude/skills/; skills/README.md has the details.

The skill_reference tool returns all six skills from the copies built into SolidCraft, so an agent without file access can follow them: {"skill": "solidcraft-modeling"} returns its reference.md (or SKILL.md for skills without reference.md). solidcraft-modeling, solidcraft-mechanisms, and solidcraft-sheetmetal include reference.md, solidcraft-checking includes reference/porting.md, solidcraft-reporting includes reference/report-template.md, and every skill includes SKILL.md (editing uses modeling’s reference). It never reads a path from disk, and an unknown skill or file is refused with the available choices. SolidCraft’s own chat turns the agent’s file tools off, so this is how its agent reads the skills there. The instructions the server sends at initialize point agents at skill_reference first, then say how to plan the numbers, build in a few batch calls and verify each stage with measure; the same pointer is in the system note SolidCraft’s own chat gives its agent.

Tools

ToolArgumentsWhat it does
versionnoneThe SolidCraft build answering the call: {version, commit, mode}. Connected sessions report the app’s version and commit with mode: "app"; headless sessions report their own build with mode: "headless". commit is "unknown" when unavailable, including builds without Git. This reads metadata without opening Help or returning diagnostics. Call it on its own, outside a batch.
list_commandsfilter?, prefix?, panel?, compact?, fields?, limit?, offset?The command catalog: id, label, tab/panel, shortcut, parameter docs, enabled now. filter matches id, label, tab and panel. prefix keeps the ids that start with it ("sketch.") and panel the commands of one whole toolbar panel or tab ("Modify"), both ignoring case. compact: true keeps only id and label of each entry, about an eighth of the size; fields keeps the keys it lists instead. limit and offset page the matches, and the reply becomes {commands, total, offset, next_offset} (next_offset is null on the last page). With none of these the reply is the whole catalog, about 350 KB.
describe_commandidOne command’s parameter docs (params) and, for commands with a typed contract (every new command, and more of the older ones as they are converted), the JSON Schemas (2020-12) of its parameters (input) and of a successful result (output); null for the others. The same as execute engine.describe {command}.
find_commandsquery, limit? (default 5, at most 25), detail?The commands that best match the query’s words, each with its parameters as a short signature (see Core tools).
call_commandid, params?Run any command, its params checked against its schema first; a mismatch is refused naming the field and nothing runs.
executecommand, params?, verbose? (default true), expect?Run any command with JSON parameters (list_commands shows them). Failures leave the design unchanged. A feature command replies with the feature (feature, name), every body (bodies) and the bodies it created, changed and removed (created_bodies, changed_bodies, removed_bodies). verbose: false uses the same compact reply as batch. expect checks the design after the command, as it does for batch (see below).
batchcommands: [{command, params}] or path (a script file, see below), rollback? (default true), dry_run? (default false), report? (default false), verbose? (default true), timings?, profile?, coalesce_parameters? (default false), expect?Run steps in order, stop at the first error and undo the completed steps. The reply names the failing step (failed.index, failed.command, failed.error), every result before it, rolled_back (true only when a rollback was asked for and the design is where the batch started: its completed steps were undone, or nothing ran; false when rollback: false or when the design could not go back), undone, applied (the indices of the steps whose changes are in the design) and not_run (the steps never sent). Steps can all go through and still leave a feature failing: a parameters.change that makes an earlier feature fail goes through and lists the feature only in its own errors (#24349). The reply then adds failing ([{id, name, type, error, new_feature}]: the features that fail after the batch and did not fail before it, or did not exist), and the tool result is flagged isError: true with a first text block that names them, as an unmet expect is. The design stays as built (a dry run is rolled back as ever). An app that runs the whole batch in one request names them itself (an app from before this change does not); step by step, the server reads every feature’s error (document.inspect, nothing measured) before the first step and after the last. A batch with a step that can open, start or switch to another design (open, new_design, file.import, doc.recover, a tab change), or a command this server does not know (a newer app’s, sent step by step with rollback: false), reports no failing: the features at its end may belong to another design. With dry_run: true, every step runs normally (so measure, inspect.clearance, inspect.interference and other inspection steps see the simulated edits, and expect checks the simulated result before rollback) and then all document, model and undo/redo history changes are unconditionally rolled back via edit.checkpoint / edit.restore_checkpoint, leaving zero undo entry behind and adding dry_run: true and rolled_back: true to the reply (works both headless and bridged to the desktop app). Disk-writing and external commands (save, export, file.save*, file.export*, file.send_to_slicer, file.open_in_easyprint, render.start/render.export, plugin.*, parameters.export/timeline.export_script/assembly.bom with a path, and similar), application layout commands (panel.*/layout.*), edit.restore_checkpoint and rollback: false are refused before any step runs. If the checkpoint cannot be restored after a dry run, the call fails loudly with dry_run: true, rolled_back: false and restore_error. A step may name a tool instead of a command, with that tool’s arguments as params: set_parameter (runs parameters.change; value or expression), list_commands (engine.commands, narrowed by its arguments as the tool narrows it), describe_command (engine.describe), execute ({command, params}), measure (summary: true summarised as the tool summarises it), compare_picture (inspect.compare_picture, numbers only: no overlay PNG), inspect_design (document.inspect with its measure, timeline and bodies: each sketch as its counts, not its full contents, and no joints), undo, redo, export, save, open, new_design and crash_reports. screenshot, body_topology (use model.edges and model.faces), batch, check_parameters, pending, running and skill_reference can’t be steps, nor can component.edit_in_place and component.finish_edit, however a step names them. Run those two commands on their own. A desktop rollback batch stays within one design tab. It refuses document.activate, view.next_tab, view.previous_tab, file.import, doc.open (including the open tool with or without new_tab: true), and file.new with new_tab: true (including the new_design tool) before any steps run. Run these commands separately or use rollback: false to keep completed steps. A headless session or an app that receives the whole batch checks for missing or unknown command IDs before the first step (#5853). The MCP server also checks IDs before sending desktop steps one by one with rollback enabled. With rollback: false on that path, a command the app does not recognize stops the batch at its turn, and earlier steps stay applied. With --param-check strict, parameters that break a command’s contract also fail preflight. A bridged server checks those contracts before it sends the batch. verbose: false keeps the reply small in large designs: feature steps leave out the full body list (created_bodies, changed_bodies, removed_bodies stay) and sketch steps the ids they repeat outside created. Bridged to an app that has engine.batch, the whole batch is one control request (one frame of the app). Older apps, and apps showing the agent cursor, get the steps one by one. timings: true adds timings: [{index, command, ms}] for every step run, the failing one included, and total_ms. profile: true also adds each step’s profile: {boolean_ms, tessellate_ms, other_ms}, its time in kernel booleans, in tessellation and the rest. Steps are timed where they run: in the app when bridged. An app without engine.batch is timed step by step, without profile. coalesce_parameters: true sets each run of consecutive plain parameter edits (parameters.change or set_parameter with a name and a value, or changes) together, so the design rebuilds once per run instead of once per edit. Steps between runs see the design up to date. Each step keeps its own result (coalesced: the run’s length), and the run is one undo step. The run skips the states between its edits, so an edit refused on its own can go through with the run’s later ones. A refused run goes step by step, naming the refused step. report: true adds report to a reply that went through (with dry_run: true too: it is built from the simulated design before the rollback): bodies {before, after, added, removed, renamed ([{from, to, via: feature|geometry}]), changed} where each changed body lists only the figures that moved, as {before, after, delta}: volume_mm3, mass_g, area_mm2, center_of_mass (with distance_mm), bbox, faces; turned_or_mirrored: true marks a body whose volume, area and face count are unchanged and whose inertia tensor about its centre of mass (component.properties of the root) keeps its invariants (trace, sum of principal 2 x 2 minors, determinant; relative 1e-6, the tensor comes from the mesh) while the tensor moved clearly (an entry by at least 1e-4 of the trace) or the centre of mass seen from the box’s middle changed in the way a turn or mirror of the box onto itself changes it (same box sizes, same offset sizes). Second moments cannot tell a mirror from a turn, and a body symmetric under the turn or mirror is not caught; material moved inside a body (a hole a parameter shifts) is not flagged unless it happens to look like a turn or mirror of the box; a mirrored curved body may tessellate differently, so a flip can be missed, never falsely flagged; a placed copy, whose name is shared, is left unflagged. A name made by another feature is reported as one body removed and one added, not as changed. features and joints each give newly_in_error ([{id, name, type, error, new_feature}] for features, [{kind: conflict|error, joint, name, why}] for joints), no_longer_in_error and reason_changed ([{.., before, after}], still in error for another reason); tolerance; changed (any difference); unavailable names a part that could not be read (a missing app stops the reads at the first). Placed copies share the feature ids of the bodies they show, so a rename found via: feature can pair a copy with the wrong body, and via: geometry may be a body deleted and an identical one created. Volumes, masses and areas are equal within a relative 1e-9 (absolute floor 1e-9), lengths within 1e-9 of the body’s largest coordinate. It costs one measure and one component.properties of every body before the steps and one after (the second pass is skipped when document.inspect’s revision did not move), and nothing when report is false or absent: the reply is then unchanged.

Plugin tools. After the built-in tools, tools/list lists every installed, enabled plugin’s entries as tools named <plugin>.<entry>, read afresh at each listing: a command entry with its declared inputs as arguments, and an importer as “Open .ext files with Plugin name” with path and options. Each has a plugin field ({id, name, version, entry, kind, effect}), and the plugin’s own description reaches the agent between <plugin-text> markers, as plugin text. A call runs without the plugin’s dialogs, under its existing grants, as one undo step; arguments are checked as strictly as a command’s; a missing grant or a read entry’s refused import is an error naming it, also as structuredContent.plugin_error. For revision-aware edits, use execute with the namespaced command’s expected_design precondition (design revisions). See Plugins as tools for agents.

Ordinary tool calls do not query plugin tools. A bridge queries plugin.tools only when the app advertises plugin_tools: true in control.capabilities; older apps keep their built-in tools without a plugin query. Plugin listings and plugin calls read the entries afresh.

The selection goes with every tool reply (but running and pending, which only report on an earlier request, and a reply that says a request is still running): when the user has something selected, the reply ends with one more text block, [Selected in SolidCraft right now: N item(s). ...], in the format the chat’s Attach selection sends (faces and edges with the names and indices the tools take, features and bodies by name, at most 64 items and the rest counted). Nothing is added when nothing is selected. The server reads it with the app’s document.selection; an app from before it adds nothing.

expect on batch and execute turns the verify step into part of the build. An agent computes the volume, body count or bounding box a stage should produce before building it; instead of a measure call and a comparison by hand after every stage, it gives them to the call: "expect": {"volume_mm3": 59824.9, "tol": 0.002, "bodies": 1, "bbox": {"min": [0, 0, 0], "max": [140, 90, 30]}}. Every key is optional (at least one of volume_mm3, bodies and bbox); tol is relative to the expected volume (default 0.002, so 0.2 %), and each bounding-box coordinate must lie within 0.05 mm. Once the call has gone through, the server measures the design the way measure does (the total volume of the closed bodies, the body count and the box round every body) and the reply gains "expectation": {"ok": bool, "measured": {"volume_mm3", "bodies", "bbox"}, "expected": {...}, "mismatch": ["volume: measured 59680, expected 59824.9 (-0.24 %)", ...]}. On a mismatch the tool result is flagged isError: true, with the mismatch text as its first content block and the reply as the second, so the model notices; the design is kept as built (undoably, as ever), and the agent decides whether to undo, edit a feature (timeline.edit) or carry on. A batch that fails is not measured, and an expect the tool cannot use (an unknown key, a value of the wrong type, a negative tol, a bbox without three coordinates a side) is refused before anything runs. expect is an argument of the tool, not a key of a step: a step carrying one is treated as any step with a key the batch does not know. Volume and body count say nothing about which kernel built the design, which is the point: the check holds whatever builds it. | inspect_design | measure? (default true), sketches? (default true), joints? (true: the default, every joint; "summary": every joint but the rigid joints holding an imported assembly’s contents, which joint_summary counts; false: no joints), timeline? (true: the default; "summary": each feature as id, name and type, with error, warning, suppressed and rolled_back only when it has them; false: no timeline), bodies? (true: the default; "names": only the body names, nothing measured; false: no bodies); with compact output sketches? (names or ids, true, or false / "summary": the default) and bodies? also takes a list of names | On a design of hundreds of features and bodies, timeline: "summary" and bodies: "names" (or false) keep the reply small enough for an agent’s tool output. Design properties (metadata: project, author… and other tools’ keys; set them with execute document.metadata.set), parameters, timeline (type, suppressed, rolled back, error, warning, timing), bodies (volume, area, centre of mass, bbox, face/edge/vertex counts, visible; removed_later: true while a sketch is being edited on a rolled-back timeline and a later feature deletes the body, which is then not shown), sketches (curves, points, constraints, profiles, DOF, solve status, visible), joints when the design has any (as joint.inspect gives them: each origin’s occurrence, component and path, the snap as saved, the feature, face, edge or sketch curve (sketch: {id, name, curve}) its persistent names refer to, resolves and the error when it is lost; kind, offset, angle, flip, values, limits, expressions, motion links; execute joint.inspect {joint} gives one joint; with joints: "summary" the rigid joints that hold an imported assembly’s contents together, one per placement, are left out, and joint_summary (joints, by_type, suppressed, rigid_groups: [{component, name, joints, members}], the 20 largest, and more_rigid_groups: {groups, joints} counting the rest) counts them instead, or, when it can’t be had, is {omitted, error}: what was left out and why: execute joint.list with exclude_rigid_groups, moving_only, kinds, occurrences or dof_free_only narrows the full list the same way), selection, undo depth. Hide helper sketches, bodies or construction planes with execute browser.visibility ({items, visible} or {folder, visible}), and joint glyphs with {joints: [id or name], visible} or {folder: "joints", visible} (a hidden joint still constrains and drives; joint.list reports each joint’s visible). | | measure | body? or items?, summary? (default false), within?: {min, max}, mode?: intersects (default) or inside | Area (mm²), bbox, topology counts and closed per body. Volume (mm³), volume centre of mass, density and mass are reported only for closed, consistently oriented bodies (null or omitted for open surfaces). Volume/mass totals skip open bodies; total.open_bodies_skipped gives their count. A body that could not be measured at all is left out of every total and named, with the reason, in unmeasured_bodies and a warning (both omitted when every body measures). Area and topology totals include all successfully measured bodies. With items (one or two selections as execute takes them: face, edge, vertex, sketch_curve, profile; or 3 to 64 round edges or cylinder faces, for their spacing), the picked geometry instead: faces and edges need only type, body and either point or index (from model.faces / model.edges). See below. summary: true keeps one short object per body (name, volume_mm3, bbox: {min, max}, faces, closed; a body that could not be measured keeps its error), body_count and total.volume_mm3, nothing else: what a stage check against computed numbers needs, at a fraction of the size. It applies to the bodies reply, not to items. With within, measure only bodies whose world-coordinate bounding boxes overlap or touch the specified box (mm); mode: "inside" requires complete containment. Totals cover only matching bodies. | | body_topology | body, faces? (all, cylinders; default all), face_normal?: [x,y,z], edges?: {min_length?, max_length?} | Edges (index, midpoint, length, ends) and faces (index, name, area, centroid, normal, point, and for a cylindrical face its cylinder: origin, axis, radius; surface_type: plane, cylinder, cone, sphere, torus, spline or other, as the kernel recognises the face; for a cone, sphere or torus face its cone: apex, axis, half_angle_deg, its sphere: center, radius, or its torus: center, axis, major, minor). An edge midpoint is the [x,y,z] that picks that edge for fillet and chamfer. A face’s point lies on it and picks it (its centroid may not: that of a face with a hole is in the hole); a face’s name picks it for the commands that take faces (face.delete, solid.shell, solid.draft, solid.offset_face, solid.split_face, solid.replace_face, and face of sheet.convert). faces: "cylinders" replies cylinders instead of edges and faces: one entry per cylinder, {radius, origin, axis, extent, names}, the halves the kernel splits a cylinder into merged (same radius, same axis line; origin and axis as the first half’s cylinder gives them), extent the [min, max] distance along axis from origin that the body’s points on the cylinder span (the faces’ points and the ends of the edges lying on it; left out when none were found), and names the merged faces’ names, any of which picks the face. Enough to check where every hole and boss is, in a few lines instead of the whole topology. face_normal returns only planar faces with the given outward direction (instead of faces). The edge filter returns only edges in the inclusive length range (mm). Use both filters together, or either alone to omit the other kind of geometry. | | set_parameter | name, value or expression (number or expression), unit?, comment? | Create or change a user parameter and recompute. expression is another name for value (the one parameters.change uses): give one of them, or both only when they agree; neither, or two that differ, is an error. Reports recomputed (features rebuilt), restored (features whose earlier result for the same inputs was reused, e.g. a value set back) and features that now fail. An expression new_name = expression renames the parameter as it sets it; in any other tool’s expression parameter it adds the user parameter new_name and the input uses it (defined, definitions in the reply). | | check_parameters | set: {name: value} (a number or an expression each, as set_parameter’s value), report? (measure, cylinders, errors; default all three), bodies? (a list of body names: only those are measured and their cylinders listed; default all), summary? (measure as the measure tool’s summary: true; default false) | Try parameter values without keeping them: one edit.checkpoint, every value set in one parameters.change {changes} (one rebuild; an app without changes gets one change per name), the reports read, then edit.restore_checkpoint, so the design, its parameters and its undo history are exactly as before. The reply has values (each parameter’s value with the tried expressions in), recomputed, measure (volume, bbox, bodies and faces per body, as the measure tool reports them), errors and warnings (the features that fail or warn: {feature, name, error}) with parameter_errors (the parameters that don’t evaluate), cylinders (every cylindrical face of every body as {body, radius, origin, axis, faces, name, area}; the halves a kernel splits one cylinder into are one entry, origin is the axis point closest to the world origin and axis points so that its first non-zero component is positive) and restored: true. On a large design, bodies with the bodies a change touches and summary: true keep the reply small. A name the design has no parameter of, a value that is not a number or a string, an expression that does not evaluate, an unknown report item or a bodies that is not a list of names is an error, and nothing changes; a body name the design does not have after the change is an error after the design is put back. If the checkpoint cannot be restored the call is an error with restored: false, restore_error and a note that the tried values are still in the design: set them back before saving. Replaces the loop set_parameter, measure, body_topology, set_parameter back, which cost every agent session three to five calls and up to 16 s of rebuilds. Not a batch step. | | screenshot | view? (iso, top, front, back, bottom, left, right, home, fit, or a named view saved with view.save), camera? ({target, yaw, pitch, distance, fov?}, as view.apply), path?, width?, height?, source? (window, model), grid?, axes? | A PNG image content block. Headless: a render with the viewport’s pipelines on a headless GPU device (see solidcraft-cli gpu; with no adapter, the CPU rasterizer, without analysis colours), fitted to the model, or from the named view or camera; the reply’s renderer says which (gpu, gpu-software, cpu, with a warning for cpu). Bridged: the app window (default) or a model render with the app’s camera; a named view or camera moves the app’s viewport there first (execute view.apply does the same without a screenshot). grid: false and axes: false leave the ground grid (it lies on Z 0 and cuts through a part that straddles it) and the origin’s axes out of a model render; axes hidden with browser.visibility stay out whatever axes says. Bridged, a screenshot that gives grid or axes is a model render, which follows the app’s Grid and Origin switches for what it does not give; source: "window" with either is an error. A window that is minimised or on another macOS Space presents no frame: with no source the reply is a model render and says so (fallback); source: "window" is an error saying why, at once. Agents that don’t need the app’s chrome can ask for source: "model". | | compare_picture | reference, view?, camera?, bodies?, crop_px?, crop_fraction?, part_fills_crop?, fit? (width, height, both; default width), rows? | Compare the model’s outline with the part in a reference picture (a PNG or JPEG inside the server’s folders, read through the same path rules as screenshot). A JPEG’s EXIF orientation is applied, so a phone photo is measured as every viewer shows it (#19138). The compare is outline only: holes are not compared — both the picture’s and the model’s holes are filled. The model’s outline is inspect.silhouette seen from view (default front) or camera; the picture’s part is found by growing the background in from the border through small colour steps, filling holes and keeping the largest piece, so a backdrop’s shading stays background and labels on a board drop out; a part touching the border, a white part on a light grey backdrop, and a part on a transparent background all separate. crop_px ([x, y, w, h] in pixels) or crop_fraction (the same as fractions 0..1) takes one view off a board; with part_fills_crop: true the crop box is the part itself and no background search runs, for a crop that tightly frames the part; fit names the dimension the one uniform scale comes from, never stretched per axis (both scales by width and reports aspect_mismatch). Returns an image content block (the overlay PNG: model red, picture blue) and text: overlap (0..1) and the model’s top, bottom, left and right edges against the picture’s in mm at nine stations, positive where the model reaches past the picture, null where a station misses one of the two. As a batch step it runs inspect.compare_picture without the overlay. | | export | path, format? (step, stp, iges, igs, 3mf, 3mf-tagged, stl, stla, obj, glb, usd, usda, usdc, usdz, 3dm, urdf, mjcf, sdf), bodies?, quality? (standard, fine, finest; default standard), chord? (mm, 0.001–1000; instead of quality), writer? (STEP and IGES: solidcraft, the default, or cadmpeg), lay_on_print_faces? (STL, ASCII STL and 3MF, default false), mesh_prefix?, place_meshes?, effort?, velocity?, hierarchy?, mimic?, physics? (OpenUSD, default false), render_setup? (OpenUSD, default none), images? (URDF and OpenUSD, default false), purpose? (OpenUSD: interchange, the default, or distribution), exact_brep? (OpenUSD, default from purpose) | STEP, IGES, 3MF or mesh export; GLB writes binary glTF in metres with Y up, with each body’s colours, metallic, roughness and opacity (alpha blended when not opaque) and the Glass a render setup gives it (glTF transmission, IOR and volume), and each occurrence a named node holding its part’s bodies (hierarchy: false: every body flat in world coordinates, as 0.40 did); URDF writes the whole assembly with its meshes next to it, or where mesh_prefix points with place_meshes (docs/urdf.md), and MJCF (format: mjcf) the same assembly as a MuJoCo model (docs/mjcf.md); OpenUSD writes each body’s exact shape beside its mesh, the assembly as prims; Rhino (3dm, Rhino 8) writes each body where the design shows it, as its exact shape when every face is planar and every edge straight, else as its mesh, with warnings for what the file leaves out. OpenUSD’s physics: true also writes the joints, grounded parts and each component’s mass as physics, for a simulator. render_setup names the saved render setup whose image textures a .usdz package holds. images: true also writes the pictures shown on the model (OpenUSD: in a .usdz package only). OpenUSD’s purpose: distribution writes meshes only, with the pictures shown on the model (images then defaults to true and exact_brep to false); a given images or exact_brep overrides the purpose. writer: cadmpeg writes STEP and IGES through cadmpeg instead of SolidCraft’s own writers. lay_on_print_faces: true writes each body that has a print face (body.print_face) laid on it, as a slicer export lays it, and the reply’s print_faces names the bodies laid; other formats refuse it. | | undo, redo | — | Undo / redo one change. | | pending | — | Bridged: the result of a request that was still running when its call returned (an error starting still running:), waiting up to 60 s for it; done: false while it runs (call again), pending: null when nothing runs. See Long-running requests. | | crash_reports | id?, limit? | The crash reports on this computer, newest first; with id, the whole report (backtrace, command, recent commands, design_path/replay_path). See crash-reports.md. | | skill_reference | skill, file? (default reference.md, or SKILL.md if absent) | Read a bundled skill document. Skills: solidcraft-modeling, solidcraft-sheetmetal, solidcraft-mechanisms, solidcraft-editing, solidcraft-checking, solidcraft-reporting. | | running | - | What the app is running or has queued, for every client (control.running, see control-protocol.md): each request’s connection and id, method, command id or a batch’s step count, running_s and queued, never its parameters. Answers at once while the app is busy, also while another call from this client, such as a long batch, is still waiting for its reply: bridged, it is then asked on a connection of its own (its self marks no request) and its reply comes before that call’s. Ask it when a call timed out before sending a change again. Headless: always {"running": []}. | | new_design | name?, new_tab? | Start an empty design. With new_tab: true in the desktop app it opens in a tab of its own and becomes the active design, and the design that was open stays open; the reply names it (document_id). Every later call acts on the active design. execute document.list lists the open designs and which is active, and execute document.activate {document_id} shows one (design tabs). When document.list says start_page: true, the File / Start page covers the design: document.activate with the active design’s id brings it into view before you tell the user it is on screen. | | cancel | — | Bridged: cancel this server’s request that was still running in the app when its call returned (control.cancel, see Cancelling a request). Headless: an error, as nothing is ever left running. Not a batch step. | | open | path, new_tab?, up?, names?, geometry?, and for a KiCad board thickness?, components?, copper?, silkscreen?, color?, representation? | Open a .sc design (or a .solidcraft one from an earlier release), a STEP file (.step/.stp) as a new design holding its bodies (an Import base feature), a 3MF/STL file as mesh bodies, or a KiCad board (.kicad_pcb, or the project’s .kicad_pro) with its copper, silkscreen and component models; the KiCad options are doc.open’s own, the same as execute with doc.open takes, and the reply’s warnings name each component model that could not be read, and why. With new_tab: true in the desktop app the file opens in a tab of its own and the design that was open stays open. Unlike new_design, its reply does not name the design: execute document.revision gives the id of the design that is active, document.list shows which design is active (a person busy in a dialog or tool at the window gets the new tab behind the active one), and execute document.activate {document_id} shows it before you edit. | | save | path?, format? (container, json), overwrite? (default false) | Save the design (to its current file without path). A save over a design file that another program or computer changed since it was opened or saved is refused; overwrite: true replaces it. |

The export tool and an export step in batch take the same mesh options:

  • quality chooses standard, fine or finest (default standard). The chord tolerance is 2e-4, 5e-5 or 1e-5 of each body’s bounding-box diagonal, with a minimum of 0.001 mm.
  • chord sets one chord tolerance for every body, in mm, from 0.001 to 1000 inclusive. A coarser tolerance gives fewer triangles. For example, export {"path":"robot.urdf","chord":0.05} requests a 0.05 mm tolerance for the link meshes.

These options control meshes for STL, ASCII STL, OBJ, 3MF, 3MF-tagged, GLB, OpenUSD, Rhino, URDF and SDF. Set either quality or chord; setting both is refused. Omit the unused key. Exporter plugins do not take these options. See URDF export for link meshes and computed physical properties.

measure with items reports each item under items (length_mm, area_mm2 or position). A circle, arc, hole or other cylindrical face also gives diameter, radius, center and axis, with circumference when it goes all the way round, or arc_length and angle_deg for an arc; round says which (circle, arc, cylinder). A slot (a sketch profile of two half circles and two lines, or one half-cylinder end of a slot in a solid) gives slot: width, center_distance and overall_length. With one item these fields are repeated at the top level. With two items:

  • min (also distance_mm, with from, to and delta): the closest distance;
  • max (with max_from, max_to): the farthest distance;
  • center_distance (with center_from, center_to): when an item is round, from its centre or axis: axis to axis for parallel axes, the closest distance between the axes otherwise, and axis to plane, line or point;
  • measure: the distance the Measure panel shows first (center where there is one, else min);
  • angle_deg between two planar faces or straight edges.

With three or more items, all round (circle or arc edges, cylinder faces) and with parallel axes, as holes along a row or round a bolt circle, the reply has spacing instead, measured centre to centre in the plane through the first item’s centre square to its axis:

  • pattern: line (the centres are on one line), circle (on one circle) or none;
  • order: the items (indices into items) in order along the row, from the end item given first, or round the circle about the first item’s axis, from the first item; for none, as given;
  • gaps (with gap_points, each gap’s two centres): the distance between each neighbouring pair in order; a circle has one more, from the last back to the first;
  • span: from the first centre in order to the last;
  • even, pitch and odd_gaps: whether every gap is the same; the gap when they are, else the gap most of the others share (absent when no two are the same); and the gaps (indices into gaps) that differ from it, as where a hole is left out of a row;
  • for a circle: pcd (the pitch-circle diameter), pcd_center, angle_deg (the angle at the centre for each gap) and, when the gaps are even, angle_pitch_deg.

Items that are not all round, axes that are not parallel and two items on one centre are refused.

Earlier fields are unchanged, so older scripts keep working.

To select geometry in the view, use execute select.set with {"items":[{"type":"face","body":"Body1","point":[5,5,10]}]} (or "type":"edge"). The point is in world millimetres and uses the same proximity tolerance as Measure. An index can replace the point; the command then supplies a point on that face or edge, including curved faces and placed components. Existing selections with both fields keep their index and point. Missing geometry or an invalid partial pick leaves the entire selection unchanged, including with "add":true. inspect_design reports the completed selections with both fields.

To change a feature after it is made, read its definition with execute timeline.inspect ({feature}: id or name) and change fields with timeline.edit ({feature, set}; e.g. {"extent": {"distance": "30"}}). The fields per feature type are listed in the book’s Solid features chapter.

To observe changes without reading the whole design again, execute document.revision answers {document_id, revision}. Its numeric observation revision also follows visibility and uncaptured positions. The document identity belongs to the open document’s session; opening or importing a design creates a fresh identity, including when reopening the same file. Revision-aware plugin edits use the session’s design-state token, whose revision is an opaque string. Saving preserves that token; each committed edit, undo and redo creates a fresh one. Neither token field is saved in authored document content or undo snapshots; see design revisions. See control-protocol.md.

To compare design proposals with several parameter edits each, call execute with inspect.parameter_variants. It rebuilds a separate copy for each candidate. A direct call connected to the desktop window can run on a worker, like a long measurement. Use the baseline and each result’s metrics to compare volume, mass and body count; check ok and diagnostics before applying any candidate.

{"command": "inspect.parameter_variants", "params": {"variants": [
  {"name": "Lighter", "set": {"width": "45 mm", "thickness": "4 mm"}},
  {"name": "Wider", "set": {"width": "75 mm", "thickness": "6 mm"}}
]}}

Apply the selected values separately with parameters.change {changes} if you intend to edit the design. Use describe_command for the input and output schemas.

Resources, subscriptions, prompts, and completions

In addition to tools, the MCP server exposes read-only resources, resource templates, subscriptions, workflow prompts, and argument completions:

  • Static resources (resources/list):
    • solidcraft://design (application/json) — full document.inspect JSON with measurements.
    • solidcraft://commands (application/json) — the complete engine command catalog as JSON.
  • Resource templates (resources/templates/list) for targeted reads without dumping the whole design:
    • solidcraft://body/{name} — geometry, physical properties, and component of one body.
    • solidcraft://sketch/{name} — plane, DOF, curves, points, constraints, and profiles of one sketch (by name or feature id).
    • solidcraft://feature/{id} — definition, inputs, and error/warning state of one timeline feature (by numeric id or name).
    • solidcraft://command/{id} — parameter docs and input/output JSON Schemas for one command.
    • solidcraft://skill/{skill}/{file} — any bundled skill Markdown document (for example solidcraft://skill/solidcraft-modeling/reference.md).
  • Workflow prompts (prompts/list, prompts/get) grounded in the bundled skills:
    • model-part (part?, material?) — plan, build in staged batches, and verify a new parametric part.
    • edit-design (goal?, target?) — map an open design and apply parametric in-place edits.
    • check-parameters (parameters?, ranges?) — sweep driving parameters without mutating the saved design.
    • diagnose-feature (feature?) — inspect failing or warning timeline features and apply a minimal fix.
    • assembly-clearance (occurrences?, joint?) — verify grounding, static clearances, and motion interference.
  • Autocompletion (completion/complete): completes template variables (body names, sketch names, feature ids/names, command ids, skill names and files) and prompt arguments (including prioritizing failing or warning features first for diagnose-feature).

Resource subscriptions

The server advertises "resources": {"subscribe": true, "listChanged": true} in its initialize capabilities so clients can follow changes with resources/subscribe and resources/unsubscribe:

  • resources/subscribe ({"uri": "solidcraft://design"}) registers the URI for the current session and returns {}. Re-subscribing an already subscribed URI is idempotent. Missing or non-string/empty uri values fail with JSON-RPC -32602 (Invalid params); unknown URIs fail with -32002 (Resource not found). Each session allows at most 256 concurrent subscriptions (exceeding the limit returns -32602).
  • resources/unsubscribe ({"uri": "solidcraft://design"}) removes the URI from the session’s subscriptions and returns {} (idempotent for known URIs that are not currently subscribed; -32602 for missing/invalid uri, -32002 for unknown URIs).
  • notifications/resources/list_changed ({"jsonrpc":"2.0","method":"notifications/resources/list_changed"}) is emitted when the active design identity changes (new_design, open, or switching tabs) or when the set of bodies, sketches, or features changes (for example after execute, batch, undo, or redo).
  • notifications/resources/updated ({"jsonrpc":"2.0","method":"notifications/resources/updated","params":{"uri":"solidcraft://design"}}) is emitted for each subscribed design resource affected by a revision change (including parameter edits that keep the same bodies and features). Static resources unaffected by design edits, such as solidcraft://commands, do not receive spurious updated notifications on design edits.
  • No spurious notifications: read-only calls (inspect_design, measure, body_topology, list_commands, describe_command, version, running, pending, skill_reference, crash_reports), failed edits, rolled-back batches, and check_parameters leave the design revision unchanged and emit neither notification.
  • Live desktop changes (--connect): once initialized or subscribed, solidcraft-cli mcp also observes document.revision on the connected desktop app while idle, so edits made directly in the SolidCraft window or by the built-in Assistant emit notifications/resources/list_changed and notifications/resources/updated without waiting for the next MCP tool call.
→ {"jsonrpc":"2.0","id":1,"method":"resources/subscribe","params":{"uri":"solidcraft://design"}}
← {"jsonrpc":"2.0","id":1,"result":{}}
→ {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"execute","arguments":{"command":"solid.box","params":{"length":10,"width":10,"height":10}}}}
← {"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"..."}]}}
← {"jsonrpc":"2.0","method":"notifications/resources/list_changed"}
← {"jsonrpc":"2.0","method":"notifications/resources/updated","params":{"uri":"solidcraft://design"}}
→ {"jsonrpc":"2.0","id":3,"method":"resources/unsubscribe","params":{"uri":"solidcraft://design"}}
← {"jsonrpc":"2.0","id":3,"result":{}}

Errors: an unknown tool or arguments that don’t match the tool’s schema are JSON-RPC -32602 errors (an unknown argument’s error lists the tool’s arguments); an engine failure (bad command parameters, a feature that fails) is a tool result with isError: true and the engine’s message, which the model can read and correct.

Long-running requests

The app answers a control request that runs longer than 60 seconds (a big fillet, say) with “still running” (control-protocol.md); it has not failed, and was not cancelled. The bridged server then keeps the connection, where the reply will come, and asks the app (control.pending) every half second for up to 240 seconds more, saying on stderr how long it waits; when a client supplies _meta.progressToken (string or integer) on a tools/call request, the server also emits standard MCP notifications/progress notifications during control.pending waits and per-step batch runs (when _meta.progressToken is absent, no progress notifications are sent). When the request finishes, the tool call returns its real result. If it still runs after that, the tool call fails with an error starting still running: that names the request and says what it still does: it will still apply when it finishes, or will still write the file (an export or a save: the design does not change), or only reads (nothing changes). Don’t send it again: call the pending tool, which waits up to 60 seconds for its result each time, or cancel it (Cancelling a request). Any other tool call first waits up to 60 seconds for it too, and is not sent while it still runs (so nothing is queued to apply unseen behind it); a request that finishes in that wait keeps its result for pending. If the connection to the app is lost meanwhile, the result is lost with it, and pending says so: inspect the design before sending a change again.

So a single tool call may block for up to 300 seconds (the app’s 60 s wait plus 240 s of polling) before it returns still running:, and a call made while an earlier request still runs for up to 60 seconds more. An MCP client needs a per-call timeout above that (say 330 s) to see that error; a client that gives up sooner only sees its own timeout, though the request goes on running in the app: then call pending (or inspect_design) before sending anything again.

A batch step that is still running stops the batch like a failure. Its rollback first waits for the step (as above), so a restored checkpoint takes the step back too; if it still runs, the reply says rolled_back: false, marks the step still_running and lists it in applied, as it will apply when it finishes.

batch rollback goes back to an engine checkpoint (edit.checkpoint) taken before the first step. It restores the design (including drawings), the active sketch, the open drawing and the undo history. A checkpoint that a step takes stays after a successful batch. A rollback uses it up. An older app without checkpoints undoes as many steps as the batch added to its undo history.

Connected to the desktop app, rollback applies within one design tab. With rollback enabled, the server refuses open (doc.open), file.import, document.activate, view.next_tab, view.previous_tab, and file.new (or new_design) with new_tab: true before any steps run. Run those commands separately, or use rollback: false to keep completed steps. If the desktop batch endpoint is unavailable or the request is too large to send in one call, the MCP server must recognize every command before it runs a rollback batch step by step. Use an MCP server that recognizes the command, run it separately, or use rollback: false. A checkpoint restores the design data across file.new in the same tab or a headless doc.open, while the file path follows the current session.

A long batch, such as a polyline of hundreds of points, can be written to a JSON file and run with path instead of commands, so the steps don’t have to go through the chat. The file holds an array of steps or {"commands": [...]}, the format solidcraft-cli run takes and solidcraft-cli script writes. The server reads it (at most 32 MB), within the folders the agent may use, and runs the steps as if they had been sent inline: the same tool steps, rollback and reply. path and commands can’t both be given, and a file that can’t be read, isn’t JSON or has no steps fails before anything is sent.

Cancelling a request

A request the app is still running when its call returns (an error starting still running:) has not failed and was not cancelled. cancel cancels it at once, without first waiting for it as other calls do, on the connection it was sent on (control.cancel, control-protocol.md):

  • still waiting its turn in the app: removed, it never runs (outcome: "removed");
  • a design change or an export computing off the app’s window thread (Preferences > AI > Keep the window responsive while agents run commands): stopped, nothing of it applied (outcome: "stopped"; an export’s file may still be written). The work stops early in the background;
  • already applying on the window thread, or a file being opened: a tool error starting cannot be cancelled:. It will still finish; inspect the design before sending it again;
  • already finished: cancelled: null with its reply.

Once it is removed, stopped or finished, later calls no longer wait for it and pending says pending: null. With nothing running, cancel says nothing to cancel. Only this server’s own request can be cancelled; another client’s requests are out of its reach.

Standard MCP notifications/cancelled notifications are also handled out-of-band while a request is running: when params.requestId matches the in-flight request, a bridged server sends control.cancel immediately on a side channel (and aborts any active control.pending wait), and a local batch stops cleanly before the next step (rolling back when rollback: true). Notifications whose requestId does not match an active or queued request are ignored.

Workflow patterns

Test risky edits with batch (dry_run and expect)

Before committing a multi-step edit—such as fillets, shelling, or boolean cuts—test it in a single batch call with dry_run: true, verbose: false, and an expect check. Every step runs normally so measure, inspect.clearance, inspect.interference, and expect evaluate the simulated model, and SolidCraft then unconditionally restores its checkpoint, leaving the design and undo history untouched:

{
  "commands": [
    {"command": "solid.box", "params": {"body_name": "Plate", "corner": [0, 0, 0], "length": 40, "width": 30, "height": 10}},
    {"command": "solid.fillet", "params": {"edges": [[0, 0, 5]], "radius": 3}},
    {"command": "measure", "params": {"summary": true}}
  ],
  "dry_run": true,
  "verbose": false,
  "expect": {"bodies": 1, "bbox": {"min": [0, 0, 0], "max": [40, 30, 10]}}
}

Add report: true to see everything the edit changed rather than only what expect checks: bodies added, removed or renamed, each body’s volume, mass, centre of mass and box that moved (and a body that was turned or mirrored without changing volume), features that now fail and joints that now conflict, all measured before the rollback.

Once the simulated numbers match, replay the same commands without dry_run: true (rollback on error remains enabled by default). Disk-writing commands (save, export, render.start, etc.) and rollback: false are refused in dry runs before any step executes.

Verify geometry, parameters, and visual fit

ok: true alone only proves commands ran without throwing an error—a missed cut or misplaced hole still succeeds. Combine numeric and visual checks after each stage:

  • Mass properties and bounding box: pass expect on batch / execute, or call measure with summary: true (volume_mm3, bbox, faces, closed).
  • Hole and boss positions: call body_topology with faces: "cylinders" to inspect every merged cylindrical axis, origin, radius, and extent in a few lines.
  • Assembly overlaps and clearances: call execute with inspect.clearance or inspect.interference (and inspect.compare to compare bodies).
  • Parametric robustness: call check_parameters ({"set": {"width": "60 mm"}}) to rebuild, measure, check feature errors/cylinders, and restore the design in one call, or execute inspect.parameter_variants to compare several parameter sets side by side.
  • Visual and silhouette checks: take a clean model render with screenshot {"source": "model", "view": "iso", "grid": false}, and when matching a reference photo or concept view use compare_picture (reference, view, fit) to get quantitative edge-offset errors in millimetres plus an overlay PNG.

Safe folder grants and permissions

  • External MCP servers: keep the default path scope and add only the directories the agent needs via repeatable --allow-path DIR arguments (create the directory before starting the server). In scripts and CI, add --require-allow-path so a missing or misspelled path fails at startup instead of silently falling back to default roots. Avoid --allow-any-path unless you explicitly trust every prompt and tool call.
  • In-app Assistant: add extra folders under Preferences → Assistant → Allowed folders and pick a per-agent approval level (Ask every time, Auto-allow model edits, or Allow everything); reconnect or start a New chat after changing allowed folders so the bridged CLI picks up the updated --allow-path flags.

Reusing a persistent headless session

For automated pipelines that generate or inspect many parts, start one solidcraft-cli mcp --headless process and reuse its stdio connection across jobs with new_design or open between parts—see Reuse a headless session from another program. Add --structured when your host program prefers parsed structuredContent, and --param-check strict to catch typos or schema mismatches before any geometry runs.

Camera and close-up recipe

The camera of screenshot (the object view.apply, view.save and solidcraft-cli snapshot --camera take too) is an orbit camera, {target, yaw, pitch, distance, fov?}, in millimetres and radians. Unlike the angle of solid.move, a bare number is not degrees here. The eye is at target + distance * (-sin(yaw) * cos(pitch), -cos(yaw) * cos(pitch), sin(pitch)), looking at target with Z up on the screen. So yaw: 0, pitch: 0 is the front view: the eye at -Y, looking along +Y, with +X to the right. A yaw of π/2 looks from -X, π from +Y and -π/2 from +X. The pitch is the elevation angle up from the XY plane, and π/2 looks straight down with +X to the right and +Y up; view.apply refuses a pitch past ±π/2. A positive roll turns the picture clockwise. The app’s View angles readout (view.angle_readout) shows the same yaw, pitch and roll in degrees. fov is the vertical field of view in radians. 0, or no fov, is an orthographic view whose visible half-height is 0.4 × distance; with a perspective fov the half-height at the target is distance * tan(fov / 2). inspect.section removes what lies on the side its normal points to: it keeps the points p with n · p < d, where d = n · origin (flip: true keeps the other side, the plane staying put). offset moves the cut against the normal you give, so a positive offset cuts more away: from a face’s outward normal it goes into the part. To look into the cut, put the eye on the removed side. With add: true the plane joins the section’s others (up to six): each plane removes what lies beyond it, so the section keeps only what every plane keeps (a quarter for two planes square to each other), and a plane added on a face at offset 0 changes nothing; replace: <id> moves that plane to the new plane and keeps the others, remove: <id> takes one plane out, hide and show (an id or a list) keep a plane in the section without cutting, folder: false hides the browser’s Analysis folder (the planes on show stop cutting until folder: true; meanwhile hide and show change only which come back), and the reply’s planes lists every plane with its id and hidden, and folder the ids that come back with the hidden folder (null while it is shown). Each change is an undo step (edit.undo brings the section back), and none is saved with the design.

To look closely at one part of a large model, such as a STEP assembly, work in a headless session. These steps change only the open design in memory:

  1. Open the model with solidcraft-cli mcp --in assembly.step (or the open tool, which also takes up and names, see step 4 and STEP import). inspect_design lists the bodies with their names and bounding boxes.
  2. Remove what is in the way with solid.remove, e.g. {"bodies": ["Cover"]}.
  3. Cut the region out of the rest with solid.box, e.g. {"corner": [40, 0, -45], "length": 20, "width": 50, "height": 45, "operation": "intersect", "targets": ["Housing", "Plate"]}. Each listed body is trimmed to the box, and one that lies wholly outside the box is removed. The box itself is not kept.
  4. If the model lies on its back (many STEP files have +Y up), open it with up: "y" (the open tool, doc.open, file.insert_step), which turns the file’s bodies a quarter turn about X (Y becomes Z). One already open is stood Z up with solid.move, listing every body you keep, e.g. {"bodies": ["Housing", "Plate"], "axis": [1, 0, 0], "angle": 90}. It turns the bodies about the world origin, and a bare angle is in degrees. A turn of +90° about X takes +Y to +Z.
  5. Colour the parts that matter with appearance.assign, e.g. {"bodies": ["Housing"], "color": "#3a7bd5"}, and hide helper bodies or sketches with browser.visibility, e.g. {"items": ["Plate"], "visible": false}. To see into a housing without changing its appearance, use browser.opacity, e.g. {"bodies": ["Housing"], "percent": 30}; 100 puts it back.
  6. Cut a section with inspect.section, e.g. {"plane": {"origin": [50, 30, 0], "normal": [0, 1, 0]}} or {"plane": "XY", "at": 5}.
  7. Take the picture with screenshot: a camera whose target is the centre of the region and whose eye is on the cut side, source: "model", grid: false if the region straddles Z 0 (the ground grid would cut through it), and path, width and height as needed. An orthographic picture is 0.8 × distance high, so a distance of about 1.5 times the region’s size frames it. Look at the image, adjust yaw, pitch and distance, and shoot again. Headless, the picture is always a render of the model; bridged to the app, source: "model" asks for that render instead of the app’s window.

Compact replies

execute and batch default to verbose: true, preserving the full command results. For long modelling sessions, set verbose: false at the tool-argument level:

{"name": "execute", "arguments": {"command": "solid.box", "params": {"length": 10, "width": 10, "height": 10}, "verbose": false}}

With verbose: false, a created list of more than 20 ids (a drawing of many curves) is left out and counted instead: curve_count, constraint_count, dimension_count and point_count. sketch.inspect lists every id.

Feature replies omit the full bodies list while keeping feature, name, created_bodies, changed_bodies and removed_bodies. A cut can therefore report a changed body even when no body name was added or removed. Sketch replies keep new IDs under created and omit only identical top-level points, curves, constraints and dimensions lists. When a sketch command creates more points than its new curves have ends (the poles of an offset’s splines), created.points becomes created.point_count: refer to those curves by their ids. A sketch.move_points reply gives moved_count and reached (true when every point reached its target) instead of the moved list, and lists only the moves that missed under not_reached (point, to, at). An export’s mesh warnings (STL, OBJ and 3MF: faces left short of the smallest angle asked or off the surface, edges off the curve) are counted. Two or more lines of one kind become one line that gives how many there were, the bounds or reasons that stopped the mesh, the worst of them and the bodies they are on, for example 3 faces short of the 25° asked (stopped by: Corner, Points); the sharpest: smallest angle 3.00° ("Base": face 9); bodies: "Lid" (1), "Base" (2). A face past its chord tolerance is never counted with one within it, and a surface or curve summary gives the chord tolerance of the face or edge it names. Body names are quoted, and faces that no bound stopped are counted as “nothing stopped N faces”. warning_count gives the number of lines that verbose: true lists, and is there only when some lines were counted together. An export with one warning, or with no two warnings of one kind, keeps its warnings list as it is and has no warning_count: the length of warnings is the count. A line in a wording the compact reply doesn’t know stays as it is.

A warning that is null is left out. A null error stays, so a client that reads error still finds it. A display_value the same as value (a new parameter in its own unit) is left out.

timeline.export_script with a path writes the script and replies with path (as given), absolute_path (the file written, in full: a relative path resolves against the folder the app runs in), bytes (its size) and steps. absolute_path is left out when it can’t be worked out: in browser storage, or when the app’s folder has a name that isn’t valid UTF-8. On Linux and macOS a .. stays in it, because removing it from the text alone would name another file when the folder before it is a symbolic link; Windows removes it, as Windows resolves the path that way itself. The compact reply leaves the script itself out, as it is in the file. An older app that gives no bytes keeps the script in the reply.

All other fields and errors are unchanged; inspection commands still return their complete results. Compaction uses the engine’s reply directly, without an additional design-inspection request.

Troubleshooting

  • Check whether you are connected to the live app or headless (version). Call version {}: it returns {version, commit, mode} where mode is "app" when bridged to the desktop window and "headless" when running in-process. Remember that solidcraft-cli mcp without --connect or --headless automatically bridges only while the headless session has no design work yet—if you started creating features before opening SolidCraft (or before turning on Preferences → Assistant → Agents through MCP → Let AI agents connect), it stays headless. Start SolidCraft first with the setting enabled, or configure explicit --connect 127.0.0.1:PORT.
  • Stale, busy, or timed-out sessions (running, pending, cancel). Never blindly resend a mutating tool call after a client timeout or a still running: error:
    • Call running {} to see what the desktop app is currently executing or queuing (it answers immediately over a side channel even while a long batch is in flight).
    • Call pending {} to wait for and retrieve the result of a still running: call, or cancel {} to stop a queued or backgrounded request.
    • If the desktop app closed or restarted mid-call, call version {} and inspect_design before sending another edit. If the app reports it refused a call without running it, you have hit its limit of 16 simultaneous control connections—close idle MCP clients or scripts and retry.
  • Units and coordinate conventions. Engine lengths are in millimetres and Z is up. Bare numbers in modelling commands (such as solid.move angle) and expressions are in degrees, whereas screenshot and view.apply camera angles (yaw, pitch, roll, fov) are in radians. A bare number in a feature field stays fixed; pass an expression string (such as "width / 2") when a dimension must follow a parameter. If an imported STEP model lies on its back, reopen it with open {"path": "...", "up": "y"}.
  • Headless vs. desktop GUI differences.
    • documents, quit_app, preferences, agent_cursor and the assistant_* tools require a connected desktop app and return an error in headless mode.
    • screenshot with source: "window" and execute view.pick with pixels require a connected desktop app (view.pick with world rays works headless too; headless screenshots render offscreen on the GPU or fall back to CPU with renderer: "cpu"—run solidcraft-cli gpu to check available adapters).
    • In bridged desktop mode, a rollback batch is confined to one design tab (tab switches, open, file.import, and new_tab: true are refused unless rollback: false), and relative file paths resolve against the app’s working directory rather than the MCP server’s—always pass absolute paths.
    • --render-gpu is for headless sessions only and is refused with --connect.
  • File path refused (outside the folders this agent may use). The server’s working directory is not allowed by default, and hidden files or folders (.git, .env, etc.) inside a design folder remain blocked. Verify that every --allow-path DIR directory already exists before the server starts (missing folders are logged to stderr as allow-path ... ignored), and pass --require-allow-path in scripts to fail fast if none are usable.

Demo: an enclosure built over MCP

examples/demo/enclosure_mcp.py is a small MCP client. It drives a running app (solidcraft --control PORT) through solidcraft-cli mcp --connect and builds an electronics enclosure one execute call at a time (enclosure_steps.json): a rounded box, shelled open at the top, a USB port cut through a side wall, four screw bosses, and then a change of the width parameter that the timeline rebuilds. examples/demo/record.sh records the run with ffmpeg, with each step’s caption burnt in.

examples/demo/enclosure_ui_mcp.py (v2) builds the same part the way a person would: the modelling goes through the app’s UI over its control channel. The pointer glides to toolbar buttons and faces and clicks them, the real dialogs open, the sketches go on the model’s faces, and the camera follows. The parameters, the sketch dimensions bound to them and two extrudes go over MCP. With --story v3 (the default) one standoff is patterned 2 × 2 in the Rectangular Pattern dialog with spacings from the parameters, and width and wall are then changed in the Parameters dialog. record_ui.sh records it and draws the pointer and the captions.

Equal-sided rectangles

The execute and batch tools accept equal: true on sketch.rectangle.two_point, sketch.rectangle.center, sketch.rectangle.three_point and sketch.rectangle.rounded. The option defaults to false. The command creates a square and keeps adjacent straight sides equal, so one side dimension can size the square later.

For example, sketch.rectangle.two_point with {"p0":[0,0],"p1":[20,10],"equal":true} creates a 20 × 20 square. Two-point and rounded rectangles use the larger extent from the first point. Center rectangles use twice the larger center-to-corner offset for their side length. Three-point rectangles keep the first edge and use the third point to choose the side. Rounded rectangles square the outline before checking the radius. Referenced points and expression coordinates retain their constraints; incompatible constraints fail atomically. Two-point and center rectangles also accept rotatable: true, which keeps only the bottom side horizontal instead of locking all four sides to the axes. Combine this with equal: true to keep the sides equal; delete that single Horizontal constraint to let the square turn.

The interactive tools use the existing Shift action when sketch_square_rectangles is enabled. For Two-Point, Center and Rounded Rectangles, typing one width or height while holding Shift keeps the square after release. Typing both sizes overrides the square action.

A typical session

→ {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"me","version":"1"}}}
→ {"jsonrpc":"2.0","method":"notifications/initialized"}
→ {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"batch","arguments":{"commands":[
     {"command":"sketch.create","params":{"plane":"XY"}},
     {"command":"sketch.rectangle.two_point","params":{"p0":[0,0],"p1":[40,30]}},
     {"command":"sketch.finish"},
     {"command":"solid.extrude","params":{"distance":20}},
     {"command":"solid.fillet","params":{"edges":[[0,0,10]],"radius":3}},
     {"command":"sketch.create","params":{"plane":"XY"}},
     {"command":"sketch.circle.center","params":{"center":[20,15],"radius":5}},
     {"command":"solid.extrude","params":{"distance":20,"operation":"cut"}}]}}}
← {"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"{\"ok\": true, \"completed\": 8, \"results\": [...]}"}]}}
→ {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"measure","arguments":{}}}
← … "total": {"volume_mm3": 22390.6, …}
→ {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"screenshot","arguments":{"view":"iso"}}}
← {"jsonrpc":"2.0","id":4,"result":{"content":[{"type":"image","mimeType":"image/png","data":"iVBORw0…"},{"type":"text","text":"{\"source\":\"model\",…}"}]}}
→ {"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"export","arguments":{"path":"/tmp/part.step"}}}

The tests in crates/mcp/src/tests.rs run sessions like this (box → fillet → hole, parameters, batch rollback, hostile arguments) and check the results only through MCP.

For a compact sheet-metal flat pattern, call execute {command: "sheet.flat_pattern", params: {summary: true}}. The result keeps the size, bends and cutout_shapes, returns outline_shapes (circles, lines and arcs (free-form outlines fitted within 0.001 mm)), and omits the duplicate outline and cut-out point lists. Pockets keep their depth and shape data. The default reply is unchanged.

Naming bodies in scripts

Automatic names such as Body1 and Body2 are numbered in the order bodies are created, so inserting a feature before them can change which body gets which number. They are not stable references for scripts. When creating a body, pass body_name to commands such as solid.extrude or solid.box, then use that name in later commands. For example, use "body_name": "Mounting plate" and refer to it as "body": "Mounting plate". See solid features for body creation tools.

See also