spaceclaim
Provides tools for connecting to Ansys SpaceClaim and Ansys Discovery to create, edit, inspect, and export 3D CAD models, including sketching/extrusion, booleans, filleting, body patterns, geometry measurement, shaded render views, and saving to formats such as STEP, Parasolid, IGES, STL, and SCDOCX.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@spaceclaim Make a 50mm cube with a Ø10 hole through the center and export it as STEP"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-spaceclaim
An MCP server for Ansys SpaceClaim and Ansys Discovery (2025 R2 or newer). It lets Claude, or any other MCP client, model parts, inspect geometry, look at shaded views of the result and export CAD files. It runs through PyAnsys Geometry, the official Python client for the SpaceClaim/Discovery modelling API.
you: Make an L-bracket: 80×50×5 mm base, 45 mm wall on the short edge, two Ø8 holes
15 mm from the free edge, R6 on the outer corners. Save it as STEP.
claude: spaceclaim_connect → new_design → sketch_extrude (base) → create_box (wall, add)
→ sketch_extrude (holes, cut) → select_edges → fillet_edges → render_view
→ save_design bracket.stepStatus: alpha. The unit tests run the real PyAnsys Geometry client objects and a fake backend. The end-to-end test against a live SpaceClaim (
tests/test_live.py) has not yet been run on 2025 R2. If you have SpaceClaim, please run it (see Development) and open an issue with the result.
Not affiliated with or endorsed by Ansys, Inc. Ansys, SpaceClaim and Discovery are trademarks of ANSYS, Inc.
What it can do
Area | Tools |
Session |
|
Documents |
|
Sketch + solid |
|
Edit |
|
Inspect |
|
See |
|
Anything else |
|
How it keeps the model honest:
Every modelling call reports what changed: bodies created, deleted and modified, with volume and bounding box.
Silent no-ops become errors. Some backend operations return success and change nothing: a cut that misses, a fillet that is too large. The server compares the geometry before and after, and fails with
no_geometry_changeso the model does not build on a step that did not happen.One working unit for every number in and out (millimetres by default), and degrees for angles. PyAnsys works in metres internally.
Booleans that cannot work are refused up front. A cut or union with a body it does not touch would delete the tool body and leave the target unchanged, so the server checks for contact first.
Failed edits clean up after themselves. Tool bodies and the temporary copies PyAnsys makes for booleans are removed when an operation fails.
Errors keep their message. SpaceClaim's own error text reaches the model, instead of the SDK's generic "Error executing tool".
Related MCP server: b123d-print-mcp
Requirements
Windows with SpaceClaim or Discovery 2025 R2+ installed and licensed (both ship the API server add-in that PyAnsys Geometry talks to). A headless Ansys Geometry Service also works.
Python 3.12 or 3.13 and uv.
Install
Claude Code:
claude mcp add spaceclaim -- uvx --from git+https://github.com/nesso-labs/mcp-spaceclaim mcp-spaceclaimClaude Desktop (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"spaceclaim": {
"command": "uvx",
"args": ["--from", "git+https://github.com/nesso-labs/mcp-spaceclaim", "mcp-spaceclaim"],
"env": { "SPACECLAIM_MCP_VERSION": "252" }
}
}
}Any other MCP client: run mcp-spaceclaim (stdio).
Then ask for a part. The model calls spaceclaim_connect first; by default that launches
SpaceClaim 2025 R2 with its UI visible, so you can watch the model build.
Attaching to a running session
spaceclaim_connect with mode: "attach" connects to a product that is already running
with the API server add-in (host, port, transport_mode). On Windows the default
transport is wnua. See PyAnsys Geometry's
guide to existing sessions.
Configuration
Variable | Default | Meaning |
|
| Working length unit: |
|
| What |
|
| Ansys release to launch ( |
|
| Launch without showing the UI |
|
| Defaults for |
|
|
|
|
| Where relative |
CLI flags override the same settings: --units, --product, --ansys-version,
--no-scripts, and --transport streamable-http --http-host 127.0.0.1 --http-port 8765
to serve over HTTP.
Over HTTP the server has no authentication, and anyone who can reach it can drive SpaceClaim and run scripts. Keep it on loopback, or put it behind something that authenticates. A machine running SpaceClaim is usually also the machine running the MCP client, and stdio is the right choice there.
Conventions
Sketch planes (plane.base) and what "+" extrudes along:
Plane | local u | local v |
|
| +X | +Y | +Z |
| +X | +Z | −Y |
| +Y | +Z | +X |
planar face ( | stable in-plane axis | normal × u | outward normal |
offset shifts the plane along its normal. Every sketch tool returns the exact frame it
used. Bodies are referenced by id, or by name when the name is unique. Face and edge ids
can change after a topology edit, so select them again rather than reusing old ones.
Known limitations on 2025 R2
These come from the PyAnsys Geometry 0.18 sources and its own list of backend incompatibilities, not from a live run:
STEP/IGES export through the API needs 2027 R1. On older releases
save_designfalls back to SpaceClaim's own Save As (DocumentSave) inside the product, which works only when the product runs on the same machine as the server. The result says which path was used (via)..scdocxand Parasolid.x_tdo not need the fallback.Importing files (
open_file) had problems before 26.1, according to the PyAnsys test suite.Bodies inside sub-components (typical in imported assemblies) are instances of a master body. A move applies to the master, so every instance moves, and
shell_bodywithopen_facesis refused for them.pull_facesis proven on planar faces only. To resize a hole, cut a larger cylinder.revolve_sketchis built as a sweep by PyAnsys. The live test checks a full 360° revolve; upstream tests only cover 90°.shell_bodyhollows inward by default (side: "outward"keeps the inner size).
Safety
new_designandopen_fileclose the current document.delete_bodyandspaceclaim_disconnectare marked destructive. There is no undo through the API, so save first.run_scriptexecutes arbitrary SpaceClaim Python inside the product with your user's rights. MCP clients ask before running it. SetSPACECLAIM_MCP_ALLOW_SCRIPTS=0if you don't want it.The server never sends data anywhere; it talks only to the local product.
Development
uv sync --extra dev
uv run pytest # unit tests: real PyAnsys client objects + fake backend
uv run ruff check src testsLive end-to-end test (Windows + SpaceClaim). It builds the bracket above and a revolved washer, checks every volume against the hand-computed value, adds a named selection, renders the result and exports STEP/SCDOCX/STL:
$env:SPACECLAIM_MCP_LIVE = "1"
uv run pytest -m live -vDesign notes
Typed tools, with scripting as the exception. The official
ansys-common-mcpservers mostly let the model write and run PyAnsys code. That is flexible, but every call is untyped code running on the host. Here the common operations are typed tools with validated arguments and checked results.run_scriptruns inside SpaceClaim's own scripting sandbox for everything else.The before/after geometry check follows the idea in ansys-agent-bridge, which found that some backend booleans report success without changing anything.
render_viewdraws the backend's tessellation with matplotlib on the Agg backend. It needs no OpenGL context, so it also works on a headless VM.
License
MIT. See LICENSE.
Available Tools
28 toolsbooleanC
Unite, subtract or intersect bodies into target.
Inputs: tools (required), target (required), operation (required), keep_tools. Returns: object
chamfer_edgesB
Bevel edges by an equal distance (get ids from select_edges).
Inputs: body (required), distance (required), edge_ids (required). Returns: object
create_boxC
Axis-aligned block between two corners.
Inputs: name (required), corner_max (required), corner_min (required), targets, +1 more. Returns: object
create_cylinderC
Cylinder (or, with operation='cut', a round hole of that depth).
Inputs: name (required), height (required), radius (required), base_center (required), +3 more. Returns: object
create_named_selectionB
Group bodies/faces/edges under a name (inlet/outlet/wall for CFD, fixed supports for FEA); Fluent and Mechanical pick these up.
Inputs: name (required), body, bodies, edge_ids, +1 more. Returns: object
create_sphereD
Sphere.
Inputs: name (required), center (required), radius (required), targets, +1 more. Returns: object
delete_bodyBDestructive
Delete a body from the design (there is no undo through the API).
Inputs: body (required). Returns: object
describe_bodyBRead-only
Faces (type, area, normal, radius, centre) and edges (type, length, ends, radius) of one body, with the ids that the face/edge tools take.
Inputs: body (required), limit, include_edges, include_faces. Returns: object
fillet_edgesA
Round edges with a constant radius (get ids from select_edges).
Inputs: body (required), radius (required), edge_ids (required). Returns: object
list_bodiesBRead-only
All bodies in the design with volume, bounding box and face/edge counts.
Inputs: refresh. Returns: object
measure_distanceARead-only
Minimum distance between two bodies and how they collide (none/touch/intersect/ contained).
Inputs: body_a (required), body_b (required). Returns: object
move_bodyA
Translate, rotate and/or mirror bodies (applied in that order).
Inputs: bodies (required), copy, mirror, rotate, +1 more. Returns: object
new_designADestructive
Create an empty design. This closes the currently open design in the product; save_design first if it has unsaved work.
Inputs: name. Returns: object
open_fileADestructive
Open a CAD file as the active design (closes the current design).
Inputs: path (required). Returns: object
pattern_bodyA
Copy a body in a row or around an axis (bolt circles, rib arrays).
Inputs: body (required), count (required), axis, kind, +5 more. Returns: object
pull_facesA
SpaceClaim Pull: offset planar faces to change a size (make a plate thicker, deepen a pocket). To resize a hole, cut a larger cylinder instead.
Inputs: body (required), distance (required), face_ids (required). Returns: object
rename_bodyC
Rename a body.
Inputs: body (required), new_name (required). Returns: object
render_viewARead-only
A shaded picture of the model. Use it after every few edits and before reporting a result; highlight faces/edges to confirm a selection before filleting or cutting.
Inputs: size, views, bodies, highlight_body, +2 more.
revolve_sketchA
Revolve sketch profiles about an axis (shafts, pulleys, turned parts). The axis must lie in the sketch plane and must not cross the profile.
Inputs: axis (required), name (required), shapes (required), axis_origin (required), +4 more. Returns: object
run_scriptADestructive
Escape hatch: run a script inside the product for anything the typed tools do not cover. The design is re-read afterwards.
Inputs: code (required), args. Returns: object
save_designB
Save or export the active design. An existing file is replaced.
Inputs: path (required). Returns: object
select_edgesARead-only
Find edges by geometry (vertical edges, edges of the top face, Ø8 hole rims ...).
Inputs: body (required), radius, extreme, on_faces, +5 more. Returns: object
select_facesBRead-only
Find faces by geometry instead of guessing ids (top face, all Ø8 holes ...).
Inputs: body (required), normal, radius, extreme, +5 more. Returns: object
shell_bodyB
Hollow a solid to a wall thickness, optionally opening some faces.
Inputs: body (required), thickness (required), side, open_faces. Returns: object
sketch_extrudeB
Sketch 2D shapes on a plane or planar face and extrude them into a solid.
Inputs: name (required), shapes (required), distance (required), plane, +3 more. Returns: object
spaceclaim_connectA
Start SpaceClaim/Discovery (or attach to a running one) and make it the target.
Launching starts the product with its API server add-in and takes 30-120 s. Reconnecting closes the previous connection first; a product this server launched exits with it.
Inputs: host, mode, port, hidden, +4 more. Returns: object
spaceclaim_disconnectADestructive
Close the connection. A product launched by this server exits (unsaved work is lost); an attached product keeps running.
Inputs: no named parameters. Returns: object
spaceclaim_statusBRead-only
Connection state, backend version, working unit and the open design.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 28 tools
Each tool has a clearly distinct role: connection/status, design lifecycle, inspection, selection, primitive creation, sketch modeling, editing, and grouping. The few potentially overlapping areas (e.g. create_cylinder with cut vs boolean subtract, describe_body vs select_faces/select_edges) are explicitly differentiated in the descriptions.
Most tools follow a readable snake_case verb_noun pattern such as create_box, fillet_edges, and delete_body. The main deviations are the spaceclaim_* prefixed connection trio, new_design, and the single-noun boolean, but these remain clear and do not create confusion.
The set is heavier than ideal at 28 tools for an MCP server and could be consolidated in places, such as the connection tools and primitive creators. Still, most tools correspond to genuine CAD operations and do not feel gratuitous for a full modeling workflow.
The surface covers connection, design creation/open/save, inspection, selection, primitives, sketching/extrude/revolve, booleans, transforms, patterns, fillets/chamfers, shelling, named selections, and a run_script escape hatch. Advanced CAD/assembly operations are absent, but the core lifecycle and common modeling workflows are well covered.
Maintenance
Related MCP Connectors
CAD in ChatGPT and Claude: editable parts, STEP/STL/drawings, in-chat 3D, automatic checks.
Parametric 3D CAD for AI agents: build print-ready parts, check them, export STL, 3MF or STEP.
Text-to-CAD: build exact STEP or 3MF/STL on the server, each stated requirement measured.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables Claude to create and modify real Onshape CAD models — sketches, extrudes, fillets, patterns, mates, and parametric variables — with every mutation returning structured status, warnings, and geometric deltas. Includes multi-view PNG rendering, image-reference decomposition, and drawing OCR so the agent can visually verify and iterate on parts and assemblies.MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to design, verify, and export FDM 3D-printable parts by running model-written build123d scripts in a sandbox, rendering previews and cross-sections, running print checks, and exporting STEP, STL, 3MF, or PNG. It supports workflows from photos or caliper readings to finished part files through natural language.35103 PyPI3MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to build and edit native CAD parts and assemblies, inspect saved geometry and measurements, retain revisions, run mechanism and interference checks, and export STEP/STL/GLB artifacts through MCP tools.MIT
- AlicenseAqualityCmaintenanceEnables Claude to model 3D-printable parts by running Python scripts in a headless FreeCAD instance and exporting STL/3MF/STEP files. It also lets Claude visually inspect renders, check mesh integrity and overhang printability, measure volume and estimated mass, and open results in a slicer before printing.10MIT