AI Copilot & Model Context Protocol (MCP)
Connect Claude Desktop, Cursor, Claude Code, and Antigravity directly to WebCAE's 3D CAD, meshing, and finite-element solver.
WebCAE is the first full-fledged finite-element simulation platform natively exposing a Model Context Protocol (MCP) server. Instead of feeding large raw simulation scripts, your AI assistant operates through 12 granular, strictly typed engineering tools: inspect 3D B-Rep topology, assign certified materials, apply boundary conditions by numbered surfaces, run GPU/WASM solves, evaluate Factor of Safety (FOS), and capture viewport screenshots in real time.
Connect Your AI Copilot in 1 Minute
stdio + ws://127.0.0.1:8765Choose your environment below to copy the ready-to-use MCP configuration:
{
"mcpServers": {
"caeweb": {
"command": "node",
"args": [
"/path/to/webcae/mcp-bridge/server.mjs"
]
}
}
}Architectural Overview: Hub + Relay
WebCAE implements a multi-client Model Context Protocol bridge featuring an autonomous Hub + Relay topology:
┌─────────────────────────────────────────────────────────────┐
│ LLM CLIENTS │
│ ┌───────────────────────────┐ ┌──────────────────────────┐ │
│ │ Claude Desktop / Code │ │ Cursor / Antigravity │ │
│ └─────────────┬─────────────┘ └────────────┬─────────────┘ │
└────────────────┼────────────────────────────┼───────────────┘
stdio (JSON-RPC) stdio (JSON-RPC)
│ │
▼ ▼
┌───────────────────┐ ┌───────────────────┐
│ mcp-bridge (HUB) │◄───────┤ mcp-bridge (RELAY)│
│ ws://127.0.0.1: │ ws │ (no EADDRINUSE │
│ 8765 │ relay │ port conflicts) │
└─────────▲─────────┘ └───────────────────┘
│
│ WebSocket (bidirectional JSON)
▼
┌─────────────────────────────────────────────────┐
│ WebCAE Application │
│ ┌───────────────────────────────────────────┐ │
│ │ mcpBridgeConnector (auto-reconnect, FIFO) │ │
│ └─────────────────────┬─────────────────────┘ │
│ ▼ │
│ ┌───────────────────────────────────────────┐ │
│ │ window.cae API (CAD, Mesh, Physics, FEM) │ │
│ └───────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘Key Architectural Strengths:
- Zero Port Collisions: The first MCP server process binds to port 8765 as HUB. Subsequent instances (e.g. multiple Claude windows or Cursor running in parallel) automatically join as RELAY clients, forwarding requests seamlessly. If the HUB shuts down, a RELAY gracefully takes over the port.
- Session Slot Management: The bridge guarantees that exactly one active WebCAE browser or desktop window processes simulation commands, putting inactive tabs into a non-interfering standby state.
- Strict Entity Addressing Contract: In compliance with WebCAE design standards, all boundary condition targets use verified numerical indices (surface number N, edge number N). Forbidden axis-face identifiers (like +X, bbox_top) are rejected at the schema level to eliminate AI hallucinations.
End-to-End Autonomous Simulation Workflow
Here is the standard conversational workflow between a human engineer, an AI assistant, and the WebCAE MCP bridge:
1. User Request: *"Analyze this steel mounting bracket under a 4.5 kN downward load applied to the top face, with the left end fixed."*
2. Topology Inspection: The AI calls cae_inspect_surfaces() to extract all face IDs, unit normal vectors, and centroids. It identifies the left face (normal [-1, 0, 0], surface #2) and top face (normal [0, 0, 1], surface #1).
3. Material Assignment: The AI calls cae_set_material({ preset: "steel" }) configuring $E = 210\text{ GPa}$, $\nu = 0.3$, $\sigma_y = 250\text{ MPa}$.
4. Boundary Conditions:
- cae_add_boundary_condition({ targetNumbers: 2, type: "fix" })
- cae_add_boundary_condition({ targetNumbers: 1, type: "force", value: 4500, component: "z", fz: -4500 })
5. FEA Solve & Safety Factor: The AI invokes cae_solve(). WebCAE automatically meshes the volume with quadratic tetrahedra (Tet10), solves the equilibrium equations, and returns:
- Peak Von Mises stress: $\sigma_{\text{vM}}^{\max} = 142.5\text{ MPa}$
- Max displacement: $u^{\max} = 0.384\text{ mm}$
- Factor of Safety: $\text{FOS} = \frac{250}{142.5} = 1.75$ (SAFE)
6. Visual Inspection: The AI calls cae_screenshot() and embeds the 3D stress contour into the chat for human verification.
Typed MCP Tools Catalog
12 Tools (Zod Validated)Comprehensive specification of all 12 tools available to connected AI assistants:
cae_inspect_surfacesDiscovery & TopologyInspects all 3D B-Rep faces with persistent entity numbering, unit normals, centroids, surface areas (mm²), and geometric bounding boxes.
cae_inspect_edgesDiscovery & TopologyLists all edges with length, curve type (line, circle, spline), and adjacent surface numbers for fillets, chamfers, and beam extraction.
cae_get_stateDiscovery & TopologyReturns the complete JSON state snapshot of the active WebCAE session: bodies, mesh readiness, boundary conditions, and solver status.
cae_get_model_contextDiscovery & TopologyHigh-level engineering summary: B-Rep CAD validity, mesh statistics, and automated mapping of functional zones to surface numbers.
cae_set_materialPhysics & SolverAssigns engineering material properties via standard library presets or custom parameters (Young's modulus E, Poisson's ratio ν, density ρ).
cae_add_boundary_conditionPhysics & SolverApplies kinematic constraints (fixes) or physical loads (point/distributed force, pressure) onto surfaces strictly by numbered entity IDs.
cae_solvePhysics & SolverExecutes the full finite-element analysis (generates mesh if needed, solves system of equations, computes Von Mises stress, max displacement, and Factor of Safety).
cad_create_from_templateCAD & ArtifactsGenerates a parametric 3D B-Rep CAD solid via build123d + Open CASCADE from predefined industrial templates (brackets, flanges, lugs).
cad_create_from_scriptCAD & ArtifactsExecutes arbitrary Python build123d CAD scripts on the server, verifies solid watertightness, and produces verified STEP artifacts.
cae_import_step_artifactCAD & ArtifactsImports a generated STEP file directly into the active WebCAE 3D canvas with automatic topology numbering alignment.
cae_screenshotVisualizationCaptures a high-resolution PNG snapshot of the current WebCAE 3D viewport for multimodal visual verification by vision LLMs.
cae_run_scriptAutomationRuns low-level WebCAE DSL terminal scripts for batch automation, parametric studies, and verification loops.
Frequently Asked Questions
What is the Model Context Protocol (MCP) in WebCAE?
Model Context Protocol (MCP) is an open standard developed by Anthropic that allows AI assistants (such as Claude Desktop, Cursor, Claude Code, and Antigravity) to safely interact with local development tools, software kernels, and data. WebCAE implements an MCP bridge server exposing 12 typed engineering tools directly to your AI copilot.
Does WebCAE send my proprietary 3D CAD models to external AI cloud servers?
No. The WebCAE MCP bridge operates 100% locally on your machine via stdio and a local WebSocket (ws://127.0.0.1:8765). The LLM receives only lightweight geometric metadata (face numbers, normals, surface areas, and calculated scalar stresses). Full CAD geometry and mesh arrays remain strictly within your local browser or desktop app.
Which AI clients and IDEs are supported?
Any client that supports the Model Context Protocol standard: Claude Desktop (macOS and Windows), Cursor IDE (Composer & Chat), Claude Code CLI, Google Antigravity, and custom agent runtimes built with Python or Node.js MCP SDKs.
How does WebCAE prevent AI hallucinations in finite-element setups?
WebCAE enforces a strict architectural contract (AGENTS.md): geometry is addressed exclusively through verified entity numbers (e.g. 'surface number 2'). The AI is provided with the 'cae_inspect_surfaces' tool to query normals, centroids, and areas before applying boundary conditions. Furthermore, 'cae_solve' automatically computes the Factor of Safety (FOS = σ_yield / σ_vM) and returns structured engineering verdicts.
Can the AI copilot generate 3D CAD models from scratch?
Yes. WebCAE includes tools for Python CAD generation (cad_create_from_template and cad_create_from_script) powered by build123d and Open CASCADE. The generated watertight B-Rep models are saved as STEP files and instantly loaded into the WebCAE viewport via cae_import_step_artifact.
Ready to test AI-driven simulations in WebCAE?
Launch WebCAE online directly in your browser or connect your local desktop app with Claude Desktop.