WebCAE AI Kernel & Pipe Modeling
A compact 4-tool MCP mode (< 1,000 schema tokens), declarative WebCAE-Pipe CAD modeling, semantic face/edge resolution, and deterministic CAD/FEA Lint.
Autonomous engineering agents need fast feedback, low token overhead, and deterministic geometry guarantees. The WebCAE AI Kernel layers a declarative pipeline compiler (WebCAE-Pipe), semantic B-Rep selectors, pre-mesh CAD/FEA Lint, transactional checkpoints, and 4-view SVG previews directly on top of WebCAE's OpenCASCADE, Netgen, and FEM engine — exposed through just 4 fused MCP tools.
Built for Autonomous CAD + FEA Agents
Every design decision in the WebCAE AI Kernel targets reliability in multi-turn tool loops:
Replaces multi-tool catalog bloat with 4 fused tools (cae_eval, cae_inspect, cae_tx, cae_solve_and_probe) under 4,000 schema characters.
Semantic selectors resolve planar, cylindrical, extreme, and contacting faces strictly to canonical surface number N and edge number N targets.
Detects INTERSECTING solids, NEAR_GAP seams, DISCONNECTED_BODY parts, OPEN_SHELL_OR_NON_MANIFOLD, SLIVER_FACE, and TINY_EDGE before meshing.
Failed compilations or lint errors roll back automatically, while clean runs return a compact StateDeltaSummary and an ISO/TOP/FRONT/RIGHT SVG preview.
Enable Compact AI Kernel Mode (--compact)
WEBCAE_MCP_MODE=compactStart @webcae/mcp-server with --compact or WEBCAE_MCP_MODE=compact to expose only the 4 fused AI Kernel tools:
claude mcp add webcae-kernel -- npx -y @webcae/mcp-server --compact{
"mcpServers": {
"webcae-kernel": {
"command": "npx",
"args": ["-y", "@webcae/mcp-server", "--compact"],
"env": {
"WEBCAE_MCP_MODE": "compact"
}
}
}
}{
"mcpServers": {
"webcae-kernel": {
"command": "npx",
"args": ["-y", "@webcae/mcp-server", "--compact"]
}
}
}The 4 Fused AI Kernel Tools
4 Tools · Zod ValidatedStrictly Zod-validated schemas designed to minimize round-trips and eliminate entity addressing errors:
cae_evalBuild & EvaluateCompiles and executes WebCAE-Pipe or WebCAE DSL code, resolves semantic fillets/chamfers/shells, runs CAD/FEA Lint, computes a compact state delta, renders a 4-view SVG preview, and automatically rolls back on syntax, selector, or lint errors when strict=true.
cae_inspectInspect & ResolveProgressive-disclosure documentation and geometric inspection tool: queries kernel topic specs, runs CAD/FEA Lint on the active model, resolves semantic faces/edges to canonical 'surface number N' and 'edge number N' targets, detects contacting face pairs, and computes body clearance or horizontal Z-sections.
cae_txTransactionsManages named state checkpoints and the ordered undo stack over WizardState snapshots so AI agents can branch modeling variants safely and roll back failed design iterations.
cae_solve_and_probeValidate, Mesh & SolveRuns pre-solve validation (bodies, materials, connectivity, contact pairs, boundary conditions), generates a tetrahedral/hexahedral mesh automatically if missing, executes the WebCAE solver, and probes fields and reaction equilibrium on numbered entities in a single turn.
Why Analytical B-Rep + Deterministic Lint
In engineering simulation, LLMs routinely fail for two reasons: blind coordinate guessing (applying loads to guessed coordinates or unverified face indices) and mesh-breaking geometry defects (accidental body penetrations, micro-sliver faces, or non-manifold shells discovered only after a slow mesher failure).
The WebCAE AI Kernel eliminates both failure modes at the kernel layer:
- Analytical OpenCASCADE B-Rep Solids: Parametric parts and multi-body assemblies created through
WebCAE-Pipecompile directly into exact B-Rep solids with watertight topology, ready for Netgen tetrahedral/hexahedral meshing and the WebCAE FEM solver. - Unified Entity Numbering Journal: Every topological face, edge, vertex, and body is tracked in
WizardState.uiNumbering. Semantic selectors resolve geometry queries strictly into canonical targets (surface number N,edge number N,solid number N). Legacy directional or bounding-box identifiers are rejected at schema validation. - Pre-Mesh CAD/FEA Lint Gate: Before meshing or solving ever begins,
cadFeaLintevaluates pairwise AABB + triangle-BVH intersections, contact gaps, connectivity, manifoldness, sliver faces, tiny edges, and signed volume orientation.
Compact MCP Mode (--compact / WEBCAE_MCP_MODE=compact)
When connecting autonomous coding or engineering agents, exposing dozens of granular tools consumes thousands of prompt tokens on every turn. Passing --compact (or setting WEBCAE_MCP_MODE=compact) switches @webcae/mcp-server to the 4 fused AI Kernel tools:
| Property | Standard MCP Mode | Compact AI Kernel Mode (--compact) |
|---|---|---|
| Registered tools | Full granular tool catalog | 4 fused tools (cae_eval, cae_inspect, cae_tx, cae_solve_and_probe) |
| Schema metadata budget | Multi-kilotoken catalog | < 4,000 characters (< 1,000 tokens) |
| Reference documentation | Loaded upfront | On-demand via cae_inspect({ topic }) & cae://guidelines/ai-kernel |
| Addressing contract | <kind> number N | <kind> number N + cae://guidelines/rules |
The 4-Step Agent Workflow
Every reliable autonomous simulation in WebCAE follows four deterministic steps:
- Step 1 — Build & Lint (`cae_eval`): Author parametric geometry in
WebCAE-Pipe(mode: "pipe"). The kernel compiles to WebCAE DSL, resolves deferred semantic features (fillet,chamfer,shell), checks geometry withCAD/FEA Lint, and returns a 4-view SVG preview plus a compactStateDeltaSummary. - Step 2 — Semantic Resolve (`cae_inspect`): Query
selectFaces,selectEdges,selectContacting,clearance, orsectionto map functional surfaces (mounting planes, bolt bores, contact interfaces) to exactsurface number Nandedge number Ntargets. - Step 3 — Assign Materials, Contacts & Boundary Conditions (`cae_eval` in `mode: "dsl"`): Apply
material,contact pair,fix surface number N,force surface number N, orpressure surface number Nusing the verified numbers returned in Step 2. - Step 4 — Validate, Mesh, Solve & Probe (`cae_solve_and_probe`): Validate setup readiness (
readyToSolve), auto-mesh unmeshed solids, execute the native/WASM solver, and extract Von Mises stress, displacement, Factor of Safety, and support reaction equilibrium in one call.
WebCAE-Pipe Declarative Language
WebCAE-Pipe is a concise, unit-aware pipeline language that compiles deterministically into verified WebCAE DSL commands:
units("mm")
# Primitives
plate = box(120, 80, 12, center=true)
pin = cyl(d=16, h=30)
ball = sphere(d=24)
taper = cone(r1=18, r2=10, h=25)
sleeve = tube(od=40, id=28, h=35)
# Pipeline Operators (|), Booleans, Transforms & Assembly Placement
flange = box(140, 140, 14, center=true)
| cut(cyl(d=14, h=20), at=[[-50, -50, -10], [50, -50, -10], [50, 50, -10], [-50, 50, -10]])
| fillet(r=4, edges="vertical")
hub = cyl(d=64, h=28)
| on(flange)
| align(axis="x", anchor="center", target=flange, target_anchor="center")
# Linear & Radial Patterns
ribs = box(8, 24, 18) | pattern_linear(count=4, step=[25, 0, 0])
stud = cyl(d=8, h=15) | pattern_radial(count=6, axis="z", radius=45)
# Inline Geometric Queries
clearance(flange, hub)
section(flange, z=0)Supported Primitives, Operators & Deferred Features
| Category | Syntax | Notes | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Units | `units("mm" \ | "cm" \ | "m" \ | "in")` | Scales all subsequent lengths/radii to millimeters | ||||
| Primitives | box(dx, dy, dz, center=true), `cyl(d=\ | r=, h=), sphere(r=\ | d=), cone(r1, r2, h), tube(od=, id=, h=)` | Generates analytical B-Rep solids | |||||
| Booleans | `\ | cut(tool, at=[...]), \ | fuse(tool), \ | common(tool)` | Supports inline tool expressions or named bodies | ||||
| Transforms | `\ | move(dx, dy, dz \ | delta=[...]), \ | rotate(axis="x\ | y\ | z", angle=deg, at=[...])` | Updates body bounding boxes in-flight | ||
| Assembly | `\ | on(part), \ | align(axis="x\ | y\ | z", anchor="min\ | center\ | max", target=part\ | val, target_anchor=...)` | Eliminates manual Z-stack math |
| Deferred Features | `\ | fillet(r=, edges=...), \ | chamfer(d=, edges=...), \ | shell(t=, faces=...)` | Resolved at runtime via semantic selectors | ||||
| Patterns | `\ | pattern_linear(count=N, step=[dx,dy,dz]), \ | pattern_radial(count=N, axis="z", radius=R)` | Creates arrayed solids cleanly | |||||
| Queries | clearance(a, b), section(part, z), select_faces(...), select_edges(...), select_contacting(a, b) | Returned in queries[] of cae_eval |
Semantic Selectors (cae_inspect)
Instead of guessing face indices or using forbidden coordinate aliases, agents filter B-Rep faces and edges by geometric properties and receive canonical numbered targets:
- `selectFaces`: Filter by
body,type("plane" | "cylinder" | "cone" | "sphere" | "torus" | "other"),normal([nx, ny, nz]),normalTolDeg,extreme({ axis, side, tolMm? }),radiusMm,areaMinMm2,areaMaxMm2,nearPointMm, andstrict. Returnstargets: ["surface number N", ...]plussurfaceNumber,normal,centroid,areaMm2, andradiusMm. - `selectEdges`: Filter by
body,orientation("vertical" | "horizontal" | "x" | "y" | "z"),lengthMinMm,lengthMaxMm,extreme, andstrict. Returnstargets: ["edge number N", ...]plusedgeNumber,lengthMm,midpoint, anddirection. - `selectContacting`: Pass
{ bodyA, bodyB, tolMm? }to discover opposing face pairs within tolerance, returningsurfaceNumberA,targetA,surfaceNumberB,targetB,gapMm, andoverlapAreaEstimateMm2.
Strict Addressing Rule: Every boundary condition, contact pair, mesh refinement, and probe target MUST usesurface number N,edge number N,vertex number N,solid number N, or an exact body name/id. Whenstrict: trueand zero entities match a selector,SemanticSelectorErrorfails loudly instead of silently skipping.
CAD/FEA Lint Reference
CAD/FEA Lint classifies every body pair in contactGraph as INTERSECTING, CONTACT, NEAR_GAP, or DISJOINT, and emits structured errors and warnings:
| Issue Code | Severity | Meaning & Trigger | Recommended Agent Action |
|---|---|---|---|
INTERSECTING | error | Solid penetration or >= 2 strict triangle crossings between two bodies | Separate bodies with on() / align() or boolean cut() |
NEAR_GAP | warning | Gap exceeds contactTolMm (0.05 mm) but is within nearGapTolMm (1.0 mm) | Close gap with align() or increase contact tolerance intentionally |
DISCONNECTED_BODY | warning | Body in multi-body assembly has no contacting/intersecting partner | Connect part with on() / align() or remove stray body |
OPEN_SHELL_OR_NON_MANIFOLD | error | Solid body has free boundary edges or non-manifold edges (> 2 triangles/edge) | Inspect boolean order or rollback via cae_tx |
SLIVER_FACE | warning | Face area < minFaceAreaMm2 or extreme aspect ratio (> 100) | Adjust fillet/cut offsets to avoid sliver intersections |
TINY_EDGE | warning | Edge polyline length < minEdgeLengthMm (0.05 mm) | Adjust overlap or feature dimensions |
DEGENERATE_OR_INVERTED_BODY | error | Empty mesh, near-zero volume, or negative signed volume orientation | Roll back transaction and rebuild solid cleanly |
Transactions (cae_tx) & 4-View Preview
- Named Checkpoints: Call
cae_tx({ action: "checkpoint", name: "base-flange" })before risky booleans or fillets, and restore anytime withcae_tx({ action: "rollback", name: "base-flange" }). Actionsundo,reset, andlistmanage the ordered snapshot stack. - Automatic Strict Rollback: Whenever
cae_evalruns withstrict: true(default) and hits a compiler error, semantic selector miss, DSL execution error, or linterror, state is automatically restored via the undo stack (rolledBack: true). - 4-View Orthographic + Isometric SVG: With
preview: true,cae_evalrenders a 2×2 quadrant SVG (ISO,TOP,FRONT,RIGHT) using outward-oriented solid facets and depth sorting, tinting bodies by lint status (red for errors, amber for warnings, green for clean contact).
Complete 3-Turn Worked Example (Flange + 4 Bolt Holes + Boss)
Turn 1 — Build Assembly, Fillet & Lint (cae_eval)
{
"tool": "cae_eval",
"arguments": {
"mode": "pipe",
"code": "units(\"mm\")\nflange = box(120, 120, 15, center=true) | cut(cyl(d=12, h=20), at=[[-42,-42,-10],[42,-42,-10],[42,42,-10],[-42,42,-10]]) | fillet(r=4, edges=\"vertical\")\nboss = cyl(d=50, h=30) | on(flange)\nclearance(flange, boss)\nsection(flange, 0)"
}
}cae_eval compiles the pipeline into WebCAE DSL, resolves the 4 outer vertical corners of flange to numbered edges for the 4 mm fillet, confirms clearance(flange, boss).classification === "CONTACT" (distanceMm: 0), verifies lint.summary === "lint: OK", and returns a 4-view SVG preview.
Turn 2 — Resolve Numbered Faces & Contact Interface (cae_inspect)
{
"tool": "cae_inspect",
"arguments": {
"selectFaces": { "body": "flange", "type": "plane", "normal": [0, 0, -1] }
}
}{
"tool": "cae_inspect",
"arguments": {
"selectFaces": { "body": "boss", "type": "plane", "normal": [0, 0, 1] },
"selectContacting": { "bodyA": "flange", "bodyB": "boss", "tolMm": 0.05 }
}
}The topology journal resolves the flange base face to surface number 2, the top loaded face of the boss to surface number 14, and the mating contact interface to surface number 4 ↔ surface number 13.
Turn 3 — Assign Material, Contacts, BCs & Solve (cae_eval + cae_solve_and_probe)
{
"tool": "cae_eval",
"arguments": {
"mode": "dsl",
"code": "material steel\ncontact pair flange boss bonded\nfix surface number 2\nforce surface number 14 0 0 -5000\nmesh tet size=6 order=2"
}
}{
"tool": "cae_solve_and_probe",
"arguments": {
"autoMesh": true,
"probes": [
{
"quantity": "von_mises",
"target": "surface number 14",
"cornerNodesOnly": true,
"includeReactions": true
},
{ "quantity": "displacement" },
{ "quantity": "safety_factor" }
]
}
}cae_solve_and_probe validates setup completeness, builds the quadratic TET10 mesh, executes the structural solve, and returns peak Von Mises stress, corner-node field metrics, displacement magnitude, Factor of Safety, and reaction force equilibrium in one call.
Progressive Disclosure Topics (cae_inspect({ topic }))
Instead of bloating the agent's initial context window, call cae_inspect({ topic: "<name>" }) to retrieve concise syntax specs on demand:
| Topic | Covers | ||
|---|---|---|---|
pipe | WebCAE-Pipe units, primitives, booleans, assembly placement, patterns, queries | ||
selectors | selectFaces, selectEdges, selectContactingFaces filters & outputs | ||
contacts | bond all, contact pairs all, contact pair (bonded, tied, frictionless, frictional, mortar) | ||
bc | material, fix surface number N, force, pressure, displacement | ||
mesh | `mesh [tet\ | hex] size= order=1\ | 2, refine surface/edge number N, refine zone` |
solve | cae_solve_and_probe, field quantities, cornerNodesOnly, includeReactions | ||
thermal | `analysis thermal \ | thermoelastic, thermal temperature/flux/convection surface number N` | |
modal | `analysis modal modes=6 prestress=on\ | off, includeModal: true` | |
buckling | analysis buckling modes=4, includeBuckling: true | ||
cfd | analysis cfd, inlet/outlet/wall boundary conditions on surface number N | ||
frame | 1D beams, 2D MITC4 shells, stiffened panels, frame point_mass, mass & rigid-mode gates |
Frequently Asked Questions
How is Compact AI Kernel mode different from the standard 12-tool WebCAE MCP server?
Standard mode exposes granular tools for individual CAD, meshing, boundary-condition, and postprocessing operations. Compact mode (--compact or WEBCAE_MCP_MODE=compact) fuses the entire pipeline into 4 high-leverage tools (cae_eval, cae_inspect, cae_tx, cae_solve_and_probe) under 1,000 schema tokens, pairing declarative WebCAE-Pipe modeling with pre-mesh CAD/FEA Lint and single-turn solve+probe.
How does WebCAE-Pipe handle units and multi-body assembly alignment?
Declare units("mm"), units("cm"), units("m"), or units("in") at the top of a WebCAE-Pipe script; the compiler scales all coordinates and dimensions cleanly into millimeters. Operators like | on(part) and | align(axis="x|y|z", anchor="min|center|max", target=..., target_anchor=...) automatically stack and center parts using live bounding-box extents without manual offset arithmetic.
Why must boundary conditions always use 'surface number N' instead of coordinates?
WebCAE maintains a unified topology numbering journal in WizardState.uiNumbering so every face, edge, vertex, and solid has a persistent numeric identifier. Addressing by 'surface number N' ensures exact parity between the 3D viewport, the model tree, the DSL script, and the native/WASM solver, while rejecting ambiguous directional guesses.
What happens if a WebCAE-Pipe edit introduces an intersecting body or syntax error?
By default, cae_eval runs with strict: true and lint: true. It pushes an undo snapshot before compiling, runs deferred semantic fillets/chamfers/shells, and runs CAD/FEA Lint. If compilation fails, a selector matches zero entities, or lint reports an error (such as INTERSECTING or OPEN_SHELL_OR_NON_MANIFOLD), cae_eval automatically rolls back state and returns rolledBack: true with the diagnostic report.
Which physics domains are supported through the AI Kernel?
Once geometry and numbered entities are resolved, cae_eval (mode="dsl") and cae_solve_and_probe support linear/nonlinear statics, multi-body contacts, steady-state thermal and thermoelastic coupling, modal vibration, linear buckling, CFD flow setup, and 1D/2D frame and shell models — with progressive topic docs via cae_inspect({ topic }).
Related WebCAE Documentation
Full Hub + Relay setup and granular 12-tool reference for Claude Desktop, Cursor, and Antigravity.
Open MCP Reference →Complete command catalog for geometry, boundary conditions, contacts, meshing, and solving.
Read DSL Reference →Element formulations (TET4, TET10, HEX8/20, MITC4 shells, Timoshenko beams) and CFD FVM.
Explore Elements →Ready to automate CAD & FEA with WebCAE AI Kernel?
Connect @webcae/mcp-server --compact to Claude Code, Claude Desktop, or Cursor and launch WebCAE Online or Desktop.