Skip to main content

Crate brep_mcp

Crate brep_mcp 

Source
Expand description

brep_mcp — the BREP MCP automation server, hosted headlessly.

The server itself lives in brep_mcp_core. This crate re-exports its main modules (server, http, host, session, tools, schema, validate, script, program, runner, image, render_mesh, generate, plm_fixture), so brep_mcp::server::BrepServer is the same type the app embeds behind brep-app --mcp. It adds what needs the app compiled in:

  • the headless host — the whole BrepApp under egui_kittest on a wgpu device — and headless_backend, the backend every brep-mcp server runs on (one headless app per session);
  • command_descriptions, the application’s static command metadata;
  • the annotate overlay the documentation walkthroughs are drawn with;
  • the brep-mcp binary (serve, schema, test, shot, render-mesh, skills).

See the README for installation, client configuration and the tool groups.

Modules§

annotate
The DOCS ANNOTATION overlay: the caption band and the highlight ring that turn a headless screen capture into a frame of a feature walkthrough.
generate
Render the registries to the checked-in generated docs: what a reviewer diffs to see what a change exposed, and what the freshness test compares against. Nobody edits these.
headless
The headless host: the whole BrepApp inside egui_kittest::Harness on a wgpu device, stepped on demand on a dedicated thread (measured in §12). No window, no display. Answers the brep_mcp_core host protocol; the app’s own envelope and reply types are converted at the boundary.
host
The host protocol. A host owns an app instance and answers commands; the server talks to it through HostHandle — a tokio channel in, a oneshot per reply out — so async tool handlers never block.
http
The server over MCP’s streamable HTTP transport, for an app that is already running (brep-app --mcp): an agent connects to http://127.0.0.1:<port>/mcp instead of launching a process. rmcp’s transport is a tower service; hyper serves it connection by connection on the listener the caller bound.
image
Screenshot post-processing: PNG encode/decode, crop, downscale, diff, a drawn cursor, and the animated-GIF encoder the docs walkthroughs are written with. Pure CPU, image crate, no fonts — the annotation a walkthrough carries (caption, highlight ring) is painted by the HOST, in egui, before the frame is captured, because there is no font here to rasterise with and nothing in the repo to load one from (BREP_mcp/src/headless.rs, annotate).
plm_fixture
The PLM fixture: a real brep-plm serve for one test-mcp script.
program
test-mcp’s SCRIPT MODE: a BREP_mcp/tests/scripts/*.js program played through code mode, the way an agent drives the app through run.
render_mesh
CPU mesh renderer and silhouette comparison.
runner
The test-mcp script runner: plays a Script through a ToolSet, checks every expect, saves and compares images, and writes the per-step artefacts (NNNN-<tool>.json, images, result.json) under an output directory. It knows nothing about hosts or sessions: the tool set it is handed is whatever the session generated, so a script written against the running app and one written against the catalogue tools run the same way.
schema
The kernel’s feature catalogue (brep_kernel::feature_schema_catalogue, reached through brep_render::features) rendered as JSON Schema.
script
The test-mcp script format (spec Appendix E): a session description plus a list of tool calls, each with optional expectations on the tool’s JSON result and optional image capture / comparison.
server
The dynamic rmcp::ServerHandler.
session
A session: one app instance under one host, plus the session directory (store, shots, exports, log) and the recorder. Where the directory and the log ARE is the host’s platform’s business (crate::host::Platform): a directory tree natively, a name and a blob URL in a browser page.
tools
The server’s view of a tool.
validate
Feature-parameter validation against the kernel catalogue, run in the server before a feature_add / feature_set_params reaches the engine.

Functions§

command_descriptions
Static application command metadata; discovery does not create a GPU.
headless_backend
The backend every brep-mcp server runs on: one headless app per session.