The Problem
Programmatic CAD automation typically means fighting proprietary APIs, scripting UIs, or writing one-off scripts that break when the design changes. Onshape has a REST API, but using it directly requires significant boilerplate for authentication, document navigation, and feature creation. An MCP server bridges that gap: it exposes CAD operations as tools that LLM-based coding assistants like Claude Code can call directly, turning natural-language requests into real geometry operations.
What This Does
onshape-mcp is a Model Context Protocol server that wraps Onshape's REST API into a set of callable tools. The core server (onshapemcp/server.py) registers tools that map to API client functions in onshapemcp/api/ — documents, part studios, edges, variables — and builder modules in onshapemcp/builders/ that handle parametric operations like extrude.py, fillet.py, sketch.py, and gear.py. The fork adds gear generation and edge-query capabilities beyond the base project.
The codebase is cleanly separated: API layer (api/), feature builders (builders/), tool registration (tools/), and the server entry point. Tests live in tests/ with 18 test files, and documentation in docs/ covers setup, features, and testing. A uv.lock file is present, suggesting uv is the intended package manager.
How To Use It
Setup — Install with pip or uv: git clone https://github.com/clarsbyte/onshape-mcp.git cd onshape-mcp pip install -e .
Configuration — Set environment variables, either in your shell or a .env file: export ONSHAPEACCESSKEY="youraccesskey" export ONSHAPESECRETKEY="yoursecretkey"
Running — Start the server with: python -m onshapemcp.server
Then configure Claude Code (or any MCP client) by adding the server to ~/.claude/mcp.json with the absolute path to your Python executable and the API keys in the env block. Verify it works by asking Claude to list your Onshape documents.
Real-World Use
A mechanical engineer using Claude Code for design automation could say: "Create a 20-tooth spur gear with module 2 in my current document." The MCP server translates that into calls to creategear in onshapemcp/builders/gear.py, which constructs the sketch and extrude features via the Onshape API. The same pattern applies to parametric families — change a variable in an Onshape variable table via onshapemcp/api/variables.py and regenerate the part without touching the UI.
Code Health & Issues
Med — No LICENSE file — Usage and redistribution rights are unclear. This matters for any commercial deployment. Low — Dependencies without a lockfile — pyproject.toml and requirements.txt declare dependencies but no pinned versions. The uv.lock file exists, so using uv sync would resolve this. Low — Test coverage is incomplete — 18 test files exist, but tests/builders/ only covers extrude.py, sketch.py, and thicken.py. The gear and fillet builders lack direct test coverage. Low — Docs exceed code maturity — 12 documentation files for 29 Python files suggests heavy process documentation relative to implementation size. Some docs (e.g., NEXTSTEPSGEOMETRYREFERENCES.md) read as planning notes rather than user guides.
The Bottom Line
A functional MCP server for Onshape with a sensible module layout and genuine test coverage. The fork adds useful parametric features (gears, edge queries) on top of a solid base. It's a practical tool for teams already using Claude Code or similar MCP clients for CAD automation, but the missing license and incomplete builder tests mean it's not yet production-grade. Best suited for internal tooling or as a reference implementation rather than a distributable product.