onshape-mcp-codex
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ONSHAPE_API_KEY | Yes | Onshape API key (from dev-portal.onshape.com) | |
| ONSHAPE_API_SECRET | Yes | Onshape API secret (from dev-portal.onshape.com) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| create_sketch_rectangleA | Create a rectangular sketch in a Part Studio. Sketch location: pass either |
| create_rounded_rectangle_sketchA | Create a rounded rectangle sketch (4 lines + 4 tangent corner arcs) in ONE feature. Use instead of hand-rolling 4 lines + 4 arcs with the per-primitive tools -- fewer turns and no radians/degrees mistakes. Sketch location: pass either |
| create_extrudeB | Create an extrude feature from a sketch |
| create_thickenB | Create a thicken feature from a sketch |
| get_variablesA | Get all variables from a Variable Studio (or Part Studio). Modern Onshape stores variables in dedicated Variable Studio elements; pass a Variable Studio elementId here to read its variables. Pass a Part Studio elementId to read the (usually empty) variables owned by that PS. |
| create_variable_studioA | Create a Variable Studio element in a workspace. Required before set_variable on modern Onshape docs -- the legacy Part Studio /variables write path is read-only. Returns the new VS element id; use it as elementId for set_variable / get_variables. |
| set_variableA | Write or update a variable in a Variable Studio. |
| get_featuresC | Get all features from a Part Studio |
| delete_featureC | Delete a feature from a Part Studio or Assembly |
| delete_feature_by_nameA | Delete a Part Studio feature by its display name (e.g. 'Extrude 10mm', 'Sketch 1') without having to look up the feature ID first. Returns ERROR if zero or multiple features match the name so the caller can disambiguate. |
| update_featureA | Modify parameters on an existing Part Studio feature (for iteration: 'change the extrude depth from 10mm to 15mm', 'swap the fillet radius to 2mm', 'flip oppositeDirection'). Updates are keyed by the feature's parameterId (e.g. 'depth', 'radius', 'operationType', 'oppositeDirection'). For quantity params, set |
| list_documentsB | List documents in your Onshape account with optional filtering and sorting |
| search_documentsB | Search for documents by name or description |
| get_documentB | Get detailed information about a specific document |
| get_document_summaryC | Get a comprehensive summary of a document including all workspaces and elements |
| find_part_studiosB | Find Part Studio elements in a specific workspace, optionally filtered by name |
| get_partsB | Get all parts from a Part Studio element |
| get_elementsB | Get all elements (Part Studios, Assemblies, etc.) in a workspace |
| get_assemblyB | Get assembly structure including instances and occurrences |
| create_documentA | Create a new Onshape document. Returns the documentId AND the main workspaceId AND the default Part Studio elementId in one shot — no need to follow up with get_document_summary + find_part_studios before you start building. |
| delete_documentA | Move an Onshape document to the trash. Irreversible via the API; intended for cleanup of throwaway docs created by an agent (test/iteration runs). Returns {ok, status, document_id}. |
| create_part_studioA | Create a new Part Studio in an existing document. Returns the new Part Studio's elementId AND a list of other Part Studios in the same workspace (so callers don't accidentally target the empty default 'Part Studio 1' that most fresh Onshape documents ship with). Prefer this tool's returned elementId over re-enumerating via find_part_studios. |
| create_assemblyB | Create a new Assembly in an existing document |
| add_assembly_instanceC | Add a part or sub-assembly instance to an assembly |
| transform_instanceA | Apply a RELATIVE transform to an assembly instance. Translations: bare numbers = mm; strings like "20 mm" / "0.5 in" for explicit units. Rotations: degrees. Note: fails on fixed/grounded instances — use get_assembly_positions to check the 'fixed' flag first. |
| create_fastened_mateA | Create a fastened (rigid) mate between two assembly instances. Requires face IDs from Part Studio body details to place mate connectors on specific faces. Optional offsets shift connectors from face centers (in the face's local XY plane + Z along normal). |
| create_revolute_mateA | Create a revolute (rotation) mate between two assembly instances. The first instance rotates relative to the second around the mate connector Z-axis. Requires face IDs from Part Studio body details. Optional offsets shift connectors from face centers. |
| create_slider_mateA | Create a slider (linear motion) mate between two assembly instances. The first instance slides relative to the second — positive travel moves the first instance along the face normal direction away from the second. Swap instance order to reverse slide direction. Requires face IDs from Part Studio body details. Optional offsets shift connectors from face centers. |
| create_cylindrical_mateA | Create a cylindrical (slide + rotate) mate between two assembly instances. The first instance slides and rotates relative to the second along the mate connector Z-axis. Requires face IDs from Part Studio body details. Optional offsets shift connectors from face centers. |
| create_mate_connectorA | Create an explicit mate connector on a face of an assembly instance. The connector is placed at the face center with its Z-axis along the face normal. Offsets are in the connector's LOCAL coordinate system (X/Y in-plane, Z along normal). Flipping the Z-axis also reverses the other axes via the right-hand rule, which affects how offset translations map to world space. |
| create_sketch_circleA | Create a circular sketch. Pass either |
| create_sketch_lineB | Create a line sketch. Pass either |
| create_sketch_arcA | Create an arc sketch. Pass either |
| create_sketchA | Create ONE sketch feature atomically. Two surfaces in one tool: Coordinate-first (legacy, for simple sketches): pass entity dicts without Constraint-first (for drawing transcription): give each entity a user-level Sketch location: pass either Coordinate-first entity typesrectangle: {type, corner1:[x,y], corner2:[x,y], variableWidth?, variableHeight?} rounded_rectangle: {type, corner1:[x,y], corner2:[x,y], cornerRadius} circle: {type, center:[x,y], radius, variableRadius?, variableCenter?:[xv,yv]} line: {type, start:[x,y], end:[x,y]} arc: {type, center:[x,y], radius, startAngle?, endAngle?, variableRadius?, variableCenter?:[xv,yv]} Constraint-first entity types (require |
| edit_sketchA | Iterate on an existing sketch without rebuilding it. Pass any of Add semantics are STRICT: every entity/constraint dict must carry a non-empty removeIds is a single bag matched against entity ids AND constraint ids. Cascade: any constraint whose |
| inspect_sketchA | Return a compact, structured view of a BTMSketch-151's entities and constraints. Use before calling Locate the sketch by |
| render_sketchA | Render a BTMSketch-151 to a 2D PNG (sketch-local mm, looking down the sketch normal). Onshape's /shadedviews shows solids but not sketch geometry — this plots each line / arc / circle / point directly and overlays constraint badges: FIX = red square, LENGTH / DIAMETER / RADIUS / DISTANCE = green label, HORIZONTAL / VERTICAL = H/V tag. Complements |
| list_sketchesA | List every sketch in a Part Studio with featureId, name, status, and entity / constraint counts. Use to pick the right sketch before drilling in with |
| create_filletB | Create a fillet (rounded edge) on one or more edges |
| create_chamferB | Create a chamfer (beveled edge) on one or more edges |
| create_shellA | Hollow out a solid body into a thin-walled shell. Pass the face IDs (from |
| create_offset_planeA | Create an offset construction plane: a datum plane parallel to a reference plane or face, shifted by a signed distance. Use when you need to sketch at a specific Z (e.g. 2.5 mm above the Top plane) without an existing face there. Pass a |
| create_revolveB | Create a revolve feature by rotating a sketch around an axis |
| create_linear_patternA | Create a linear pattern of features. Requires a deterministic edge id whose direction the pattern will follow — Onshape has no implicit world-X axis usable here. Workflow: create a reference (a sketch line on any plane pointing the direction you want, or pick an existing body edge via list_entities), then pass its id as directionEdgeId. |
| create_circular_patternC | Create a circular pattern of features around an axis |
| create_booleanB | Perform a boolean operation (union, subtract, intersect) on bodies |
| eval_featurescriptB | Evaluate a FeatureScript expression in a Part Studio (read-only, for querying geometry) |
| get_bounding_boxC | Get the tight bounding box of all parts in a Part Studio |
| export_part_studioA | Export a Part Studio to STL, STEP, PARASOLID, GLTF, or OBJ. Blocks until Onshape finishes the translation, downloads the bytes, and writes them to /tmp/onshape-mcp-exports/. Returns the on-disk path, size, and final state so the user can open the file. Raises an explicit error on FAILED or timeout. |
| export_assemblyA | Export an Assembly to STL, STEP, or GLTF. Blocks until Onshape finishes the translation, downloads the bytes, and writes them to /tmp/onshape-mcp-exports/. Returns on-disk path, size, and final state. |
| check_assembly_interferenceA | Check for overlapping/interfering parts in an assembly using bounding box detection. Returns which parts overlap and by how much. |
| get_assembly_positionsA | Get positions, sizes, and world-space bounds of all instances in an assembly (in mm). |
| set_instance_positionA | Set an instance to an ABSOLUTE position (bare numbers = mm; strings like "20 mm" / "0.5 in" for explicit units). Unlike transform_instance this sets absolute coords and resets rotation to identity. Note: fails on fixed/grounded instances (API returns 400). |
| align_instance_to_faceA | Position source instance flush against a face of target instance. Faces: front (min Y), back (max Y), left (min X), right (max X), bottom (min Z), top (max Z). Only moves the perpendicular axis; other axes stay unchanged. |
| get_body_detailsA | Get face-level geometry details for all parts in a Part Studio. Returns face deterministic IDs, surface types (PLANE, CYLINDER, etc.), and for planar faces: normal vectors and origin points. Use face IDs with mate connector tools. |
| get_assembly_featuresA | Get all features (mates, mate connectors, etc.) from an assembly with their current state (OK, ERROR, SUPPRESSED). Useful for inspecting existing mates and debugging assembly issues. |
| get_face_coordinate_systemA | Query the true outward-facing coordinate system for a face on an assembly instance. Returns the guaranteed outward normal (Z-axis), tangent axes (X/Y), and origin. More reliable than body details normals. Use this to verify face orientations before creating mates. |
| render_part_studio_viewsA | Render one or more shaded views of a Part Studio and return the PNGs so Claude can actually see the 3D result. Use this after every feature that creates or modifies visible geometry. The returned image_ids can be passed to crop_image to zoom into suspicious regions. Claude Opus 4.7 spatial reasoning is weak — always render the view you need rather than mentally rotating. Default views: iso, top, front, right. |
| render_assembly_viewsC | Render shaded views of an Assembly. Same semantics as render_part_studio_views. |
| extract_drawing_dimensionsA | OCR a drawing PNG and return every numeric callout it can read, grouped by kind: length / radius / diameter / thread / angle / count / scale. Each callout includes pixel-position so you can map it to a specific feature in the drawing (compare against your view of the image). USE THIS BEFORE READING DIMS BY EYE — Tesseract is more reliable than your vision pass on small text. Known limit: Ø often misreads as '9' (e.g. 'Ø50' → '950'); cross-check high-significance dims with crop_image at native resolution. |
| load_local_imageA | Read a PNG from disk (e.g. the brief's reference drawing) into the image cache so you can crop_image into it at native resolution. Returns image_id + dimensions. Without this, the reference image lives only in the prompt as inline base64 — no way to zoom into a dimension callout. Use this ONCE per brief on the reference path you were given, then crop_image to read small text. |
| compare_to_referenceA | Render your current Part Studio at iso/top/front/right and COMPOSITE the result directly under a reference image from disk. Returns a single side-by-side PNG: reference on top, your build's 4 views on the bottom row, both at the same horizontal extent so silhouettes line up visually. Use this whenever you want to cross-check feature count / placement / proportion against the brief's reference figure — it removes the need to squint back and forth across separate images. The reference path you pass is a filesystem path readable by the MCP server (typically the brief's iso or drawing PNG). |
| crop_imageA | Zoom into a region of a cached image by normalized 0..1 bounding box. Use after render_* when you need to inspect a detail — a specific face, a feature edge, a suspicious fillet. (0,0) is top-left, (1,1) is bottom-right. Returns a new image keyed by its own image_id. This is the pattern behind Anthropic's CharXiv 84.7 -> 91.0% 'with tools' benchmark result; use it liberally. |
| list_entitiesA | Enumerate every face, edge, and vertex of every body in a Part Studio with deterministic IDs you can drop into subsequent feature payloads. Each entity has a human-readable 'description' like 'plane / outward +Z / origin (0.0,0.0,15.0) mm' or 'cylinder / radius 5.00 mm / origin ... mm' so you can pick the right one by reading rather than geometric reasoning. Call this after ANY feature that creates or modifies bodies, before sketching on a face, filleting an edge, mating to a face, or otherwise referencing picked geometry. IDs (JHK, JNC, JHl, ...) are the 'deterministicIds' you put in a BTMIndividualQuery-138 query entry. FILTERS (all optional; prune BEFORE serialization so responses stay small on complex parts): |
| describe_part_studioA | One-shot snapshot of a Part Studio's entire design state. Returns BOTH a structured text representation (feature tree with statuses, body topology with every face and edge classified by type + deterministic ID + coordinates, bounding box, mass properties) AND the multi-view rendered images (iso/top/front/right by default). Use this INSTEAD OF chaining get_features + list_entities + render_part_studio_views + get_mass_properties after every mutation. The text is what you reason over (reliable for you). The images catch visual regressions the text misses. Image_ids returned in the text can be cropped via crop_image. |
| measureA | Numeric distance + angle between two entities (faces/edges/vertices) picked by deterministic ID. Use this instead of eyeballing a render when you need precise geometric facts: 'are these faces parallel?', 'what's the distance between the top face and the hole floor?', 'is this edge perpendicular to that plane?'. Input: two IDs from list_entities. Returns point_distance_m, angle_deg, parallel/perpendicular flags, and when applicable a projected plane-to-plane or point-to-plane distance. Always prefer this over visual inspection for precision-sensitive decisions. |
| get_mass_propertiesA | Mass properties (volume, mass, center of mass, principal inertia, bbox) for every body in a Part Studio, or a specific part if partId is given. Values come as [min, mean, max] uncertainty triples. Mass is zero unless a material is assigned; volume and centroid are always meaningful. |
| list_cached_imagesA | List every image currently in the in-process render cache with its metadata (view, source part studio, dimensions, crop lineage). Use to recover an image_id you need to crop or re-render, or to audit what you've looked at so far. |
| write_featurescript_featureA | Paradigm escape hatch. Author an arbitrary FeatureScript custom feature (threads, helices, shells, drafts, sweeps along a path, patterns along a curve -- anything our primitives can't express) and apply it to a Part Studio in one call. The system creates a Feature Studio element in the same workspace, uploads your source, confirms it compiles, fetches the sourceMicroversionId, and instantiates a BTMFeature-134 with the correct
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 69 tools
Most tools are clearly separated by action and resource, but there are several overlapping clusters: create_sketch can express what the create_sketch_rectangle/circle/line/arc primitives do, and list_entities, get_body_details, and get_face_coordinate_system all cover face-geometry inspection. The detailed descriptions help an agent choose, but the boundaries are not always crisp.
The set overwhelmingly follows a verb_noun snake_case pattern: create_* for features, get_*/list_* for queries, export_*/render_* for outputs. Minor deviations like create_rounded_rectangle_sketch (vs create_sketch_rectangle) and eval_featurescript (abbreviated verb) keep it from being perfectly uniform.
At 69 tools this is far beyond the well-scoped 3-15 range and even beyond the 16-25 heavy band. Many narrow helpers—five sketch primitives, multiple image/render utilities, and several overlapping geometry inspectors—could be consolidated. The broad CAD domain justifies some size, but the surface is still too large for an agent to navigate efficiently.
The domain is well covered end-to-end: document lifecycle, part studios, sketches, parametric features, assemblies, mates, geometry queries, rendering, export, and a FeatureScript escape hatch. Gaps are minor and mostly workaround-able, such as no document rename/update, no dedicated mate update tool, and no material assignment for meaningful mass properties.