{
  "markdown": "# yade-mcp\n\n<!-- mcp-name: io.github.yusong652/yade-mcp -->\n\n<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/yusong652/yade-mcp/assets/assets/header.gif\" alt=\"yade-mcp header\" width=\"720\">\n</p>\n\n[English](https://github.com/yusong652/yade-mcp/blob/master/README.md) | [简体中文](https://github.com/yusong652/yade-mcp/blob/master/README.zh-CN.md)\n\n[![PyPI](https://img.shields.io/pypi/v/yade-mcp)](https://pypi.org/project/yade-mcp/)\n[![Downloads](https://static.pepy.tech/badge/yade-mcp)](https://pepy.tech/project/yade-mcp)\n[![GitHub stars](https://img.shields.io/github/stars/yusong652/yade-mcp)](https://github.com/yusong652/yade-mcp/stargazers)\n[![Glama](https://glama.ai/mcp/servers/yusong652/yade-mcp/badges/score.svg)](https://glama.ai/mcp/servers/yusong652/yade-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)\n\n`O.engines += [LLM()]  # yet another engine.`\n\n**yade-mcp** connects AI agents to [YADE](https://yade-dem.org/) — the open-source discrete element method engine — through the [Model Context Protocol](https://modelcontextprotocol.io/). Browse API docs, run simulations, and execute code, all through natural conversation.\n\nYour 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.\n\n![yade-mcp demo](https://raw.githubusercontent.com/yusong652/yade-mcp/assets/assets/demo.gif)\n\n*Works with any MCP client — verified with Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, OpenCode, and toyoura-nagisa.*\n\n## Features\n\n### Your agent types, YADE runs\n\n*Powered by `yade_execute_code`*\n\nDescribe 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.\n\n### Set it running, walk away\n\n*Powered by `yade_execute_task` + `yade_check_task_status` + `yade_interrupt_task`*\n\nRun 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.\n\n### New session, no cold start\n\n*Powered by `yade_list_tasks` + `yade_check_task_status`*\n\nEvery 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.\n\n### A live shell into the running simulation\n\n*Powered by `yade_execute_code`*\n\nWhile 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.\n\n### You type, the agent's in sync\n\nBeyond 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.\n\n## Tools (7)\n\nTwo documentation tools (no bridge) and five execution tools (bridge required):\n\n| Tool | Purpose | Bridge |\n| --- | --- | --- |\n| `yade_browse_api` | Walk the YADE Python class tree | No |\n| `yade_query_api` | BM25 keyword search across the API | No |\n| `yade_execute_code` | Run Python in the live YADE process; returns synchronously | Yes |\n| `yade_execute_task` | Submit a script as a long-running background task | Yes |\n| `yade_check_task_status` | Inspect a running or finished task (output, status) | Yes |\n| `yade_interrupt_task` | Gracefully stop a running task | Yes |\n| `yade_list_tasks` | List submitted tasks with metadata | Yes |\n\n## Quick Start\n\n### Prerequisites\n\n- **[YADE](https://yade-dem.org/doc/installation.html)** installed\n- **[uv](https://docs.astral.sh/uv/getting-started/installation/)** installed (for `uvx`)\n\n### Agentic Setup (Recommended)\n\nCopy this to your AI agent and let it self-configure:\n\n```text\nFetch and follow this bootstrap guide end-to-end:\nhttps://raw.githubusercontent.com/yusong652/yade-mcp/master/docs/agentic/yade-mcp-bootstrap.md\n```\n\n### Manual Setup\n\n**1. Register the MCP server** in your client config:\n\n```json\n{\n  \"mcpServers\": {\n    \"yade-mcp\": {\n      \"command\": \"uvx\",\n      \"args\": [\"yade-mcp\"]\n    }\n  }\n}\n```\n\n**2. Start the bridge inside YADE:**\n\nIn a YADE Python console, install the bridge using YADE's own interpreter:\n\n```python\nimport sys, subprocess\nsubprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--user\", \"yade-mcp-bridge\"])\n```\n\nOn PEP 668 externally-managed environments (pip refuses `--user`), see the [bootstrap guide](docs/agentic/yade-mcp-bootstrap.md) for a portable form.\n\nRestart YADE, then in the Python console:\n\n```python\nimport yade_mcp_bridge\nyade_mcp_bridge.start()\n```\n\n### Verify\n\nRestart your AI agent (Claude Code, Codex CLI, Gemini CLI, etc.) and ask it to call `yade_execute_code` to verify the connection.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n",
  "bytes": 5690,
  "sha": "6940048dae0e61f8371ecef7b9cec12869f007a3343f7ae78d14f4c3b4410321",
  "repo_slug": "yusong652/yade-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_yusong652_yade_mcp_1261151b/readme"
}