API & MCP
Everything a person can do on Ohmforge PCB Enclosure Generator (STL), a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://ohmforgeenclosuregenerator.usefulweb.app/api/v1/calculate– run Ohmforge PCB Enclosure Generator (STL)GET https://ohmforgeenclosuregenerator.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Ohmforge PCB Enclosure Generator (STL)
Describe a circuit board as JSON – outline, mounting holes, component boxes, edge connectors and keep-outs – and get a two-part 3D-printable enclosure: base with standoffs for heat-set inserts or self-tapping screws, connector cut-outs, and a lid with a snap-fit or friction lip or corner screws, optional vents and windows. Both STL files are checked to be watertight and manifold, cut-outs and standoffs are probed on the final mesh, and every part is tested for collisions. Includes a dimensioned drawing and an OBJ assembly.
| Field | Type | Default | Description |
|---|---|---|---|
mode | select (enclosure, coupon) | "enclosure" | Output. Print the coupon once per printer and material, read the printer profile values off it, then enter them below. |
board | textarea | "{\n \"format\": \"ohmforge-board\",\n \"version\": 1,\n \"name\": \"Sensor node | Board model (JSON). Fields: name, thickness, outline {shape: rect | rounded | polygon, width, height, radius, points}, holes [{id, x, y, diameter}], parts [{id, kind, x, y, width, depth, height, side}], connectors [{id, kind, edge: left | right | bottom | top, position, width, height, depth, overhang, offsetZ, side}], keepouts [{id, label, x, y, width, depth, heightAbove, lidOpening}]. Millimetres; part x and y are centres. Part kinds: smd-ic, dip-ic, electrolytic, pin-header, tactile-button, led-5mm, relay, radio-module, display-module, power-inductor, custom. Connector kinds: usb-c, micro-usb, usb-a, barrel-jack, header-right-angle, rj45, screw-terminal, micro-sd, custom. An Ohmforge project with a saved board also works. |
wall | number | 2 | Wall thickness |
floor | number | 2 | Floor thickness |
lidThickness | number | 2 | Lid thickness |
clearance | number | 1 | Gap between board and wall. Around the board's bounding box. |
topClearance | number | 2 | Space above the tallest part |
cornerRadius | number | 3 | Outer corner radius. Drawn with straight facets on the arc. |
standoffHeight | number | 5 | Standoff height (under the board). Also the depth of the screw or insert holes. |
screw | select (M2, M2.5, M3) | "M3" | Screw size |
fixing | select (insert, self-tap) | "insert" | Board fixing |
lid | select (snap, lip, screws) | "snap" | Lid |
lipHeight | number | 3 | Lip height |
lipWidth | number | 1.2 | Lip width |
lipGap | number | 0.2 | Gap between lip and wall. Per side; 0.15–0.3 mm suits most FDM printers. |
snapDepth | number | 0.4 | Snap bump depth. How far the bumps reach beyond the lip; the catch is this minus the lip gap. |
connectorClearance | number | 0.5 | Clearance around connectors |
vents | boolean | false | Ventilation slots in the lid |
ventWidth | number | 2 | Vent slot width |
ventPitch | number | 4 | Vent slot pitch |
circleSegments | integer | 32 | Facets per circle. Holes are drawn with their flats at the nominal diameter. |
holeCompensation | number | 0 | Printer profile: hole compensation. Added to every round hole diameter. Coupon: the offset of the smallest hole your screw passes freely. |
xyClearance | number | 0 | Printer profile: XY clearance. Added per side to connector openings and lid windows. Coupon: the first slot the test peg drops into freely. |
lidFitOffset | number | 0 | Printer profile: lid fit offset. Added to the lip gap. Coupon: clearance of the slot with a firm push fit minus the lip gap. |
insertHoleDiameter | number | 0 | Printer profile: insert hole (measured). 0 = typical value plus hole compensation. Coupon: the standoff sample that held the insert best. |
stlFormat | select (binary, ascii) | "binary" | STL format |
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://ohmforgeenclosuregenerator.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
ohmforge_enclosure_generator - Local stdio connector:
node src/mcp-stdio.ts --tool=ohmforge-enclosure-generator
{
"mcpServers": {
"ohmforge-enclosure-generator": { "type": "http", "url": "https://ohmforgeenclosuregenerator.usefulweb.app/mcp" }
}
}