Integrations & Tools
~9 min readUpdated: November 2026

Connecting AI Agents to Live Discrete Element Simulations via MCP

MCP Discrete Element Simulation Agents connecting itasca-mcp and yade-mcp to live 3D DEM cubes

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Exampledem-simulation-mcp-agent.ts
dem-simulation-mcp-agent.tstypescript
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);
Video Guides

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 ToolCategoryLive Concurrency Behavior
query_documentationDocumentationKeyword search returning matching manual paths (prevents API hallucination)
browse_documentationDocumentationLevel-by-level retrieval of full command signatures and sub-paths
execute_codeExecutionRuns short inspection snippets while a background simulation runs
execute_taskExecutionSubmits long solver scripts asynchronously and returns a task_id
check_task_statusExecutionStreams task state and stdout/error logs without blocking
interrupt_taskExecutionHalts diverging or stalled simulations while preserving engine state
list_tasksExecutionLists workspace task history and terminal exit states

Inside the Threaded Engine Bridge: Co-Working with Human Engineers

Unlike batch-file wrapper agents that launch isolated subprocesses and parse logs post-mortem, the itasca-mcp and yade-mcp bridge embeds inside the active Itasca PFC (plus FLAC, 3DEC, MPoint, MassFlow) or YADE session. When a human modeler tweaks a servo wall or plots a force-chain slice in the GUI, the agent reads the updated state directly via execute_code.

During live trials, this non-blocking inspect-and-interrupt loop caught severe runtime bugs early: when lateral confining servo walls failed to load (wall.vel() zeroed) or unit conversions wrote Pascals into a kilopascal CSV column ($q_{\text{peak}} = 900,000\text{ kPa}$), agents queried running particle states via execute_code, invoked interrupt_task, patched the script, and avoided wasting hours of solver compute.

Never Rely on Pretraining for Simulation APIs

All tested frontier LLMs hallucinated nonexistent methods like w.velocity() or ball.list()[0]. Always pair execute_code with query_documentation and browse_documentation so agents resolve exact engine signatures dynamically.

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 YADECompleted SessionsTarget Error ($J$)Task SubmissionsContext Tokens (k)API Cost (USD)
DeepSeek-V4.1-Flash-10173 / 30.07 – 0.746 – 7164 – 176$0.10 – $0.13
GPT-6.1-sol3 / 30.53 – 0.993 – 845 – 65$0.36 – $0.64
Claude Opus 5.53 / 30.59 – 0.953 – 485 – 85$1.69 – $1.99
Gemini 4 Argon3 / 30.65 – 0.832 – 5138 – 180$1.93 – $3.04
DeepSeek-V4-Pro3 / 30.58 – 0.876 – 10203 – 403$0.73 – $1.81
Qwen3.8-max-09023 / 30.53 – 0.823 – 5195 – 256$3.74 – $6.23
Kimi K32 / 30.83 – 1.316 – 12133 – 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.

bash
# 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 9081
Google Search Questions & Answers

Frequently 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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness