Skip to main content
Glama
onshape-mcp

onshape-mcp

by MuditAtrey

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)

Related MCP server: onshape-mcp

Showcase: Engineering Parts & Assemblies

The server is built to drive real-world, high-fidelity mechanical and aerospace geometry in Onshape:

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 standard MCP configuration in mcp_config.json.

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

onshape_mcp/
  server.py      MCP server and tool definitions
  api/           Onshape REST client, documents, Part Studios, assemblies, rendering, FeatureScript
  builders/      feature payload builders (sketch, extrude, fillet, mate, ...)
  analysis/      face coordinate systems, interference, positioning
tools/           agent loops for running design briefs
tests/           unit tests (mocked API)
knowledge_base/  workflow notes for agents

License

MIT. See LICENSE and NOTICE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables OpenAI Codex to drive real Onshape parametric CAD via 69 tools for documents, sketches, features, assemblies, parametric updates, FeatureScript, vision, and export.
      69
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to drive Onshape CAD with 87 tools for documents, part studios, sketching, solid features, assemblies, drawings, measurement, and export, including zero-configuration browser sign-in.
      93
      156 npm
      7
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to create and modify real, editable Onshape CAD models through the Onshape REST API, covering parametric sketches, solid features, configurations, assemblies with mates and motion tests, interference checks, FeatureScript custom features, versions/branches, and import/export.
      MIT