onshape-mcp

v0.1.0
onshape-mcp Checked 4 days ago Published 2 months ago

MCP server that drives the Onshape web UI — sketch, dimension, constrain and extrude from any MCP client.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

screenshot

Take a screenshot of the current Onshape viewport. Returns the absolute file path.

ParameterTypeDescription
namestring

describe_view

Screenshot + ask Gemini vision to describe what's in the viewport.

ParameterTypeDescription
questionstring

tool_datasheet

Return the entire Onshape tool vocabulary, parameters, and preconditions as markdown.

journal_tail

Return the last N actions executed against Onshape.

ParameterTypeDescription
ninteger

open_doc

Navigate to an Onshape document URL or path.

ParameterTypeDescription
url *string

viewport_size

Return the current viewport dimensions in pixels.

onshape_view_fit

Zoom and pan to fit all visible geometry in the viewport ('f').

onshape_view_top

Orient camera to look directly at the Top view.

onshape_view_front

Orient camera to look directly at the Front view.

onshape_view_iso

Orient camera to Isometric view.

onshape_create_sketch

Create a complete 2D sketch with one or more shapes/entities on a plane. This is the primary sketching tool for AI agents. It opens a sketch on the specified plane ('Top', 'Front', or 'Right'), draws all specified shapes in Cartesian millimetre coordinates ((0,0) at origin, +X right, +Y up), and commits the sketch to the Part Studio. Supported shapes in `shapes`: - {"type": "rectangle", "width_mm": 50, "height_mm": 30, "center_x": 0, "center_y": 0, "centered": true} - {"type": "circle", "diameter_mm": 20, "center_x": 0, "center_y": 0} (or "radius_mm") - {"type…

ParameterTypeDescription
name
planestring
shapes

onshape_sketch_start

Open a new sketch. Pass plane name ('Top', 'Front', 'Right') or plane_x/plane_y coordinates. Default plane is 'Top'. Automatically aligns camera normal to the sketch plane.

ParameterTypeDescription
plane
plane_x
plane_y

onshape_sketch_exit

Exit the active sketch and accept (commit=True) or discard (commit=False) changes.

ParameterTypeDescription
commitboolean

onshape_sketch_rectangle

Draw a rectangle. Accepts dimensions (e.g. width='10 cm', height='5 cm'), quadrant ('1', '2', '3', '4'), or centered=True. Dimensions are automatically driven into Onshape's solver.

ParameterTypeDescription
centered
corner1_x
corner1_y
corner2_x
corner2_y
height
quadrant
width

onshape_sketch_circle

Draw a circle of radius_mm. Pass center coordinates in mm (center_x, center_y) or centered=True for the origin. The radius is driven into Onshape's solver.

ParameterTypeDescription
center_x
center_y
centered
radius_mmnumber

onshape_sketch_line

Draw a line segment from (p1_x, p1_y) to (p2_x, p2_y).

ParameterTypeDescription
p1_x *number
p1_y *number
p2_x *number
p2_y *number

onshape_sketch_polygon

Draw an inscribed or circumscribed polygon with N sides and radius.

ParameterTypeDescription
center_x
center_y
circumscribedboolean
radius_mmnumber
sidesinteger

onshape_sketch_spline

Draw a smooth spline curve through a list of [[x1, y1], [x2, y2], ...] points.

ParameterTypeDescription
points *array

onshape_sketch_arc

Draw a 3-point arc from (p1_x, p1_y) to (p2_x, p2_y) passing through (radius_x, radius_y).

ParameterTypeDescription
p1_x *number
p1_y *number
p2_x *number
p2_y *number
radius_x
radius_y

onshape_sketch_point

Place a sketch point at (x, y).

ParameterTypeDescription
x *number
y *number

onshape_m4_profile

Create an exact, closed M4 socket-head cap-screw half-profile on Front. Uses the authenticated Onshape Feature API rather than pixel sizing and returns measured segment endpoints/lengths. It does not perform the revolve.

ParameterTypeDescription
length_mmnumber

onshape_sketch_text

Place sketch text in a box defined by corner1 and corner2.

ParameterTypeDescription
corner1_x *number
corner1_y *number
corner2_x *number
corner2_y *number
text *string

onshape_sketch_construction

Toggle construction mode, or convert the entity at (x, y) to/from construction geometry ('q').

ParameterTypeDescription
x
y

onshape_sketch_fillet

Add a rounded 2D fillet of radius_mm at corner/vertex (vertex_x, vertex_y).

ParameterTypeDescription
vertex_x *number
vertex_y *number
radius_mmnumber

onshape_sketch_chamfer

Add a 2D chamfer of distance_mm at corner/vertex (vertex_x, vertex_y).

ParameterTypeDescription
vertex_x *number
vertex_y *number
distance_mmnumber

onshape_sketch_trim

Trim a curve segment back to the nearest intersections by clicking at (x, y) ('m').

ParameterTypeDescription
x *number
y *number

onshape_sketch_extend

Extend a curve endpoint at (x, y) to the nearest boundary ('x').

ParameterTypeDescription
x *number
y *number

onshape_sketch_offset

Offset curve at (entity_x, entity_y) by distance_mm toward optional side (side_x, side_y) ('o').

ParameterTypeDescription
entity_x *number
entity_y *number
distance_mmnumber
side_x
side_y

onshape_sketch_mirror

Mirror an entity at (entity_x, entity_y) across a centerline at (centerline_x, centerline_y).

ParameterTypeDescription
centerline_x *number
centerline_y *number
entity_x *number
entity_y *number

onshape_sketch_dimension

Drive an Onshape sketch dimension ('d'). Clicks entity at (entity_x, entity_y), places label at (label_x, label_y), and enters value_mm into the solver.

ParameterTypeDescription
entity_x *number
entity_y *number
label_x *number
label_y *number
value_mm *

onshape_sketch_constrain

Apply a geometric constraint across entities. Valid types: coincident, concentric, parallel, tangent, horizontal, vertical, perpendicular, equal, midpoint, normal, pierce, symmetric, fix.

ParameterTypeDescription
constraint_type *string
entities *array

onshape_feature_extrude

Extrude the active sketch or selected face by depth_mm.

ParameterTypeDescription
depth_mm

onshape_feature_fillet

Round selected 3D model edges by radius_mm.

ParameterTypeDescription
radius_mm

onshape_feature_chamfer

Bevel selected 3D model edges by distance_mm.

ParameterTypeDescription
distance_mm

onshape_execute

Generic tool dispatcher. Calls any registered tool by name with arguments. Returns clear public error messages if a tool is un-bound or fails.

ParameterTypeDescription
tool *string
args

act

Autonomous CAD agent. Takes a high-level goal in natural language (e.g. 'draw a 10cm by 5cm box in Quadrant 1 on the top plane', 'draw a 6-sided polygon') and executes it. Tries deterministic fast execution first (10-20s), falling back to vision loop if ambiguous.

ParameterTypeDescription
goal *string
max_stepsinteger

onshape_feature_delete

Delete a feature or sketch by name (e.g. 'Sketch 1', 'Sketch 2', 'Extrude 1') from the Part Studio tree.

ParameterTypeDescription
name *string

onshape_features_delete_all

Delete all features from the Part Studio tree.

onshape_feature_revolve

Revolve the latest sketch region around an axis into a solid 3D part.

ParameterTypeDescription
angle_degnumber

onshape_feature_edit

Open an existing feature or sketch (e.g. 'Sketch 1') for editing.

ParameterTypeDescription
name *string

onshape_features_list

List all features currently in the Part Studio tree.

onshape_undo

Undo the last action in Onshape.

onshape_redo

Redo the last undone action in Onshape.

onshape_workflow

Visible, one-step-at-a-time UI editing. Returns JSON evidence plus an inline frame. begin accepts a stable request_id and steps [{tool,args,space}]. next runs ONE step. pause is action-boundary; revise replaces pending steps; handoff/resume synchronize manual edits. restore recovers a paused request after restart without replaying uncertain actions. cancel retains geometry; undo attempts one checkpoint-verified native sketch undo. status lists persisted entities/constraints. Completion is execution, not precision verification.

ParameterTypeDescription
command *string
goalstring
request_idstring
steps

onshape_frame

Return an actual inline image of the shared canvas, not just a filesystem path. Use workflow status to obtain the latest frame_id for point-and-talk selection.

onshape_select_target

Preview a named screen target from the latest frame. Coordinates are viewport pixels. Ask the user to confirm the marker, then queue selection.edit with handle and confirmed=true. Bind IDs from workflow status when available; never invent IDs or reuse a stale handle.

ParameterTypeDescription
frame_id *string
label *string
x *number
y *number
entity_id
feature_id

onshape_verify_dimension

Read back a persisted length constraint by exact IDs and check its solver status. Read-only API inspection; performs no FeatureScript and no geometry creation. Uncommitted, missing or expression-valued dimensions are not reported as verified.

ParameterTypeDescription
constraint_id *string
feature_id *string
value_mm *number
tolerance_mmnumber