WebCAE
← Back to documentation
WEBCAE AI KERNEL & PIPE--compact • 4 tools • < 1k tokens

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:

< 1,000 Schema Tokens (--compact)

Replaces multi-tool catalog bloat with 4 fused tools (cae_eval, cae_inspect, cae_tx, cae_solve_and_probe) under 4,000 schema characters.

Exact Numbered Entity Targeting

Semantic selectors resolve planar, cylindrical, extreme, and contacting faces strictly to canonical surface number N and edge number N targets.

Pre-Mesh CAD/FEA Lint Gate

Detects INTERSECTING solids, NEAR_GAP seams, DISCONNECTED_BODY parts, OPEN_SHELL_OR_NON_MANIFOLD, SLIVER_FACE, and TINY_EDGE before meshing.

Strict Auto-Rollback & 4-View SVG

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=compact

Start @webcae/mcp-server with --compact or WEBCAE_MCP_MODE=compact to expose only the 4 fused AI Kernel tools:

Claude Code CLITerminal · bash
claude mcp add webcae-kernel -- npx -y @webcae/mcp-server --compact
Registers WebCAE AI Kernel in compact 4-tool mode inside Claude Code.
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json · json
{
  "mcpServers": {
    "webcae-kernel": {
      "command": "npx",
      "args": ["-y", "@webcae/mcp-server", "--compact"],
      "env": {
        "WEBCAE_MCP_MODE": "compact"
      }
    }
  }
}
Connects Claude Desktop over stdio with < 1,000 schema tokens.
Cursor.cursor/mcp.json · json
{
  "mcpServers": {
    "webcae-kernel": {
      "command": "npx",
      "args": ["-y", "@webcae/mcp-server", "--compact"]
    }
  }
}
Enables WebCAE-Pipe modeling and single-turn solve+probe inside Cursor Composer.

The 4 Fused AI Kernel Tools

4 Tools · Zod Validated

Strictly Zod-validated schemas designed to minimize round-trips and eliminate entity addressing errors:

cae_evalBuild & Evaluate

Compiles 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.

Params:code: string, mode?: 'pipe' | 'dsl' (default 'pipe'), strict?: boolean (default true), lint?: boolean (default true), preview?: boolean (default true)
Returns:{ ok, rolledBack, mode, error?, dslScript?, deferredOpsApplied?, queries?, lint?, delta?, previewSvg? }
cae_inspectInspect & Resolve

Progressive-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.

Params:topic?: 'pipe'|'selectors'|'contacts'|'bc'|'mesh'|'solve'|'thermal'|'modal'|'buckling'|'cfd'|'frame', lint?: boolean, selectFaces?: { body?, type?, normal?, radiusMm?, strict? }, selectEdges?: { body?, orientation?, lengthMinMm?, lengthMaxMm?, strict? }, selectContacting?: { bodyA, bodyB, tolMm? }, clearance?: { bodyA, bodyB }, section?: { body, zMm }
Returns:{ ok: true, topicSpec?, lint?, faces?, edges?, contacting?, clearance?, section?, stateSummary?, availableTopics? }
cae_txTransactions

Manages 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.

Params:action: 'checkpoint' | 'rollback' | 'undo' | 'reset' | 'list', name?: string
Returns:{ ok: true, action, name?, checkpoints: string[], delta? }
cae_solve_and_probeValidate, Mesh & Solve

Runs 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.

Params:probes?: [{ quantity?: 'von_mises'|'displacement'|'ux'|'uy'|'uz'|'temperature'|'contact_pressure'|'safety_factor', target?: string, at?: [x,y,z], tolMm?: number, cornerNodesOnly?: boolean, includeReactions?: boolean, includeModal?: boolean, includeBuckling?: boolean }], validateOnly?: boolean, autoMesh?: boolean (default true)
Returns:{ ok, validation, error?, solveSummary?, probes? }

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-Pipe compile 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, cadFeaLint evaluates 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:

PropertyStandard MCP ModeCompact AI Kernel Mode (--compact)
Registered toolsFull granular tool catalog4 fused tools (cae_eval, cae_inspect, cae_tx, cae_solve_and_probe)
Schema metadata budgetMulti-kilotoken catalog< 4,000 characters (< 1,000 tokens)
Reference documentationLoaded upfrontOn-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 with CAD/FEA Lint, and returns a 4-view SVG preview plus a compact StateDeltaSummary.
  • Step 2 — Semantic Resolve (`cae_inspect`): Query selectFaces, selectEdges, selectContacting, clearance, or section to map functional surfaces (mounting planes, bolt bores, contact interfaces) to exact surface number N and edge number N targets.
  • Step 3 — Assign Materials, Contacts & Boundary Conditions (`cae_eval` in `mode: "dsl"`): Apply material, contact pair, fix surface number N, force surface number N, or pressure surface number N using 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

CategorySyntaxNotes
Units`units("mm" \"cm" \"m" \"in")`Scales all subsequent lengths/radii to millimeters
Primitivesbox(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
Queriesclearance(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, and strict. Returns targets: ["surface number N", ...] plus surfaceNumber, normal, centroid, areaMm2, and radiusMm.
  • `selectEdges`: Filter by body, orientation ("vertical" | "horizontal" | "x" | "y" | "z"), lengthMinMm, lengthMaxMm, extreme, and strict. Returns targets: ["edge number N", ...] plus edgeNumber, lengthMm, midpoint, and direction.
  • `selectContacting`: Pass { bodyA, bodyB, tolMm? } to discover opposing face pairs within tolerance, returning surfaceNumberA, targetA, surfaceNumberB, targetB, gapMm, and overlapAreaEstimateMm2.
Strict Addressing Rule: Every boundary condition, contact pair, mesh refinement, and probe target MUST use surface number N, edge number N, vertex number N, solid number N, or an exact body name/id. When strict: true and zero entities match a selector, SemanticSelectorError fails 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 CodeSeverityMeaning & TriggerRecommended Agent Action
INTERSECTINGerrorSolid penetration or >= 2 strict triangle crossings between two bodiesSeparate bodies with on() / align() or boolean cut()
NEAR_GAPwarningGap exceeds contactTolMm (0.05 mm) but is within nearGapTolMm (1.0 mm)Close gap with align() or increase contact tolerance intentionally
DISCONNECTED_BODYwarningBody in multi-body assembly has no contacting/intersecting partnerConnect part with on() / align() or remove stray body
OPEN_SHELL_OR_NON_MANIFOLDerrorSolid body has free boundary edges or non-manifold edges (> 2 triangles/edge)Inspect boolean order or rollback via cae_tx
SLIVER_FACEwarningFace area < minFaceAreaMm2 or extreme aspect ratio (> 100)Adjust fillet/cut offsets to avoid sliver intersections
TINY_EDGEwarningEdge polyline length < minEdgeLengthMm (0.05 mm)Adjust overlap or feature dimensions
DEGENERATE_OR_INVERTED_BODYerrorEmpty mesh, near-zero volume, or negative signed volume orientationRoll 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 with cae_tx({ action: "rollback", name: "base-flange" }). Actions undo, reset, and list manage the ordered snapshot stack.
  • Automatic Strict Rollback: Whenever cae_eval runs with strict: true (default) and hits a compiler error, semantic selector miss, DSL execution error, or lint error, state is automatically restored via the undo stack (rolledBack: true).
  • 4-View Orthographic + Isometric SVG: With preview: true, cae_eval renders 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:

TopicCovers
pipeWebCAE-Pipe units, primitives, booleans, assembly placement, patterns, queries
selectorsselectFaces, selectEdges, selectContactingFaces filters & outputs
contactsbond all, contact pairs all, contact pair (bonded, tied, frictionless, frictional, mortar)
bcmaterial, fix surface number N, force, pressure, displacement
mesh`mesh [tet\hex] size= order=1\2, refine surface/edge number N, refine zone`
solvecae_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`
bucklinganalysis buckling modes=4, includeBuckling: true
cfdanalysis cfd, inlet/outlet/wall boundary conditions on surface number N
frame1D 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

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.

We use essential cookies to run this site, plus analytics cookies if you agree. Privacy Policy