solidworks-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SOLIDWORKS_MCP_CONFIG | No | Path to the TOML configuration file. If unset, the server looks for `solidworks-mcp.toml` in its working directory, then `%APPDATA%\solidworks-mcp\config.toml`. | |
| SOLIDWORKS_MCP_ALLOW_MACRO | No | Set to `1` to enable the `execute_solidworks_macro` tool, or `0` to disable it. Overrides the `[macro] enabled` setting in the config file. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Server that drives SolidWorks on the user's PC. Rules:
Every tool dimension is in millimetres, every angle in degrees.
Typical flow for a part: new_part -> select_plane -> start_sketch -> sketch_rectangle / sketch_circle / sketch_line / ... -> extrude (or cut_extrude for pockets) -> hole, fillet, chamfer, patterns -> set_material -> get_screenshot or get_bounding_box to check.
To work on an existing face: select_face_at_point (mm coordinates of a point on the face) then start_sketch. start_sketch reports how the sketch axes map to the model; convert_point converts between model and sketch coordinates.
Sketch tools take SKETCH coordinates (x, y); tools that pick faces, edges or vertices (fillet, chamfer, shell, hole, measure, ...) take MODEL coordinates [x, y, z] of a point lying exactly on the entity. Do not guess them: list_faces and list_edges (optionally for one feature, or one type such as cylinder / circle) give a point_mm on each face and edge, with normals, diameters and axes.
Existing work: open_document opens a saved part (relative paths are in the projects folder), list_open_documents / activate_document / close_document manage the windows. edit_sketch reopens a sketch (finish with end_sketch), edit_feature changes an extrusion or cut, set_dimension any other dimension, rename_feature gives clear names. save_document(new_version=True) saves the next version (v2, v3...) of the file.
Features are referred to by the names shown by get_feature_tree; every tool that creates one returns its name.
The user may be working in SolidWorks too: call get_active_document_info before modifying, to be sure the active document is the one you expect.
On error use undo, then retry. get_feature_tree shows what is in the model.
export_document writes the exchange formats configured by the user (STEP by default).
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_active_document_infoA | Name, path and type of the active SolidWorks document, and the SolidWorks version. Starts SolidWorks if it is not running. |
| get_mass_propertiesA | Mass, volume, surface area and centre of mass of the active document (part or assembly). |
| get_feature_treeA | List of the features of the active document (design tree), with the type of each. |
| get_bounding_boxA | Bounding box of the solid bodies of the active part: min/max on X, Y, Z and overall size, in mm. |
| check_modelA | Checks the active part for rebuild errors, multiple bodies, and geometry faults. |
| get_screenshotA | PNG image of the active model, to check the result visually. Changes the view orientation (unless view='current') and zooms to fit; the model is not modified. |
| new_partB | Creates a new empty part from the default SolidWorks part template. |
| save_documentA | Saves the active document. With 'path' (e.g. C:\projects\part.SLDPRT, .step, .stl, .pdf...) saves/exports to that file: the format is taken from the extension. When the user has set a projects folder, relative paths are confined to it and missing folders inside it are created. If the target file already exists, overwrite must be True or the save is rejected. new_version=True (no path) saves the document as the next version next to its current file (bracket_v1_base.SLDPRT -> bracket_v2_base.SLDPRT), never overwriting: the open document then becomes the new file and the previous version is kept unchanged. Without path or new_version, the document's own file is overwritten. |
| export_documentA | Exports the active document to exchange formats, next to the document or in 'directory'. Existing files with the same name are replaced. formats: e.g. ["step", "stl"]; omit to use the formats set by the user in the configuration (STEP by default). Supported: step, stp, iges, igs, x_t, stl, 3mf, pdf, png, dxf, dwg (pdf, dxf and dwg for drawings). directory: absolute, or relative to the folder of the document; "{format}" is replaced by the format name. Omit to use the configured directory. Created if missing. Files are named after the document. The open document is left untouched. |
| open_documentA | Opens a part, assembly or drawing (.SLDPRT / .SLDASM / .SLDDRW) and makes it the active document, to continue work on it. A relative path is relative to the projects folder. If the file is already open it is just brought to the front. read_only=True opens it so that it cannot be saved over. The file itself is not modified. Starts SolidWorks if needed. |
| list_open_documentsA | Documents open in SolidWorks: title, path, type, whether they have unsaved changes, whether they have a window (parts loaded only by an assembly have none) and which one is active. |
| activate_documentA | Makes an open document the active one (brings its window to the front), by title, file name or full path as shown by list_open_documents. Every other tool works on the active document. |
| close_documentA | Closes a document (by title, file name or path; empty = the active one). With unsaved changes it refuses, unless save=True (saves over its own file first, which must be inside the projects folder) or discard_changes=True (the unsaved changes are LOST). |
| new_assemblyB | Creates a new empty assembly in SolidWorks using the default or given assembly template. |
| insert_componentA | Inserts a part or sub-assembly (a .SLDPRT / .SLDASM file, relative to the projects folder when one is set) into the active assembly, with the component's origin at (x, y, z) mm and no rotation. The file is opened in the background if it is not already open, and its window is closed again afterwards. |
| add_mateA | Adds a geometric mate constraint between two components in the active assembly. Specify entities either by 3D points [x, y, z] mm in assembly coordinates lying on the faces/edges, or by entity names (e.g. 'Plane1@Part1-1@Assembly1'). Supported mate types: coincident, concentric, parallel, perpendicular, tangent, distance, angle. The components move to satisfy the mate. Replaces the current selection. |
| check_interferenceA | Checks the active assembly for volumetric interferences (collisions) between components. |
| new_drawingB | Creates a new 2D drawing from the currently active part or assembly document. Generates 3 standard 3rd-angle projection views (Front, Top, Right) and an Isometric view. |
| insert_model_dimensionsA | Inserts model dimensions marked for drawing across all views in the active 2D drawing. |
| list_configurationsA | Lists all configurations in the active part or assembly document, indicating the active one. |
| activate_configurationA | Activates an existing configuration by name in the active part or assembly. |
| add_configurationB | Adds a new configuration to the active part or assembly document and activates it. |
| select_planeA | Selects a plane: one of the base planes "front" (XY), "top" (XZ), "right" (YZ), which works with SolidWorks in any language, or a plane by name (e.g. one made by create_plane). |
| select_face_at_pointA | Selects the face of the part passing through the point (x, y, z) in mm, model coordinates. Use get_bounding_box to find the coordinates of the outer faces. |
| select_edge_at_pointA | Selects the edge of the part passing through the point (x, y, z) in mm, model coordinates. append=True adds it to the current selection. Tools such as fillet and chamfer take the points directly, so this is mostly useful to check that a point really lies on an edge. |
| list_facesA | Faces of the active part (or only those created by 'feature'), each with its type, a point lying ON it (point_mm, model coordinates: pass it to select_face_at_point, hole, shell, fillet face_points, create_plane face_point...), area, outward normal of planar faces, and diameter / axis of cylinders (concave=True for holes). Use it instead of guessing coordinates. |
| list_edgesA | Edges of the active part (or only those of the faces created by 'feature'), each with its type, its mid-point (point_mm, lying ON the edge: pass it to fillet / chamfer edge_points, select_edge_at_point, circular_pattern axis_edge_point...), length, end points, and centre / diameter of circles and arcs. Use it instead of guessing coordinates. |
| start_sketchA | Opens a new sketch on the selected plane or face. |
| convert_pointA | Converts a point between model coordinates and the coordinates of the open sketch. to="sketch": (x, y, z) is a model point, returns its sketch (x, y) and its distance from the sketch plane. to="model": (x, y) is a sketch point (z ignored), returns the model point. |
| end_sketchA | Closes the open sketch without creating a feature. |
| sketch_rectangleA | Draws a rectangle in the open sketch, given centre and size (mm). |
| sketch_circleA | Draws a circle in the open sketch, given centre and DIAMETER (mm). |
| sketch_lineA | Draws a line in the open sketch between two points (mm). construction=True creates a construction line (e.g. the axis of a revolve). |
| sketch_polygonA | Draws a regular polygon (e.g. hexagon: sides=6) inscribed in a circle of the given diameter (mm): the vertices lie on the circle (for a hexagon, the diameter is the distance across corners). |
| sketch_arcC | Draws an arc given centre, start point and end point (mm). |
| sketch_slotA | Draws a straight slot (two half circles joined by lines) in the open sketch, given the centres of its two ends and its width (mm). |
| sketch_ellipseA | Draws an ellipse in the open sketch, given its two diameters (mm). rotation_deg turns the major axis counterclockwise from the sketch X axis. |
| sketch_splineA | Draws a smooth spline through the points [[x, y], ...] of the open sketch (mm, at least 2). Repeat the first point at the end to close it. |
| sketch_filletA | Rounds the corner of the open sketch at (x, y) (the point where two entities meet) with the given radius (mm). |
| sketch_offsetA | Offsets the chain of connected sketch entities passing through (x, y) by distance_mm. reverse=True offsets to the other side; both_sides=True offsets to both sides. |
| convert_entitiesA | Projects edges of the model into the open sketch (Convert Entities): all the edges of each face with a point in face_points, and each edge with a point in edge_points ([x, y, z] in mm, model coordinates). The new sketch entities follow the model when it changes. |
| sketch_pointB | Adds a sketch point at (x, y) mm in the open sketch (e.g. a reference for dimensions or a hole position). |
| sketch_trimA | Trims the sketch entity through (x, y) in the open sketch back to its nearest intersections with other entities: the piece you point at is removed (like Trim to closest). An entity that crosses nothing is deleted entirely. Replaces the selection. |
| sketch_mirrorA | Mirrors sketch entities of the open sketch about a construction line (sketch_line with construction=True). entity_points: [[x, y], ...] one point on each entity to mirror; mirror_line_point: [x, y] a point on the construction line. Replaces the selection. |
| sketch_linear_patternA | Repeats sketch entities of the open sketch in a row or a grid (e.g. a row of holes before one cut). entity_points: [[x, y], ...] one point on each entity. count_x copies spacing_x_mm apart along the direction at angle_x_deg from sketch X; count_y / spacing_y_mm / angle_y_deg add a second direction. Replaces the selection. |
| sketch_circular_patternA | Repeats sketch entities of the open sketch around a centre (e.g. bolt holes on a flange before one cut). entity_points: [[x, y], ...] one point on each entity; the copies are spread evenly over angle_deg around (center_x_mm, center_y_mm). The entities' centre is computed (for a circle: its centre); give reference_x_mm / reference_y_mm to set it explicitly. rotate=False keeps the copies' orientation. Replaces the selection. |
| delete_sketch_entityA | Deletes sketch entities of the open sketch: one [x, y] point on each, in sketch coordinates. Their relations and dimensions are deleted with them. |
| edit_sketchA | Reopens an existing sketch (name from get_feature_tree, e.g. "Sketch1") to change it with the sketch tools; a sketch already open is closed first. Close it with end_sketch: the features built on it then update. |
| fully_define_sketchA | Adds the relations and dimensions (measured from the sketch origin) that the open sketch needs to be fully defined, so it keeps its shape and can be edited later through its dimensions (get_dimensions / set_dimension). |
| add_sketch_dimensionA | Adds a driving dimension to the open sketch and sets it to 'value' (mm, or degrees for angles). (x, y): a point on the entity (sketch coordinates). One entity: length of a line, diameter of a circle, radius of an arc. With (x2, y2) on a second entity: distance between them, or the angle between two lines. (text_x, text_y) places the text (default: next to the entity). |
| add_sketch_relationB | Adds a geometric relation between sketch entities of the open sketch. points: [[x, y], ...] one point (sketch coordinates) on each entity involved. vertex: optional, one flag per point; true picks the sketch POINT there (an end point or centre) instead of the line/arc, as needed by coincident and midpoint (point first). |
| extrudeA | Extrudes the last sketch as a solid (closing it automatically if open). end_condition: blind = depth_mm on one side; midplane = depth_mm split on both sides; through_all = through the existing solid; up_to_surface = up to the face through up_to_point ([x, y, z] in mm, model coordinates). depth2_mm > 0 also extrudes that far in the opposite direction (not with midplane). draft_angle_deg tapers the sides (inwards, or outwards with draft_outward=True). thin_wall_mm > 0 makes a thin wall of that thickness along the profile instead of filling it; open profiles (e.g. a chain of lines) are then allowed. merge=False keeps the result as a separate body. |
| cut_extrudeA | Extruded cut (holes, pockets) with the last sketch. through_all=True goes right through (depth_mm ignored). reverse flips the direction; flip_side removes the material OUTSIDE the profile. up_to_point ([x, y, z] in mm on a face) cuts up to that face instead. depth2_mm > 0 also cuts that far in the opposite direction. draft_angle_deg tapers the walls (inwards, or outwards with draft_outward=True). |
| revolveA | Revolves the last sketch around the construction line it contains (create it with sketch_line construction=True). cut=True removes material instead of adding it. |
| ribA | Rib from the last sketch: usually an open line between walls of the part, drawn on a plane through the middle of the rib. thickness_mm is the total thickness, centred on the sketch unless one_side=True. direction: parallel = material grows in the sketch plane, normal = perpendicular to it. flip_material flips the side towards which material is added if the rib does not reach the part. |
| sweepA | Sweeps a profile along a path (pipes, springs, handles, grooves). path_sketch: name of the sketch with the path (open or closed curve). profile_sketch: name of the closed profile sketch, drawn on a plane crossing the start of the path; or leave it empty and give circle_diameter_mm for a round section. cut=True removes material instead of adding it. Close the sketches first (end_sketch). |
| loftA | Loft through two or more closed profiles drawn on different planes (see create_plane), in order. guide_sketches: optional guide curves touching every profile. cut=True removes material instead of adding it. Close the sketches first (end_sketch). |
| create_planeA | Creates a reference plane and returns its name, to use with select_plane. Three modes: offset (default): parallel to 'reference' ("front", "top", "right" or a plane name) or to the planar face through face_point ([x, y, z] mm), offset_mm away; flip=True for the other side. angle: angle_deg > 0 turns the plane by that angle from 'reference' (or the face) about an axis lying in it or parallel to it: axis = "x", "y", "z" (model axes) or the name of a reference axis, or axis_edge_point = a point on a straight edge. flip reverses the angle. through_points: three vertices [[x, y, z], ...] of the part (corners), in mm. Using a model axis the first time adds a hidden reference axis to the tree. |
| create_axisA | Creates a reference axis, e.g. for a circular pattern, a revolve or an angled plane: face_point = a point on a cylindrical or conical face (its axis, e.g. the axis of a hole); edge_point = a point on a straight edge; or planes = two plane names / "front", "top", "right" (their intersection). name renames it. Returns its name. |
| draftA | Tilts faces by angle_deg (draft for moulding or casting), pivoting about a neutral plane: neutral_plane = "front", "top", "right" or a plane name, or neutral_face_point = a point on a planar face of the part (e.g. the parting face). face_points: a point on each face to tilt ([x, y, z] mm, model coordinates; see list_faces). flip reverses the pull direction. |
| filletA | Rounds edges with a constant radius. edge_points: a point on each edge ([x, y, z] in mm, model coordinates); face_points: a point on each face whose edges are all rounded. Edges tangent to the chosen ones are rounded too. |
| chamferA | Bevels edges. edge_points / face_points as for fillet. Default: distance_mm at angle_deg (45 = equal sides). With distance2_mm > 0 the two sides are distance_mm and distance2_mm (angle ignored); flip swaps the sides of an unequal chamfer. |
| shellA | Hollows the part leaving walls thickness_mm thick. open_face_points: a point on each face to remove ([x, y, z] in mm), e.g. the top of a box; none gives a closed hollow part. outward=True adds the walls outside the current surfaces. |
| linear_patternA | Repeats features (names from get_feature_tree) in a row along a model axis: count copies in total (original included), spacing_mm apart, towards + (or - with reverse). direction2/count2/spacing2_mm add a second direction for a grid. The first use of an axis adds a hidden reference axis "Axis X (MCP)" (Y, Z) to the tree. |
| circular_patternA | Repeats features (names from get_feature_tree) around an axis: count copies in total (original included), spread evenly over angle_deg. axis: a model axis through the origin, or "edge" to turn around the circular or straight edge through axis_edge_point ([x, y, z] in mm, e.g. on the rim of a central hole). The first use of a model axis adds a hidden reference axis "Axis Z (MCP)" (X, Y) to the tree. |
| mirrorB | Mirrors features (names from get_feature_tree) about a plane: "front", "top", "right", a plane name, or the planar face through face_point ([x, y, z] in mm). |
| holeA | Drills round holes into a planar face, perpendicular to it. centers: the hole centres [[x, y, z], ...] in mm, model coordinates, all on the SAME face (the face is found through the first one). size: metric screw size ("M3" ... "M24") with fit: close / normal / loose clearance hole (ISO 273) or tapped = tap drill diameter; or give diameter_mm. depth_mm or through_all=True. style: counterbore / countersink for socket head screws; with a metric size their dimensions are standard (ISO 4762 / ISO 10642, 90 degrees), otherwise give them. thread=True (with a metric size, fit="tapped", style="simple") adds a cosmetic thread to each hole (e.g. M6x1, shown in drawings and the thread callout), over thread_depth_mm or the whole hole. |
| base_flangeA | Creates a sheet metal base flange from the last sketch (the one open, or the last closed one): an open chain of lines gives a bent sheet extruded depth_mm, a closed profile gives a flat tab. Adds the Sheet-Metal and Flat-Pattern features to the tree. The sheet grows on one side of the sketch lines (the other with reverse_thickness=True). |
| edge_flangeA | Bends a flange of length_mm along a straight edge of a sheet metal part (made with base_flange): edge_point_mm is a point [x, y, z] in mm on that edge, or the edge selected with select_edge_at_point is used. The flange is as wide as the edge; radius_mm = 0 uses the bend radius of the part. Replaces the current selection. |
| export_flat_patternA | Exports the flat pattern of the active sheet metal part to a DXF file. Existing files with the same name are replaced. path: absolute path or relative filename for the DXF export. Omit to export next to the part. |
| list_materialsA | Materials available in the SolidWorks material databases, filtered by 'search' (part of the name or category, e.g. "6061", "steel", "abs"). Use the exact name with set_material. |
| set_materialA | Assigns a material to the active part (exact name, see list_materials), so that get_mass_properties gives the real mass. |
| get_dimensionsA | Dimensions of a feature or sketch (or of the whole part when 'feature' is empty), with their full names (e.g. D1@Boss-Extrude1) and values in mm or degrees, for set_dimension. |
| set_dimensionA | Changes a dimension (name from get_dimensions, e.g. "D1@Boss-Extrude1") to 'value' (mm, degrees for angles, a plain number for counts such as pattern instances) and rebuilds. |
| suppress_featureA | Suppresses (temporarily removes from the model, keeping it in the tree) or, with suppressed=False, restores a feature. |
| get_equationsB | Global variables and equations of the active document, with their index. |
| add_equationA | Adds a global variable or an equation and rebuilds. Names go in double quotes, e.g. '"width" = 80' (global variable), '"D1@Boss-Extrude1" = "width" / 2' (drives a dimension). Numbers without units take the document units. |
| delete_equationB | Deletes the equation with that index (see get_equations). |
| get_custom_propertiesB | Custom properties of the active document (description, part number, ...), as used in BOMs and title blocks. |
| set_custom_propertyA | Sets a custom property of the active document (created if missing). Replaces the current value. An empty value deletes it. |
| measureA | Measures one entity (area, length, diameter...) or the distance and angle between two, picked by a point lying on each ([x, y, z] in mm, model coordinates). Replaces the current selection. |
| undoC | Undoes the last operations in SolidWorks. |
| delete_featureB | Deletes a feature from the tree by name (see get_feature_tree). |
| edit_featureA | Changes an existing extrusion or extruded cut (name from get_feature_tree) and rebuilds: depth_mm, end_condition (blind / through_all / midplane), reverse (direction), depth2_mm (second direction, 0 removes it). Only the values given are replaced. For other features change their dimensions with get_dimensions / set_dimension. |
| rename_featureA | Renames a feature or sketch of the active part (e.g. "Boss-Extrude1" -> "Base plate"), so the tree is readable and dimensions get meaningful names (D1@Base plate). |
| zoom_to_fitA | Fits the view to show the whole model. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| design_part | Guidance and recommended workflow for modeling a 3D part in SolidWorks |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| resource_active_info | Active SolidWorks document information and version |
| resource_feature_tree | Active SolidWorks document feature tree |
| resource_materials | Available SolidWorks material databases and categories |
TDQS
Scored across 86 tools
Most tools have a recognizable domain (sketching, features, assemblies, drawings), but the large surface creates several overlapping or easily confused pairs: save_document vs export_document vs export_flat_pattern, sketch_fillet vs fillet, sketch_circular_pattern vs circular_pattern, add_sketch_dimension vs set_dimension, and measure vs get_dimensions. Descriptions help clarify boundaries, but an agent still has to choose carefully among many similarly themed operations.
Many tools follow a clear verb_noun pattern (create_plane, list_faces, set_material, delete_feature), but a substantial number are noun-only or adjective-first (extrude, fillet, hole, shell, mirror, measure, undo, base_flange, new_part). The names are readable, but the convention is mixed enough that the set does not feel fully predictable.
Eighty-six tools is far too many for efficient agent selection, even for a complex CAD domain. While many operations are meaningful, the surface is heavy and should be consolidated or grouped into fewer higher-level tools.
Coverage is broad and deep: sketches, features, assemblies, drawings, sheet metal, configurations, materials, equations, custom properties, and exports are all represented. Minor gaps remain in areas like drawing annotation/views and assembly-level lifecycle operations, but core workflows are well covered.