YADE MCP Server

v0.11.2
io.github.yusong652/yade-mcp Checked 8 hours ago Published 1 month ago

MCP server for YADE — open-source DEM engine.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

yade_browse_api Yade Browse Api

Browse YADE's Python API as a YADE-native class tree. The tree is rooted in YADE's real inheritance hierarchy: paths mirror the class's __mro__ up to its category root. No shortcuts — always drill through parents.

ParameterTypeDescription
pathDot-separated path into YADE's class hierarchy. Navigation is tree-driven (no class-name shortcuts). - None or '': list top-level categories (engine / functor / material / shape / ...) - 'engine': lis…

yade_query_api Yade Query Api

Search YADE API documentation by keywords (like grep). Returns matching class/function names with descriptions ranked by relevance. Use yade_browse_api for full documentation of a specific class. When to use: - You have keywords but don't know the exact class name - Examples: "friction material", "gravity engine", "contact force", "triaxial stress", "sphere create", "hertz mindlin" Related tools: - yade_browse_api: Get full documentation for a known class path

ParameterTypeDescription
query *stringSearch keywords for YADE Python API. Examples: 'sphere body', 'triaxial compression', 'contact force'. Case-insensitive.
limitintegerMaximum number of results (1-20).

yade_execute_task Yade Execute Task

Submit a Python script for asynchronous execution in YADE. Returns a task_id immediately; the script is queued and runs in the background. Tasks run one at a time in submit order (they share the YADE process and its single simulation state), so a multi-stage pipeline can be submitted in one go — each stage starts when the previous one finishes. Use the companion tools to manage the task lifecycle: - yade_check_task_status: poll output, progress, and final status - yade_interrupt_task: stop a running task or cancel a queued one - yade_list_tasks: browse task history (also shows queue order)…

ParameterTypeDescription
description *stringBrief task purpose
script_path *stringAbsolute path to entry Python script for YADE

yade_check_task_status Yade Check Task Status

Check status and output for a submitted YADE task.

ParameterTypeDescription
task_id *stringTask ID returned by yade_execute_task
filterOnly keep output lines containing this text
limitintegerOutput lines per page
skip_newestintegerSkip N newest output lines before pagination
wait_secondsnumberLong-poll: return when the task changes state or after this many seconds. 0 = immediate.

yade_list_tasks Yade List Tasks

List tracked YADE tasks with pagination. Tasks are listed newest first. Queued (pending) tasks run one at a time in submit order, so among the pending entries the one furthest down the list runs next.

ParameterTypeDescription
limitintegerMax tasks to return
skip_newestintegerSkip N most recent tasks before listing

yade_interrupt_task Yade Interrupt Task

Stop a running YADE task, or cancel one still waiting in the queue. A task that has not started yet is simply removed from the queue and ends in status ``canceled`` (``method`` reports ``canceled_while_queued``). For a running task, two cancellation paths are applied together by the bridge: - ``flag_only`` — sets an interrupt flag that YADE's PyRunner tick observes between simulation iterations (graceful path for ``O.run`` tasks). - ``flag_and_async_exc`` — in addition, injects a ``TaskInterrupt`` exception into the script thread, so pure-Python deadloops with no ``O.run`` on the…

ParameterTypeDescription
task_id *stringTask ID returned by yade_execute_task

yade_execute_code Yade Execute Code

Execute Python code synchronously in the running YADE process. Returns stdout immediately. Code runs in the YADE Python environment where yade modules are already imported; side effects persist. This tool remains responsive EVEN WHILE a simulation task is running (submitted via yade_execute_task). Use it as a live REPL to inspect simulation state in real time — no need to pre-script print statements. Typical uses: - Query simulation state: O.bodies count, current iteration - Create/modify bodies, engines, interactions - Read or set material properties - Live inspection during a running si…

ParameterTypeDescription
code *stringPython code to execute in YADE process
timeoutintegerSeconds before the bridge aborts the snippet; longer work belongs in yade_execute_task.