This MCP server integrates with SolidWorks API and structuring it into Claude-compatible context streams.
This MCP server integrates with SolidWorks API and structuring it into Claude-compatible context streams.
AI-driven CAD automation for SolidWorks — an MCP (Model Context Protocol) server.
SolidPilot lets an AI model work with SolidWorks at the CAD feature level. The goal is for the model to reason in terms of "which CAD intent am I realizing?" instead of "which API method should I call?". Intent is converted into a CAD-neutral intermediate representation, and a deterministic compiler lowers that representation into concrete SolidWorks operations.
SolidPilot is not a Claude-only plugin; it is a general bridge between SolidWorks and AI. Because MCP is an open standard, any MCP-capable AI client can connect — alongside Claude, OpenClaw, OpenAI-based agents, and local LLMs are also targeted. The architecture was designed for this extensibility from the start: the execution and planner layers do not know which client is calling them; a thin adapter per client reuses a shared bridge core. adapters/claude/ is the current implementation; supporting a new AI client means only adding a new adapter.
Repository:
mcp-server-solidworks· Public name: SolidPilot · Target version: SolidWorks 2026
The SolidWorks API exposes thousands of methods. Presenting each one to the AI as a separate "tool" explodes context size and token cost — the economic problem that stalls similar projects.
SolidPilot solves this by raising the level of abstraction:
Because the IR is the spine, the same machinery runs backwards: a 2D technical drawing is design intent expressed in two dimensions, so it can be read into the same IR and built.
Hand SolidPilot a .DXF or .DWG — the file a supplier or a customer actually sends, with no model behind it — and it reconstructs the part:
drawing.dwg → analyze_drawing → (draw dialect: views, edge classes, chained contours,
true-valued dimensions, bend notes) → Feature Graph IR → compiler → SolidWorksThe reader decides which of two answers the drawing warrants. When every decision the part needs is forced by the drawing itself — today, sheet-metal flat patterns — it lowers the whole part to IR on its own and analyze_drawing(mode='build') builds it in one call. When the drawing needs real engineering reading (the normal case for a machined part), it says so and hands over the structured analysis, which the model interprets under a versioned rule set (the recipe://usage/reverse resource) and builds through submit_feature_graph.
Either way the result is checked, not assumed: expected volume is computed from the drawing's own dimensions before building and read back after. Nine real drawings have been reconstructed this way so far — four in-house samples (two of them sheet metal) and five production manufacturing sheets (A4/A3/A1, 1:1 to 1:10, three different title-block templates), each verified against its own title-block weight to within 0.02% or against the original part to exact topology.
…Read the diagram by line style: a thick line works today, a dashed line is planned. Two MCP doors are live — the low-level tools (the primary path today), and rebuild_from_ir, which drives the real deterministic compiler to reproduce a part — or an assembly — from its Feature Graph IR. The dotted reverse arrow is the discovery step: analyze_model/analyze_drawing read an existing part so an IR can be proposed for it. The only dashed (still-planned) piece is the forward collapse — a single submit_feature_graph tool that would replace the low-level surface for building from scratch; it runs through the same compiler.
The system has four layers:
| Layer | Directory | Language | Responsibility |
|---|---|---|---|
| Planner / Intent | cad-planner/ |
AI model + IR schema | Turns user intent into a CAD-neutral Feature Graph IR. Never touches COM, never emits raw tool calls. |
| Compiler | compiler/solidworks/ |
Deterministic (no LLM) | Lowers the IR into ordered tool calls; resolves semantic references (e.g. top_face, center) against live geometry state. |
| Execution | execution/solidworks/ |
C# (.NET Framework 4.8) | The only layer that touches the SolidWorks COM API. The single source of truth for CAD state. |
| Adapter | adapters/claude/ |
Python (MCP SDK v2) | MCP protocol bridge. The MCP boundary sits at the top of the system. |
MCP sits at the top: it is the boundary where the AI client meets the system, not an internal transport. Everything below the IR is deterministic and communicates over plain REST.
The adapters/ layer is provider-specific and replaceable. Because the execution and planner layers do not know which client is calling, adding a new AI client (OpenClaw, OpenAI, a local LLM, etc.) means only writing a new adapter — the IR, compiler, and execution layers stay unchanged.
Current vs. target: the Feature Graph IR and the deterministic compiler now exist and work — the compiler (compiler/solidworks/pycompiler, lowering + a v0 reference resolver) has reproduced real production parts end-to-end from their IR to a verified match (see Project Status). It is reached today through the rebuild_from_ir tool (the reverse/reproduce direction). What is still ahead is the forward collapse: replacing the low-level surface with a single submit_feature_graph tool for building from scratch, and a durable reference resolver that survives edits (the make-or-break module). Until then the low-level MCP tools remain the primary path for building.
The system currently exposes 47 tools for doing and 13 MCP resources for reading — the recipe is served through BOTH get_recipe(section) and recipe://usage/*, because MCP resources sit in the client's action space and not every host lets a model reach one. A contract test keeps both surfaces honest — the adapter against the execution contract, and every resource URI mentioned in the adapter against what is actually registered (see CONTRIBUTING.md). Most tools are low-level CAD operations; a few (save_analysis, rebuild_from_ir, submit_feature_graph, compare_parts, compare_assemblies) drive the analysis / IR round-trip described below. All lengths are in meters (SolidWorks internal units).
The resources carry the rule set and the contracts, not behaviour: recipe://usage/index plus one static recipe://usage/ per rule section, and schema://feature-graph + schema://analysis-artifact. The split is deliberate — a tool's description is paid on every single turn whether or not it is used, while a resource body costs only when read, so near-static reference material belongs on the resource side.
ensure_ready — launches SolidWorks via COM and attaches if it is closed (does not open a document).open_new_part — opens a new part document.open_document — opens an existing file from disk (native .sldprt/.sldasm/.slddrw; imports .ipt/.CATPart/STEP/IGES via 3D Interconnect when the translator is available, otherwise returns a clear OPEN_FAILED).activate_document — switches between open documents.save_document — saves the part or drawing to disk.close_document — closes the document.create_sketch — starts a sketch on a plane or a selected face.edit_sketch — reopens an existing sketch for editing.add_sketch_entity — adds a sketch entity: line, circle, arc, center arc, ellipse, spline, rectangle, fillet, chamfer.add_sketch_constraint — adds a sketch relation (horizontal, coincident, etc.).add_dimension — adds a dimension to the sketch.extrude_feature — boss, cut, revolve, sweep, loft.add_edge_feature — fillet or chamfer on a solid edge (chamfer: distance-angle at any angle, or distance-distance).create_rib — rib feature from an open sketch profile.add_reference_geometry — reference plane, axis, or point.create_pattern — linear or circular pattern.sheet_metal_feature — sheet metal: base_flange, edge_flange (incl. custom-profile flanges), sketched_bend, flat_pattern.modify_dimension — changes the value of a named dimension (the basis for variants).edit_feature — suppresses, unsuppresses, deletes, or renames a feature.set_part_material — assigns a material to the part.analyze_model — geometry, mass_properties, bodies (per-body fingerprints for multibody parts), features (a compact feature-level recipe), edges, faces, sketch (one sketch's exact segments on demand), and feature_map (per-feature consumed/created topology — the source of the reference-resolver anchors) modes.get_selection — reads the geometry the user selected in the SolidWorks GUI and maps it to the analyze index.verify_state — returns the current state and feature tree.open_new_assembly — opens a new blank assembly document.insert_component — inserts a part file as a component: insertion point or a full 13-number transform, fixed or floating.add_mate — adds a mate (coincident, concentric, parallel, perpendicular, tangent, distance, angle, lock) using robust index-based entity selection.analyze_assembly — reads components (tree order with full transforms, incl. a flattened leaf view across nesting levels), mates (creation order, locale-proof enum types, entity anchors), or one component's face/edge lists.save_body_as_part — extracts one body of a multibody part into its own part file (for flattened assembly STEP imports).compare_assemblies — objective assembly diff (component set, per-component transforms to ≤1 µm, mate count + types, mass properties) with the verified verdict.These tools implement the reverse-engineering loop — "the LLM proposes, the round-trip decides" — that reproduces an existing part from a CAD-neutral Feature Graph IR and objectively verifies the result.
recipe://usage/index indexes one recipe://usage/ per rule section (mapping/canonicalization/forward/reverse/verification/…), and schema://feature-graph + schema://analysis-artifact serve the two contracts. The model reads these before writing an IR. They are near-static, identical for every caller, and carry ttlMs/cacheScope freshness hints — which is why they are resources: the retired get_recipe tool cost ~2.4 KB of the tool list on every single turn, read or not.save_analysis — writes an analysis artifact for a part or assembly file (feature recipe / component + mate tree, driving parameters, and an optional Feature Graph IR block) to /.solidpilot/.rebuild_from_ir — the reverse IR door: runs an artifact's IR block through the deterministic compiler to rebuild the part — or assembly — in a fresh document, and warns when the source file has changed under the artifact (source_stale).submit_feature_graph — the forward IR door: builds a part or assembly from a Feature Graph supplied directly by the model (design intent, no original to copy), through the same compiler — two doors, one compiler.compare_parts — objective two-part diff (topology, volume, area, center of mass) with the project's verified verdict (topology-exact and |ΔV| ≤ 1% and |ΔA| ≤ 1%).The drawing tools were added after the initial part-modeling set and
No open issues yet, or sync has not completed.