
Onshape
io.github.gpambrozioPublished by GitHub account gpambroziov0.3.0Updated Oct 29, 2026
Drive Onshape CAD from an assistant: documents, sketches, solid features, assemblies and exports.
Overview
Connects an assistant to Onshape CAD so it can create documents, sketch and model parts, build assemblies, measure and export STL/STEP files.
- What you can do
- Sign in and manage Onshape credentials, including status and logout
- List, search, create, update and delete documents, workspaces, elements and versions
- Build part studios: sketches, extrudes, holes, fillets, patterns, variables, measurement and validation
- Assemble parts with instances, mates, relations, BOM and mass properties
- Export STL/STEP, drawings and shaded renders returned as images
- Call any other Onshape REST endpoint through a generic request tool
- When to use it
- Useful when you want an assistant to design or modify Onshape CAD models conversationally, for example sketching a bracket, adding features, checking measurements, assembling parts or producing printable exports and renders.
- Requirements
- Runs locally via npx with Node 20 or newer. Needs an Onshape account and either a browser sign-in on first use, an API key pair (ONSHAPE_ACCESS_KEY and ONSHAPE_SECRET_KEY), or an OAuth app. Network access to the Onshape API host is required; output directory and other settings are optional.
Installation
In SourceWeft
- Open Onshape in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Onshape MCP server
Drive Onshape CAD from an AI assistant. 93 tools for documents, part studios, sketching, solid features, assemblies, drawings, measurement and export — and no setup beyond installing it: the first tool call that needs Onshape opens a browser and asks you to connect.
The assistant sketches it, extrudes it, fillets the edges, measures the result, renders it back into the conversation, and exports an STL you can print.
Install
Claude Code
Claude Desktop — download onshape-mcp-<version>.mcpb from the
latest release and
double-click it. Nothing else to install.
Cursor, VS Code, Windsurf, Zed and other MCP clients — add the server to the client's MCP config:
The file differs per client: ~/.cursor/mcp.json (Cursor), .vscode/mcp.json
(VS Code), ~/.codeium/windsurf/mcp_config.json (Windsurf), ~/.config/zed/settings.json
under context_servers (Zed).
Node 20 or newer is required. npx fetches the package on first run.
Signing in
Nothing to configure. The first tool call that needs Onshape starts a sign-in and asks your client to show you the link; clients that support MCP's URL elicitation render it as a prompt, and the rest get the URL in the reply. The page that opens links straight to the key page for your Onshape stack and takes the pasted pair; tick Read, Write and Delete when you create the key so every tool here works. Keys are verified against Onshape, then stored in your OS keychain.
Your credentials never pass through the assistant, the model or this project's
authors — the exchange happens between your browser and a server bound to
127.0.0.1 in this process, which is exactly why MCP has URL elicitation.
Other ways in, if you prefer:
onshape_login— start the same flow deliberately.onshape_set_api_key— paste a key pair you already have.- OAuth 2.0 —
onshape_loginwithmethod: "oauth", for an app you registered at the Onshape developer portal with redirect URLhttp://localhost:8471/oauth/callback. Tokens refresh automatically. - Environment variables — set
ONSHAPE_ACCESS_KEYandONSHAPE_SECRET_KEYfor unattended installs, andONSHAPE_MCP_AUTO_LOGIN=0to stop the server ever opening a browser.
An existing onshape-cli credential at
~/.onshape/credentials.json is picked up automatically.
onshape_auth_status shows what is in use (redacted); onshape_logout forgets it.
Tools
All names are prefixed onshape_, and every tool returns {"ok": true, "result": …}
or {"ok": false, "error": …, "detail": …}.
Worth knowing:
- Units are inches and degrees throughout, except STL exports, which are millimetres by default because that is what slicers assume.
- Feature tools validate by default. Onshape answers
200for a feature that fails to regenerate, so each tool re-reads the feature state and fails loudly instead.update_featurealso fails when the edit puts another feature into ERROR; errors that were already there before the edit are listed invalidation.preexistingErrorsinstead. Passvalidate: falseto skip it. - Assemblies:
assembly_matejoins Part Studio mate connectors directly ({path: [instance id], connector: "FabC_0.mcPinion"}, asget_assemblylists them),insert_instancetakesfixed: trueto ground an instance, andassembly_relationcouples mates as gear, rack and pinion, screw or linear.set_mate_valuesdrives mates in inches and degrees and fails when Onshape ignores a value, which it does for mates with limits enabled. - Part Studio writes acknowledge applied changes. Creation replies include
creationApplied: true; updates includeupdateApplied: trueafter the POST completes. Validation errors do not undo the change: inspect the model before retrying. A failed POST does not establish whether the server applied a change. Large replies retain the feature ID and validation outcome inline, with the full response insaved_to. If that file cannot be saved,responseStorageErrorreports the storage problem without changing the write/validation outcome.validate: falseis reported asvalidationSkipped: true. - Renders come back as images.
shaded_viewandget_thumbnailreturn the PNG inline as well as writing it, so the model can see the part. - Big reads spill to disk. Anything over
ONSHAPE_MCP_MAX_RESPONSE_BYTES(default 200 kB) is written to a file and summarised, keeping a feature tree from swallowing the context window. onshape_requestreaches any REST endpoint the dedicated tools miss.
Configuration
Every setting is optional.
Secrets go to the OS keychain (service onshape-mcp) when one is available, and
the config file then holds only non-secret metadata. Without a keychain the file
holds the secret and is written 0600 inside a 0700 directory.
Onshape account limits
These come from Onshape, not from this server:
- Free accounts can only create public documents — pass
public: truetoonshape_create_document. - Deleting needs a key with delete permission. Without it Onshape answers
403 Invalid API key state; re-create the key at cad.onshape.com/user/developer/apiKeys with Delete ticked. - An instance can only be fixed when it is inserted. There is no public
call to fix or unfix one later; insert it again with
fixedand delete the old one. - Mate values need API version 10. Older versions accept a write and ignore
it;
get_mate_valuesandset_mate_valuesuse v10. - The variable-table endpoint 404s on some accounts.
onshape_set_variableandonshape_get_variablesfall back toassignVariablefeatures, which work everywhere;result.route/result.sourcesays which path was taken. Setting a name that already has a Variable feature rewrites that feature in place.
Development
Layout: src/auth (credential store, keychain, login flows, OAuth, elicitation),
src/api (REST wrappers), src/builders (Onshape BTM feature payloads),
src/tools (the MCP surface), src/server.ts (registration and the auth gate).
Contributions welcome — see CONTRIBUTING.md. Security reports: SECURITY.md.
Licence
MIT. Portions derived from onshape-cli
— see NOTICE.
Not affiliated with, endorsed by, or supported by Onshape or PTC. "Onshape" is a trademark of PTC Inc.
Source: README.md at commit 63f39d1
Tools
0Version history
2- v0.3.0LatestOct 29, 2026
- v0.1.2Sep 22, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts