- TypeScript 88.5%
- Python 6.4%
- CSS 3.5%
- Shell 1.2%
- Dockerfile 0.3%
- Other 0.1%
|
Some checks failed
ci.yml / Merge pull request #9 from vidimus-dev/feat/widget-compose-sync (push) Failing after 0s
feat(ui): add bidirectional @mcpview/compose portSync to widgets |
||
|---|---|---|
| .github/workflows | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| .release-please-manifest.json | ||
| CHANGELOG.md | ||
| deno.json | ||
| deno.lock | ||
| Dockerfile | ||
| LICENSE | ||
| mod.ts | ||
| README.md | ||
| release-please-config.json | ||
| renovate.json | ||
| server.ts | ||
| THIRD_PARTY_NOTICES.txt | ||
@casys/mcp-cnc
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/.stpsolid 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,notCheckedboundaries, unit cost, and batch cost curve (N = 1, 10, 50, 100) forAl-7075-T6,Al-6061-T6,Ti-6Al-4V,Inconel-718, andSteel-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) forAl-7075-T6,Al-6061-T6,Ti-6Al-4V,Inconel-718,Steel-4340,SS-304, andBrass-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") forAl-5052,Al-6061,SS-304,Mild-Steel-DC01, andTi-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/composesnippetsestimate_machining,estimate_turning, andestimate_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 returnCNC_ESTIMATE_ERROR,CNC_TURNING_ERROR, orCNC_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