@polypad/mcp 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +25 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34809,25 +34809,25 @@ var inputs = {
34809
34809
  };
34810
34810
  var descriptions = {
34811
34811
  new_project: "Start a new, empty Polypad project (optionally from a template), replacing the open one. All lengths in Polypad are millimetres and angles are degrees; Z is up.",
34812
- set_parameter: "Create or change a named parameter (a number or an expression). Any length field of any feature can use the name, so one change resizes everything bound to it. Reports features that no longer build.",
34812
+ set_parameter: "Create or change a named parameter (a number or an expression). Any length field of any feature can use the name, so one change resizes everything bound to it. Reports features that no longer build. Set the sizes up front, then use the names in fields.",
34813
34813
  add_primitive: "Add a solid box, cylinder, sphere or cone as a new body. Returns the new feature's id, which is also the body id for later commands. Sizes in mm.",
34814
34814
  add_sketch: "Add a 2D sketch on a base plane or on a flat face and draw shapes in it (rectangle, circle, line, polyline, arc, slot, polygon). The sketch is solved and its remaining degrees of freedom reported. Use extrude or revolve to turn closed shapes into a solid.",
34815
34815
  extrude: "Extrude the closed shapes of a sketch into a solid: as a new body, or cut from / joined to an existing body. Returns the feature id (the new body's id when mode is new).",
34816
- revolve: "Revolve the closed shapes of a sketch about an axis in the sketch plane to make a solid of revolution: new body, or cut / join with an existing body.",
34817
- combine: "Boolean-combine bodies: union, subtract (remove the tools from the target) or intersect. The target keeps its id; the tools are consumed.",
34818
- hole: "Drill a screw hole (M2 to M10, with clearance, tap or heat-set insert fit and optional counterbore / countersink) into a flat face. Call list_faces first and pass the face index and its rebuildId.",
34819
- fillet: "Round the given edges of a body with a radius. Call list_edges first and pass the edge indices and their rebuildId.",
34820
- chamfer: "Bevel the given edges of a body. Call list_edges first and pass the edge indices and their rebuildId.",
34821
- shell: "Hollow out a body, leaving the given faces open, with walls of a given thickness. Call list_faces first and pass the face indices and their rebuildId.",
34822
- pattern: "Repeat a body in a row or grid, or around an axis, either fusing the copies into the body or making each copy a body of its own.",
34823
- mirror: "Mirror a whole body across a plane (yz, xz or xy, optionally moved along its normal), joining the copy into the body or making it a separate body.",
34816
+ revolve: "Revolve the closed shapes of a sketch about an axis in the sketch plane to make a solid of revolution: new body, or cut / join with an existing body. Use it for round parts: draw half the outline beside the axis.",
34817
+ combine: "Boolean-combine bodies: union, subtract (remove the tools from the target) or intersect. The target keeps its id; the tools are consumed. To hollow a body use shell, not a subtracted box; to check a collision, intersect two bodies, measure the result, then undo.",
34818
+ hole: "Drill a screw hole (M2 to M10, with clearance, tap or heat-set insert fit and optional counterbore / countersink) into a flat face. Call list_faces first and pass the face index and its rebuildId. Use this for every screw, standoff or insert hole instead of cutting circles.",
34819
+ fillet: "Round the given edges of a body with a radius. Call list_edges first (narrow it with its filter) and pass the edge indices and their rebuildId. If it fails, try a smaller radius or fewer edges.",
34820
+ chamfer: "Bevel the given edges of a body. Call list_edges first (narrow it with its filter) and pass the edge indices and their rebuildId. If it fails, try a smaller distance or fewer edges.",
34821
+ shell: "Hollow out a body, leaving the given faces open, with walls of a given thickness. Call list_faces first and pass the face indices and their rebuildId. Use this for enclosures and cups instead of subtracting a smaller box; list_faces with filter normal finds the face to open.",
34822
+ pattern: "Repeat a body in a row or grid, or around an axis, either fusing the copies into the body or making each copy a body of its own. Model one copy (or one cutter) and pattern it instead of adding copies by hand.",
34823
+ mirror: "Mirror a whole body across a plane (yz, xz or xy, optionally moved along its normal), joining the copy into the body or making it a separate body. Model one side of a symmetric part, then mirror it.",
34824
34824
  move: "Move, rotate and/or scale a whole body (translate in mm, rotate in degrees about X, Y, Z around a pivot).",
34825
- update_feature: "Change fields of an existing feature (for example an extrude's distance or a box's width); everything after it rebuilds. The change is refused, and the project left as it was, if the result is not a valid model.",
34825
+ update_feature: "Change fields of an existing feature (for example an extrude's distance or a box's width); everything after it rebuilds. The change is refused, and the project left as it was, if the result is not a valid model. Prefer this over deleting and rebuilding a feature.",
34826
34826
  delete_feature: "Delete a feature. Refused while other features still use it; delete those first.",
34827
34827
  undo: "Undo the last change made to the project. Can be repeated.",
34828
34828
  get_project: "Describe the whole project: parameters, every feature in order (id, name, type, main values, whether it built or the error), and every body (volume, area, bounding box). Start here, and call it again after changes to check the result.",
34829
- list_faces: "List the faces of a body: index, flat or curved, normal, centre, area, and for flat faces the sketch frame (origin, x and y axes) with the face's bounds in it. The indices go into hole, shell and add_sketch (face). Returns a rebuildId those commands require.",
34830
- list_edges: "List the edges of a body: index, convex / concave / smooth, length, straight or curved, direction, midpoint, and the faces they border. The indices go into fillet and chamfer. Returns a rebuildId those commands require.",
34829
+ list_faces: "List the faces of a body: index, flat or curved, normal, centre, area, and for flat faces the sketch frame (origin, x and y axes) with the face's bounds in it. The indices go into hole, shell and add_sketch (face). Returns a rebuildId those commands require. A body can have hundreds of faces: use the filter (normal, kind).",
34830
+ list_edges: "List the edges of a body: index, convex / concave / smooth, length, straight or curved, direction, midpoint, and the faces they border. The indices go into fillet and chamfer. Returns a rebuildId those commands require. A body can have hundreds of edges: use the filter (face, direction, kind).",
34831
34831
  measure: "Measure bodies: volume (mm3), surface area (mm2), bounding box (mm) and its centre.",
34832
34832
  render_view: "Render the model to a PNG image from a standard view, to look at the result. Needs the Polypad browser tab."
34833
34833
  };
@@ -35451,12 +35451,23 @@ var SERVER_INSTRUCTIONS = `Polypad is a parametric CAD editor. These tools build
35451
35451
  Units and axes: lengths are millimetres, angles degrees, Z is up. Any length field accepts a number or an expression over the project's parameters ("width / 2"); prefer set_parameter for sizes that belong together.
35452
35452
 
35453
35453
  Workflow:
35454
- 1. Start with get_project to see what is already there (the user may have work open). new_project replaces the open project, so use it only when asked or when the project is empty.
35454
+ 1. Start with get_project to see what is already there (the user may have work open). new_project replaces the open project: if it has features, ask the user first and never call it over their work; use it freely only when the project is empty.
35455
35455
  2. Build with add_primitive, or add_sketch then extrude / revolve. Ids returned by a command are the feature and body ids for later calls.
35456
35456
  3. For hole, shell, fillet, chamfer and for sketching on a face, call list_faces or list_edges first. Pass the indices they return together with the same rebuildId. The rebuildId changes whenever the model changes, so after any change list again; a stale one is refused ("Call list_edges again").
35457
35457
  4. A feature that does not build stays in the project with its error: fix it with update_feature, or remove it with delete_feature or undo.
35458
35458
  5. Check your work: measure gives volume and bounding box, and render_view returns a PNG (iso, top, front, right) so you can look at the result. Compare the numbers with what was asked before you finish.
35459
35459
 
35460
+ Pick the tool by task:
35461
+ - Hollow part (enclosure, box, cup): shell the solid with the open face(s) removed (list_faces with filter normal "+z" finds the top); don't subtract a smaller box.
35462
+ - Screw holes, standoffs, inserts: hole (size, fit close/normal/loose/tap/insert, counterbore or countersink, blind depth), not cut circles.
35463
+ - Repeated parts (rows, grids, around a circle, lattices): model one body, or one cutter body, then pattern it (then combine subtract for a cutter). Symmetric parts: model one side, then mirror.
35464
+ - Round parts (knobs, turrets, finials, domes): add_sketch on XZ (sketch x = world X, sketch y = world Z), draw half the outline at x >= 0, then revolve with axis "y" (the world Z axis).
35465
+ - Sizes that belong together or may change: set_parameter first, then use the names in fields.
35466
+ - Changing or fixing a feature: update_feature (or undo the last step); don't delete and rebuild.
35467
+ - Picking edges: use the list_edges filter (face, direction, kind) and the list_faces filter (normal, kind) instead of reading every edge. For the rim of the top: list_faces normal "+z", then list_edges face <index>.
35468
+ - Fillet fails: try a smaller radius or fewer edges at once, or use chamfer.
35469
+ - Clearances and collisions: measure gives bounding boxes; combine intersect on two bodies, then measure, shows an overlap; then undo.
35470
+
35460
35471
  Results: a result with isError set was refused or something in the model did not build; the text says what and how to fix it. Nothing is changed by a refused call.`;
35461
35472
  function toToolResult(result) {
35462
35473
  const content = [{ type: "text", text: result.text }];
@@ -35485,7 +35496,7 @@ function createPolypadMcp(options = {}) {
35485
35496
  }
35486
35497
 
35487
35498
  // src/index.ts
35488
- var VERSION = true ? "0.1.1" : "0.0.0-dev";
35499
+ var VERSION = true ? "0.1.2" : "0.0.0-dev";
35489
35500
  var err = (line2) => process.stderr.write(`${line2}
35490
35501
  `);
35491
35502
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polypad/mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "MCP server that lets Claude, Cursor or another AI assistant build and inspect 3D models in your open Polypad tab (polypad.ink). Runs locally, nothing is uploaded.",
6
6
  "license": "MIT",