onshape-mcp
A Model Context Protocol server that lets Gemini and other AI agents build, inspect and edit parametric CAD in Onshape: sketches, extrudes, fillets, patterns, assemblies and mates, variables, and custom FeatureScript.
Every tool that changes the model returns a structured report of what actually changed, which warnings Onshape's regenerator raised, and hints for the next step, so an agent can check its own work instead of assuming a call succeeded.
Started as a fork of hedless/onshape-mcp (MIT). The REST client, HMAC auth and first feature builders come from upstream; see NOTICE for what was added in this fork.
What it can do (69 tools)
| Area | Examples |
|---|
| Documents | create, search, summarise, list Part Studios and elements |
| Sketches | lines, arcs, circles, rectangles, rounded rectangles, constraints, edit and inspect existing sketches |
| Features | extrude, revolve, fillet, chamfer, shell, thicken, boolean, linear and circular patterns, offset planes |
| Parametrics | Variable Studios, read and set variables, update or delete features by name |
| FeatureScript | evaluate FeatureScript, write and apply custom features |
| Assemblies | add instances, fastened, revolute, slider and cylindrical mates, positioning, interference checks |
| Analysis | mass properties, bounding boxes, measurements, entity discovery with face coordinate systems |
| Vision | render Part Studios, assemblies and sketches from several views; crop and load images; extract dimensions from drawings; compare a build against a reference |
| Export | Part Studio and assembly export (e.g. STEP, STL) |
Showcase: Engineering Parts & Assemblies
The server is built to drive real-world, high-fidelity mechanical and aerospace geometry in Onshape:
Left: BWB UAV airframe with parametric aerofoil lofts and control surfaces in Onshape PartStudio.
Right: Exploded multi-body internal structural assembly (ribs, spars, and skin).
Left: 155mm artillery precision guidance kit (PGK) assembly with despun collar and titanium canards.
Right: Pneumatic catapult launcher assembly with slider and revolute mates.
Left: Internal avionics, slip ring, and mechanical steering head cutaway.
Right: Top-down planform aerodynamic geometry and chord distribution.
Quick start
Requires Python 3.10+ and uv.
git clone https://github.com/MuditAtrey/onshape-mcp
cd onshape-mcp
cp .env.example .env # add your Onshape API keys from https://dev-portal.onshape.com/keys
uv sync
uv run onshape-mcp
To use it from an MCP client, add the server to the client's config (see mcp_config.json):
{
"mcpServers": {
"onshape": {
"command": "uv",
"args": ["run", "onshape-mcp"],
"env": {
"ONSHAPE_ACCESS_KEY": "${ONSHAPE_ACCESS_KEY}",
"ONSHAPE_SECRET_KEY": "${ONSHAPE_SECRET_KEY}"
}
}
}
}
The repo also ships an agent plugin manifest in .claude-plugin/.
Agent harness and benchmark
tools/ contains agent loops that run design briefs end to end and export STEP files.
RESEARCH.md reports a benchmark of an agent using these tools on real engineering parts, graded against reference STEP files on volume, bounding box, topology, Boolean IoU and Chamfer distance. The main finding: the agent executes CAD reliably but does not yet read engineering drawings reliably. With a human-written spec it scored 1.000 on the simpler set; with a spec it extracted from the drawing itself, 0.533.
Tests
uv run --extra dev pytest
698 tests, all passing as of November 2026. They mock the Onshape API, so no account or keys are needed.
Project layout