CNC machining, turning, and sheet-metal cost/DFM MCP server
  • TypeScript 88.5%
  • Python 6.4%
  • CSS 3.5%
  • Shell 1.2%
  • Dockerfile 0.3%
  • Other 0.1%
Find a file
Erwan Lee Pesle 2fdd5a0c50
Some checks failed
ci.yml / Merge pull request #9 from vidimus-dev/feat/widget-compose-sync (push) Failing after 0s
Merge pull request #9 from vidimus-dev/feat/widget-compose-sync
feat(ui): add bidirectional @mcpview/compose portSync to widgets
2026-12-05 20:30:31 +08:00
.github/workflows chore(ci): migrate engineering-toolchain and GHCR target to vidimus-dev 2026-12-05 15:32:08 +08:00
scripts fix(widgets): stat purity, audited reproducible bundles, declared views, third-party notices 2026-12-03 13:25:22 +08:00
src feat(ui): add bidirectional @mcpview/compose portSync to widgets 2026-12-05 20:27:58 +08:00
tests feat: multi-process 5-axis milling, CNC turning/mill-turn, and sheet-metal laser + press-brake (0.3.0) 2026-12-04 10:22:38 +08:00
.gitignore feat: @casys/mcp-cnc 0.1.0 — STEP-driven 3/5-axis CNC estimate (Gmsh OCC), native @mcpview snippets 2026-12-03 11:59:24 +08:00
.release-please-manifest.json chore: adopt engineering-toolchain@v1 CI, Renovate, and Release Please 2026-12-04 11:35:38 +08:00
CHANGELOG.md release: 0.3.1 2026-12-04 10:35:03 +08:00
deno.json release: 0.3.1 2026-12-04 10:35:03 +08:00
deno.lock fix(widgets): stat purity, audited reproducible bundles, declared views, third-party notices 2026-12-03 13:25:22 +08:00
Dockerfile feat: @casys/mcp-cnc 0.1.0 — STEP-driven 3/5-axis CNC estimate (Gmsh OCC), native @mcpview snippets 2026-12-03 11:59:24 +08:00
LICENSE feat: @casys/mcp-cnc 0.1.0 — STEP-driven 3/5-axis CNC estimate (Gmsh OCC), native @mcpview snippets 2026-12-03 11:59:24 +08:00
mod.ts feat: multi-process 5-axis milling, CNC turning/mill-turn, and sheet-metal laser + press-brake (0.3.0) 2026-12-04 10:22:38 +08:00
README.md feat: multi-process 5-axis milling, CNC turning/mill-turn, and sheet-metal laser + press-brake (0.3.0) 2026-12-04 10:22:38 +08:00
release-please-config.json chore: adopt engineering-toolchain@v1 CI, Renovate, and Release Please 2026-12-04 11:35:38 +08:00
renovate.json chore(ci): migrate engineering-toolchain and GHCR target to vidimus-dev 2026-12-05 15:32:08 +08:00
server.ts feat: multi-process 5-axis milling, CNC turning/mill-turn, and sheet-metal laser + press-brake (0.3.0) 2026-12-04 10:22:38 +08:00
THIRD_PARTY_NOTICES.txt fix(widgets): stat purity, audited reproducible bundles, declared views, third-party notices 2026-12-03 13:25:22 +08:00

@casys/mcp-cnc

JSR npm

Multi-process manufacturing MCP server for 3-axis & 5-axis CNC milling, CNC turning / mill-turn, and sheet-metal fiber-laser cutting + press-brake bending, measured from real B-Rep STEP geometry by Gmsh OpenCASCADE (OCC) (or parametric flat-pattern specs for sheet metal) and built natively on @mcpview/server + @mcpview/compose.

Tools

  • cnc_estimate_machining — measures a real .step / .stp solid via Gmsh OCC (src/analyze_step.py: bounding box, part / billet / removed volume, surface area, face & orientation classification), selects or applies 3-axis vs 5-axis (3+2-indexed / 5-axis-simultaneous) kinematics with setup count, indexing time, undercut accessibility, roughing/finishing cycle time, buy-to-fly ratio, structured DFM checks, notChecked boundaries, unit cost, and batch cost curve (N = 1, 10, 50, 100) for Al-7075-T6, Al-6061-T6, Ti-6Al-4V, Inconel-718, and Steel-4340.
  • cnc_estimate_turning — measures a STEP solid via Gmsh OCC for CNC lathe & mill-turn manufacturing: checks axisymmetric envelope & rotational area share, snaps standard round bar-stock diameter and axial cutoff length, computes buy-to-fly ratio, roughing/finishing/parting cycle time, live-tooling penalty for non-axisymmetric features, lathe DFM checks (swing, length, L/D slenderness, BTF, live tooling), and batch cost curve (N = 1, 5, 10, 25, 50, 100) for Al-7075-T6, Al-6061-T6, Ti-6Al-4V, Inconel-718, Steel-4340, SS-304, and Brass-C360.
  • cnc_estimate_sheet_metal — estimates fiber-laser cutting + CNC press-brake bending from STEP geometry (provenance: "verified-solver") or explicit flat-pattern parameters (provenance: "deterministic-analysis") for Al-5052, Al-6061, SS-304, Mild-Steel-DC01, and Ti-Grade2: computes pierce + laser cut time, bend setup + per-bend press-brake time & air-bend tonnage, 0°/90° sheet nesting utilization, DFM checks (bed envelope, gauge thickness, minimum bend radius, minimum V-die flange length, hole diameter, tonnage, nesting), and batch cost curve (N = 1, 5, 10, 25, 50, 100).
  • list_snippets / run_snippet — native Level-2 @mcpview/compose snippets estimate_machining, estimate_turning, and estimate_sheet_metal. Results carry _meta["io.casys/provenance"] = "verified-solver" only when Gmsh actually measured a STEP file ("deterministic-analysis" for parametric explicit flat-pattern sheet-metal runs); failures return CNC_ESTIMATE_ERROR, CNC_TURNING_ERROR, or CNC_SHEET_METAL_ERROR.

Widgets

Results from all three manufacturing processes are shown as small, individual MCP App widgets, one reading each, never a dashboard. Each widget is its own ui://mcp-cnc/<widget> resource and adapts to the width its host grants (a Compose board snaps its resize handle between supportedWidths; a standalone host gets the widest).

Widget (ui://mcp-cnc/…) Kind Shows supportedWidths
cost-estimate stat PASS or FAIL of process qualification with 1 to 3 headline numbers 280, 380, 520
qualification-checks table DFM & process gates a part is judged against, then the solver notes 340, 480, 680
cost-breakdown table Unit cost and cycle time split into their parts, then geometry/stock 340, 480, 680
batch-cost-curve chart Unit cost across the process batch curve (setup amortization) 320, 440, 640

Smallest width: the essential (verdict and unit cost; headline cost rows; one bar per batch size). Middle: the usual reading (cycle time and buy-to-fly or sheet nesting; measured value per DFM gate; cycle time rows with units; axis, cycle time and saving per batch). Largest: the full detail of that one thing (solver notes, one row each; masses, stock/nesting parameters and the basis of each derived quantity; bars split between machining/processing and stock plus tooling/consumables), with a provenance footer (provenance, engine, and STEP SHA-256 when STEP-backed). All three tools and run_snippet advertise cost-estimate by default; every successful run_snippet result declares all widgets in _meta["io.mcpview/views"], so a Code Mode program can write api.panel(receipt.id, { view: "cost-breakdown" }). CNC_WIDGETS (exported from mod.ts) lists URIs, kinds and supportedWidths for a board to read:

import { CNC_WIDGETS } from "jsr:@casys/mcp-cnc";
// { resourceUri: widget.uri, supportedWidths: widget.supportedWidths }

Rebuild the committed HTML with deno task build:ui. From JSR it is fetched from jsr.io, so allow --allow-net=jsr.io.

Requirements

Python 3 with the gmsh and numpy modules on PATH (or pass --python-bin) for STEP-backed tools. Explicit flat-pattern cnc_estimate_sheet_metal runs without Python/Gmsh. The Docker image ships Python 3 + Gmsh + NumPy.

Run

# Deno (JSR)
deno run --allow-read --allow-write --allow-run --allow-env --allow-net jsr:@casys/mcp-cnc/server --port=3031

# Node.js >= 20 (npm)
npx @casys/mcp-cnc --port=3031

# stdio transport
npx @casys/mcp-cnc --stdio

Environment: HOST, PORT (default 127.0.0.1:3031), MCP_BEARER_TOKEN (optional static Bearer token on /mcp).

Docker

docker build -t casys-mcp-cnc:local .
docker run -d --name casys-mcp-cnc -p 127.0.0.1:3031:3031 -v step-exchange:/inputs:ro casys-mcp-cnc:local
curl http://127.0.0.1:3031/health

Development

deno task ci:check        # fmt + check + lint + unit tests + widget bundle freshness
deno task release:check   # + end-to-end tests against the container on :3031
deno task build:ui        # rebuild the committed single-file widget HTML in src/ui/dist/
deno task build:npm       # npm bundle in dist-node/bin

License

MIT