Files
SS-EN 733f0b2254 MCP: opt-in compact inspect_design and tool output (split from #2901) (#3144)
* MCP: compact inspect_design and tool JSON, off by default (--compact / SOLIDCRAFT_MCP_COMPACT)

Split out of #2901 per review: the smaller inspect_design changed the default
for everyone, so it is now an MCP server option that is off unless asked for.

- solidcraft-cli mcp --compact, or SOLIDCRAFT_MCP_COMPACT=1 (true/yes/on;
  0/false/no/off/empty leave it off; anything else is an error at start-up).
  solidcraft_mcp::Options::resolve is the one place that decides, so an app
  Preferences setting can feed it later.
- With it on, inspect_design summarises sketches (id, name, plane, counts of
  points, curves, constraints and profiles, dof, status), returns full contents
  only for the sketches named in `sketches` (names/ids, true, false or
  "summary"), takes a `bodies` filter and measures only those; unknown names
  list the existing ones. Tool JSON is compact rather than pretty-printed.
- Off, tools/list, argument checks, inspect_design and tool JSON are exactly
  as before.
- document.inspect gains an opt-in `sketch_counts` (plane, points,
  constraints); without it its reply is unchanged.

Tests: both modes in the MCP suite, Options parsing, and the CLI flag and
variable end to end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MCP compact output: a Preferences setting too (AI › Agents through MCP)

The desktop app's Preferences › AI gets "Compact output" under a new "Agents
through MCP" section, off by default and shown with the chat off too. The app
reports it on the control channel as `mcp.options` ({"compact": bool}); the
agent chat lets its own MCP server read it.

A bridged MCP server (`solidcraft-cli mcp --connect`) asks the app when an
agent first lists or calls a tool and keeps the answer for the session, so the
tools it listed keep their shape. An app not running yet, or busy past 2 s, is
asked again on the next call; an app from before the setting counts as off.
`--compact` and SOLIDCRAFT_MCP_COMPACT=1 still turn it on whatever the app says.

Tests: the server follows the app's answer (waits for it, keeps it, the flag
still wins); the checkbox reaches `mcp.options` and Restore Defaults clears it;
the chat gate allows `mcp.options`. docs/mcp.md and docs/control-protocol.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MCP compact output: review fixes (mcp.options never blocks, headless test, locales, prefs doc)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MCP compact output: the setting is a section of the AI page; the bridged test answers mcp.options

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MCP compact output: the preference test sets it through ui.prefs; rustfmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MCP compact output: look for a newly started app before asking its options; counts from sketch.inspect for an older app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 03:33:33 +00:00
..