@sknoble/slvsx-mcp-server 0.2.3 → 0.2.4

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/mcp-server.js +100 -0
  2. package/package.json +1 -1
package/mcp-server.js CHANGED
@@ -264,6 +264,22 @@ class SlvsxServer {
264
264
  },
265
265
  required: ['query'],
266
266
  },
267
+ },
268
+ {
269
+ name: 'list_constraints',
270
+ description: 'Get a complete reference of all constraint types with their field names and descriptions. Use this to see all available constraints.',
271
+ inputSchema: {
272
+ type: 'object',
273
+ properties: {},
274
+ },
275
+ },
276
+ {
277
+ name: 'list_entities',
278
+ description: 'Get a complete reference of all entity types (point, line, circle, arc, etc.) with their field names and descriptions.',
279
+ inputSchema: {
280
+ type: 'object',
281
+ properties: {},
282
+ },
267
283
  }
268
284
  ],
269
285
  }));
@@ -292,6 +308,12 @@ class SlvsxServer {
292
308
  case 'search_documentation':
293
309
  return await this.searchDocs(args.query);
294
310
 
311
+ case 'list_constraints':
312
+ return this.listConstraints();
313
+
314
+ case 'list_entities':
315
+ return this.listEntities();
316
+
295
317
  default:
296
318
  throw new Error(`Unknown tool: ${name}`);
297
319
  }
@@ -625,6 +647,84 @@ class SlvsxServer {
625
647
  };
626
648
  }
627
649
 
650
+ listConstraints() {
651
+ const constraintRef = `# SLVSX Constraint Reference
652
+
653
+ All constraints with their field names:
654
+
655
+ | Constraint | Fields | Description |
656
+ |------------|--------|-------------|
657
+ | \`fixed\` | \`entity\`, \`workplane?\` | Lock a point in place. For 2D points, include workplane. |
658
+ | \`distance\` | \`between: [p1, p2]\`, \`value\` | Set distance between two points |
659
+ | \`angle\` | \`between: [l1, l2]\`, \`value\` | Set angle between two lines (degrees) |
660
+ | \`perpendicular\` | \`a\`, \`b\` | Make two lines perpendicular |
661
+ | \`parallel\` | \`entities: [l1, l2, ...]\` | Make lines parallel |
662
+ | \`horizontal\` | \`a\`, \`workplane\` | Make line horizontal (2D only!) |
663
+ | \`vertical\` | \`a\`, \`workplane\` | Make line vertical (2D only!) |
664
+ | \`equal_length\` | \`entities: [l1, l2, ...]\` | Make lines equal length |
665
+ | \`equal_radius\` | \`a\`, \`b\` | Make circles/arcs equal radius |
666
+ | \`midpoint\` | \`point\`, \`of\` | Place point at midpoint of line |
667
+ | \`point_on_line\` | \`point\`, \`line\` | Constrain point to lie on line |
668
+ | \`point_on_circle\` | \`point\`, \`circle\` | Constrain point to lie on circle |
669
+ | \`coincident\` | \`entities: [p1, p2]\` | Make points coincident |
670
+ | \`tangent\` | \`a\`, \`b\` | Make arc/line tangent (NOT for circles!) |
671
+ | \`diameter\` | \`circle\`, \`value\` | Set circle diameter |
672
+ | \`symmetric\` | \`a\`, \`b\`, \`about\` | Mirror symmetry (2D only!) |
673
+ | \`symmetric_horizontal\` | \`a\`, \`b\`, \`workplane\` | Horizontal mirror symmetry |
674
+ | \`symmetric_vertical\` | \`a\`, \`b\`, \`workplane\` | Vertical mirror symmetry |
675
+ | \`dragged\` | \`point\`, \`workplane?\` | Lock point position absolutely |
676
+
677
+ ## Important Notes
678
+ - **2D constraints** (horizontal, vertical, symmetric) require a workplane and 2D entities (point2_d, line2_d)
679
+ - **tangent** does NOT work with circle entities - use arc entities instead
680
+ - **symmetric** about a line requires 2D mode; use symmetric_horizontal/vertical for 3D`;
681
+
682
+ return {
683
+ content: [{ type: 'text', text: constraintRef }],
684
+ };
685
+ }
686
+
687
+ listEntities() {
688
+ const entityRef = `# SLVSX Entity Reference
689
+
690
+ All entity types with their field names:
691
+
692
+ | Entity | Fields | Description |
693
+ |--------|--------|-------------|
694
+ | \`point\` | \`id\`, \`at: [x,y,z]\`, \`preserve?\` | 3D point |
695
+ | \`point2_d\` | \`id\`, \`at: [u,v]\`, \`workplane\` | 2D point in workplane |
696
+ | \`line\` | \`id\`, \`p1\`, \`p2\` | Line between two 3D points |
697
+ | \`line2_d\` | \`id\`, \`p1\`, \`p2\`, \`workplane\` | Line between two 2D points |
698
+ | \`circle\` | \`id\`, \`center\`, \`diameter\`, \`normal?\` | Circle (center can be coords or point ref) |
699
+ | \`arc\` | \`id\`, \`center\`, \`start\`, \`end\`, \`normal\` | Arc defined by center and endpoints |
700
+ | \`cubic\` | \`id\`, \`control_points: [p0,p1,p2,p3]\` | Cubic Bezier curve |
701
+ | \`plane\` | \`id\`, \`origin: [x,y,z]\`, \`normal: [x,y,z]\` | Workplane definition |
702
+
703
+ ## Circle Center Options
704
+ Circles can use either fixed coordinates or a point reference:
705
+
706
+ \`\`\`json
707
+ // Fixed coordinates (circle won't move)
708
+ {"type": "circle", "id": "c1", "center": [50, 50, 0], "diameter": 20}
709
+
710
+ // Point reference (circle tracks the point!)
711
+ {"type": "circle", "id": "c1", "center": "my_point", "diameter": 20}
712
+ \`\`\`
713
+
714
+ ## 2D Geometry Setup
715
+ For horizontal/vertical constraints, use 2D entities:
716
+
717
+ \`\`\`json
718
+ {"type": "plane", "id": "xy", "origin": [0,0,0], "normal": [0,0,1]},
719
+ {"type": "point2_d", "id": "p1", "at": [0,0], "workplane": "xy"},
720
+ {"type": "line2_d", "id": "l1", "p1": "p1", "p2": "p2", "workplane": "xy"}
721
+ \`\`\``;
722
+
723
+ return {
724
+ content: [{ type: 'text', text: entityRef }],
725
+ };
726
+ }
727
+
628
728
  async run() {
629
729
  // Load documentation index for search
630
730
  await loadDocsIndex();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sknoble/slvsx-mcp-server",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "MCP server for SLVSX geometric constraint solver",
5
5
  "type": "module",
6
6
  "bin": {