yade-mcp
yade-mcp connects AI agents to the YADE discrete element method (DEM) engine, enabling documentation browsing, API search, and simulation execution.
Browse YADE API (
yade_browse_api): Navigate 350+ classes hierarchically (categories → classes → details), covering engines, materials, interactions, utilities, and simulation control — ~90% of the Python API.Search YADE API by keywords (
yade_query_api): BM25-ranked keyword search across all API docs to find relevant classes or functions (e.g., "friction material", "gravity engine").Execute code synchronously (
yade_execute_code): Run Python code instantly in the live YADE process for quick queries, state inspection (O.bodies,O.iter), and rapid iterative testing.Submit async simulation tasks (
yade_execute_task): Run long Python scripts asynchronously in the background, receiving a task ID immediately.Check task status and output (
yade_check_task_status): Poll the progress, output, and final status of a submitted async task.List task history (
yade_list_tasks): Browse all previously submitted YADE tasks with pagination.Interrupt a running task (
yade_interrupt_task): Gracefully cancel a running async simulation task by its task ID.
Compatible with multiple MCP clients including Claude Code, Codex CLI, Gemini CLI, and OpenCode.
yade-mcp
O.engines += [LLM()] # yet another engine.
yade-mcp connects AI agents to YADE — the open-source discrete element method engine — through the Model Context Protocol. Browse API docs, run simulations, and execute code, all through natural conversation.
Your agent doesn't just call tools — it sits at your YADE console, runs long simulations on its own, and stays in sync with what you're doing.

Works with any MCP client — verified with Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, OpenCode, and toyoura-nagisa.
Features
Your agent types, YADE runs
Powered by yade_execute_code
Describe what you want in plain language. The agent types commands into your YADE console — inspecting particles, tweaking parameters, stepping the engine, analyzing results. It reads each output, debugs, and iterates, the same way you do at the console yourself.
Set it running, walk away
Powered by yade_execute_task + yade_check_task_status + yade_interrupt_task
Run a full YADE script as a background task — just like firing off yade script.py, except you don't have to babysit it. The agent watches on its own: tailing the live output, catching errors as they appear, stopping the run gracefully when something looks off, fixing the script, and resubmitting — until the simulation actually finishes.
New session, no cold start
Powered by yade_list_tasks + yade_check_task_status
Every task you've submitted — the script, the live output, the final state — stays on record. When the context window fills up or you come back the next day, a fresh agent walks into a project that already remembers itself: it lists what's been run, reads what each task produced, and picks up without you re-explaining anything.
A live shell into the running simulation
Powered by yade_execute_code
While a task runs, the agent has a live shell into the simulation — ask it to inspect any variable, dump any object's state, or render a fresh plot on demand, without editing the script or stopping the run.
You type, the agent's in sync
Beyond submitted tasks, every line you type into the YADE console — the variables you peeked at, the parameters you tested, the dead ends you walked away from — flows into the agent's context too. When you turn to chat, it already has the trail of what you've been trying. Learning YADE and want feedback on what you just typed? Stuck on an unexpected error? Just ask — the agent saw what you typed and how YADE answered.
Tools (7)
Two documentation tools (no bridge) and five execution tools (bridge required):
Tool | Purpose | Bridge |
| Walk the YADE Python class tree | No |
| BM25 keyword search across the API | No |
| Run Python in the live YADE process; returns synchronously | Yes |
| Submit a script as a long-running background task | Yes |
| Inspect a running or finished task (output, status) | Yes |
| Gracefully stop a running task | Yes |
| List submitted tasks with metadata | Yes |
Quick Start
Prerequisites
Agentic Setup (Recommended)
Copy this to your AI agent and let it self-configure:
Fetch and follow this bootstrap guide end-to-end:
https://raw.githubusercontent.com/yusong652/yade-mcp/master/docs/agentic/yade-mcp-bootstrap.mdManual Setup
1. Register the MCP server in your client config:
{
"mcpServers": {
"yade-mcp": {
"command": "uvx",
"args": ["yade-mcp"]
}
}
}2. Start the bridge inside YADE:
In a YADE Python console, install the bridge using YADE's own interpreter:
import sys, subprocess
subprocess.check_call([
sys.executable, "-m", "pip", "install", "--user",
"--break-system-packages", "yade-mcp-bridge",
])Restart YADE, then in the Python console:
import yade_mcp_bridge
yade_mcp_bridge.start()Verify
Restart your AI agent (Claude Code, Codex CLI, Gemini CLI, etc.) and ask it to call yade_execute_code to verify the connection.
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT — see LICENSE.
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yusong652/yade-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server