Connecting AI Agents to Live Discrete Element Simulations via MCP

Kyoto University researchers introduced itasca-mcp and yade-mcp (arXiv:2611.33926), open-source Model Context Protocol (MCP) bridges connecting AI agents to live PFC and YADE discrete element engines. Across 21 autonomous YADE calibration sessions on 7 LLMs, 20 reached all target soil mechanics tolerances while sharing console state with human modelers.
Connecting AI Agents to Live Discrete Element Simulations via MCP: Kyoto University researchers introduced itasca-mcp and yade-mcp (arXiv:2611.33926), open-source Model Context Protocol (MCP) bridges connecting AI agents to live PFC and YADE discrete element engines. Across 21 autonomous YADE calibration sessions on 7 LLMs, 20 reached all target soil mechanics tolerances while sharing console state with human modelers. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 7 Orthogonal MCP Primitives: 2 manual-lookup tools plus 5 live execution tools (execute_code, execute_task, check_task_status, interrupt_task, list_tasks).
- Co-Working Engine Bridge: Runs inside the live PFC or YADE process so the agent sees manual console edits made by the human modeler in real time.
- 95.2% Autonomous Calibration Rate: 20 of 21 headless YADE sessions across 7 frontier models calibrated Toyoura sand triaxial tests within target tolerances.
- Multi-Engine Coverage: itasca-mcp supports PFC, FLAC, 3DEC, MPoint, and MassFlow alongside open-source yade-mcp.
import { createAgent } from '@smoke-monkey/harness';const simulationAgent = createAgent({agentId: 'dem-calibration-engineer',provider: 'anthropic',model: 'claude-opus-4-5',workspacePath: process.cwd(),mcpServers: {yade: {command: 'uvx',args: ['yade-mcp', '--port', '9081'],},},permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function calibrateTriaxialSand() {const result = await simulationAgent.run('Use query_documentation to verify rolling-resistance wall commands in YADE, ' +'submit a 5000-sphere triaxial calibration via execute_task, and monitor E_50 (52.5 MPa) ' +'and q_peak (403 kPa) using check_task_status.');console.log('Calibration Output:', result.summary);}calibrateTriaxialSand().catch(console.error);
Watch: Related Video Guides
Model Context Protocol Clearly Explained | MCP Beyond the Hype
What is MCP? Integrate AI Agents with Databases & APIs
What Is itasca-mcp & yade-mcp? Designing MCP Tools for Live Engines
Discrete Element Method (DEM) calibration requires tuning microscopic particle parameters—porosity $n_0$, contact modulus $E^*$, sliding friction $\mu$, and rolling friction $\mu_r$—until simulated macroscopic behavior matches laboratory tests. Because simulations take minutes to hours, standard stateless request-response LLM tools fail.
Kyoto University researchers (arXiv:2611.33926) distilled engine interaction into 7 MCP tools held to four design rules—correctness, coverage, orthogonality, and simplicity—split across documentation discovery and live threaded execution:
| MCP Tool | Category | Live Concurrency Behavior |
|---|---|---|
query_documentation | Documentation | Keyword search returning matching manual paths (prevents API hallucination) |
browse_documentation | Documentation | Level-by-level retrieval of full command signatures and sub-paths |
execute_code | Execution | Runs short inspection snippets while a background simulation runs |
execute_task | Execution | Submits long solver scripts asynchronously and returns a task_id |
check_task_status | Execution | Streams task state and stdout/error logs without blocking |
interrupt_task | Execution | Halts diverging or stalled simulations while preserving engine state |
list_tasks | Execution | Lists workspace task history and terminal exit states |
7-Model Autonomous Toyoura Sand Calibration Benchmarks
Researchers benchmarked 7 language models across 3 autonomous sessions each (21 runs total, max 12 task submissions, 8-hour limit) calibrating a 5,000-sphere drained triaxial model of dense Toyoura sand against laboratory targets ($E_{50} = 52.5\text{ MPa} \pm 25\%$, $q_{\text{peak}} = 403\text{ kPa} \pm 10\%$, dilation $D = 0.67 \pm 0.10$):
| Model Tested on YADE | Completed Sessions | Target Error ($J$) | Task Submissions | Context Tokens (k) | API Cost (USD) |
|---|---|---|---|---|---|
| DeepSeek-V4.1-Flash-1017 | 3 / 3 | 0.07 – 0.74 | 6 – 7 | 164 – 176 | $0.10 – $0.13 |
| GPT-6.1-sol | 3 / 3 | 0.53 – 0.99 | 3 – 8 | 45 – 65 | $0.36 – $0.64 |
| Claude Opus 5.5 | 3 / 3 | 0.59 – 0.95 | 3 – 4 | 85 – 85 | $1.69 – $1.99 |
| Gemini 4 Argon | 3 / 3 | 0.65 – 0.83 | 2 – 5 | 138 – 180 | $1.93 – $3.04 |
| DeepSeek-V4-Pro | 3 / 3 | 0.58 – 0.87 | 6 – 10 | 203 – 403 | $0.73 – $1.81 |
| Qwen3.8-max-0902 | 3 / 3 | 0.53 – 0.82 | 3 – 5 | 195 – 256 | $3.74 – $6.23 |
| Kimi K3 | 2 / 3 | 0.83 – 1.31 | 6 – 12 | 133 – 172 | $2.63 – $4.93 |
Overall, 20 of 21 sessions hit every physical calibration target, and 19 converged to the same narrow admissible parameter cluster.
# Install open-source DEM MCP servers for YADE or Itasca engines
pip install yade-mcp itasca-mcp
# Start YADE with embedded MCP bridge listening for Smoke Monkey Harness
yade-mcp --workspace ./triaxial_toyoura --port 9081Frequently Asked Questions
Q:What is the difference between itasca-mcp and yade-mcp?
yade-mcp connects AI agents to the open-source YADE discrete element engine, while itasca-mcp connects to commercial Itasca engines including PFC, FLAC, 3DEC, MPoint, and MassFlow using the same 7-tool MCP interface.
Q:Why does the MCP server need both execute_code and execute_task?
execute_task submits multi-minute DEM simulations asynchronously in the background, while execute_code stays responsive while tasks run so the agent can inspect wall stresses, check particle states, and interrupt failing runs early.
Q:How reliable were LLMs on autonomous Toyoura sand DEM calibration?
Across 21 autonomous runs on YADE (3 sessions per model across 7 LLMs), 20 sessions reached all laboratory targets for E_50, peak deviator stress q_peak, and dilation D, with DeepSeek-V4.1-Flash completing 3/3 runs for $0.10–$0.13.
Q:Can a human engineer work inside the simulation GUI at the same time as the agent?
Yes. Because the bridge runs inside the active PFC or YADE process rather than an isolated batch wrapper, edits made by the modeler at the console are immediately visible to the agent.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.