Skip to main content
Glama

yade-mcp

English | 简体中文

PyPI Downloads GitHub stars Glama License: MIT Python 3.10+

O.engines += [LLM()] # 또 다른 엔진.

yade-mcp는 Model Context Protocol을 통해 AI 에이전트를 YADE — 오픈 소스 이산 요소법 엔진 — 와 연결합니다. 자연스러운 대화를 통해 API 문서를 탐색하고, 시뮬레이션을 실행하며, 코드를 실행할 수 있습니다.

에이전트는 단순히 도구를 호출하는 것에 그치지 않고, YADE 콘솔에 상주하며 스스로 긴 시뮬레이션을 실행하고 사용자의 작업과 동기화 상태를 유지합니다.

yade-mcp demo

기능

에이전트가 입력하고, YADE가 실행합니다

yade_execute_code 기반

원하는 작업을 평문으로 설명하세요. 에이전트가 YADE 콘솔에 명령어를 입력하여 입자를 검사하고, 매개변수를 조정하며, 엔진 단계를 진행하고, 결과를 분석합니다. 에이전트는 사용자가 콘솔에서 직접 작업하는 것과 동일하게 각 출력을 읽고, 디버깅하며, 반복 작업을 수행합니다.

실행해 두고, 자리를 비우세요

yade_execute_task + yade_check_task_status + yade_interrupt_task 기반

yade script.py를 실행하는 것처럼 전체 YADE 스크립트를 백그라운드 작업으로 실행하세요. 단, 계속 지켜볼 필요는 없습니다. 에이전트가 스스로 실시간 출력을 추적하고, 오류 발생 시 포착하며, 문제가 보이면 안전하게 실행을 중단하고, 스크립트를 수정하여 시뮬레이션이 완료될 때까지 다시 제출합니다.

새로운 세션, 콜드 스타트 없음

yade_list_tasks + yade_check_task_status 기반

제출한 모든 작업(스크립트, 실시간 출력, 최종 상태)이 기록으로 남습니다. 컨텍스트 창이 가득 차거나 다음 날 다시 돌아왔을 때, 새로운 에이전트가 이미 스스로를 기억하는 프로젝트에 투입됩니다. 에이전트는 무엇이 실행되었는지 나열하고, 각 작업의 결과를 읽으며, 사용자가 다시 설명할 필요 없이 작업을 이어받습니다.

실행 중인 시뮬레이션에 대한 실시간 셸

yade_execute_code 기반

작업이 실행되는 동안 에이전트는 시뮬레이션에 대한 실시간 셸을 가집니다. 스크립트를 수정하거나 실행을 중단할 필요 없이, 변수 검사, 객체 상태 덤프, 새로운 플롯 생성 등을 요청할 수 있습니다.

사용자가 입력하면, 에이전트가 동기화합니다

제출된 작업 외에도, 사용자가 YADE 콘솔에 입력하는 모든 내용(확인한 변수, 테스트한 매개변수, 시도하다 중단한 작업 등)이 에이전트의 컨텍스트로 전달됩니다. 대화를 시작하면 에이전트는 이미 사용자가 무엇을 시도했는지 파악하고 있습니다. YADE를 배우는 중이며 방금 입력한 내용에 대한 피드백이 필요한가요? 예상치 못한 오류로 막혔나요? 그냥 물어보세요. 에이전트는 사용자가 무엇을 입력했고 YADE가 어떻게 응답했는지 알고 있습니다.

Related MCP server: itasca-mcp

도구 (7)

두 개의 문서 도구(브리지 불필요)와 다섯 개의 실행 도구(브리지 필요):

도구

목적

브리지

yade_browse_api

YADE 파이썬 클래스 트리 탐색

아니오

yade_query_api

API 전체에 대한 BM25 키워드 검색

아니오

yade_execute_code

실시간 YADE 프로세스에서 파이썬 실행; 동기식 반환

예

yade_execute_task

스크립트를 장기 실행 백그라운드 작업으로 제출

예

yade_check_task_status

실행 중이거나 완료된 작업 검사 (출력, 상태)

예

yade_interrupt_task

실행 중인 작업을 안전하게 중단

예

yade_list_tasks

제출된 작업을 메타데이터와 함께 나열

예

빠른 시작

사전 요구 사항

  • YADE 설치됨

  • uv 설치됨 (uvx용)

에이전트 설정 (권장)

이를 AI 에이전트에 복사하여 스스로 구성하도록 하세요:

Fetch and follow this bootstrap guide end-to-end:
https://raw.githubusercontent.com/yusong652/yade-mcp/master/docs/agentic/yade-mcp-bootstrap.md

수동 설정

1. 클라이언트 설정에 MCP 서버 등록:

{
  "mcpServers": {
    "yade-mcp": {
      "command": "uvx",
      "args": ["yade-mcp"]
    }
  }
}

2. YADE 내부에서 브리지 시작:

pip install yade-mcp-bridge

그런 다음 YADE 파이썬 콘솔에서:

import yade_mcp_bridge
yade_mcp_bridge.start()

확인

AI 에이전트(Claude Code, Codex CLI, Gemini CLI 등)를 재시작하고 yade_execute_code를 호출하여 연결을 확인하세요.

기여

개발 설정 및 가이드라인은 CONTRIBUTING.md를 참조하세요.

라이선스

MIT — LICENSE 참조.

Available Tools

7 tools
yade_browse_apiA

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.

Inputs: path. Returns: object

yade_check_task_statusC

Check status and output for a submitted YADE task.

Inputs: task_id (required), limit, filter, skip_newest, +1 more. Returns: object

yade_execute_codeA

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 simulation (e.g. check stress tensor, coordination number, energy balance, or capture viewport screenshots when GUI is available)

  • Development and REPL-style testing

O.engines[0] holds a PyRunner that belongs to the bridge (its command calls _mcpPyrunnerTick). Ignore it: assign O.engines as usual, the bridge re-adds the PyRunner before every O.run().

Unlike yade_execute_task, this tool is fire-and-return: the response contains the full output. It is NOT tracked by yade_list_tasks and cannot be interrupted or polled.

Timeout behaviour: on timeout the bridge attempts to abort the running code. The response is an error envelope (ok=false) whose error.code is one of:

  • interrupted — the code was running a simulation cycle (O.run) and was paused cleanly at an iteration boundary. For long simulations or solving to equilibrium, switch to yade_execute_task — it tracks progress and stops cleanly via yade_interrupt_task.

  • terminated — a non-cycle abort succeeded (async exception injection); the pump thread is free, but YADE state may be partially modified by the code that ran before the abort fired. Inspect state before retrying.

  • timeout — abort failed (code stuck in a C extension, or nested inside a running task's PyRunner tick); the bridge may still be blocked. Restart if unresponsive.

WARNING: For anything expected to take more than a few seconds, use yade_execute_task instead — it has proper cancellation via yade_interrupt_task and does not leave state drift on timeout. Also, do NOT write except BaseException: in your code; it defeats bridge-initiated cancellation.

Inputs: code (required), timeout. Returns: object

yade_execute_taskA

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)

Use this for production simulation runs, long O.run() cycles, and any operation that may take minutes or longer. For quick queries and REPL-style testing, use yade_execute_code.

O.engines[0] holds a PyRunner that belongs to the bridge (its command calls _mcpPyrunnerTick). The script does not need to keep it: assign O.engines as usual, the bridge re-adds the PyRunner before every O.run().

Inputs: description (required), script_path (required). Returns: object

yade_interrupt_taskA

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 stack are terminated too.

The response method field reports which path ran. When async-exc is refused (e.g. target thread is a Dummy-N boost::python frame), async_exc_skipped_reason explains why.

Namespace after interrupt: the YADE __main__ namespace is shared between tasks and yade_execute_code calls. Any variables the interrupted script had already defined — including O state — are preserved. There's no need to re-run the whole script to continue work: inspect state with yade_execute_code or resume via a fresh yade_execute_task that only runs the remaining logic.

Inputs: task_id (required). Returns: object

yade_list_tasksA

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.

Inputs: limit, skip_newest. Returns: object

yade_query_apiA

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

Inputs: query (required), limit. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 7 tools

    Disambiguation5/5

    The two execution tools are explicitly contrasted: yade_execute_task is async long-running tracked work, while yade_execute_code is a synchronous fire-and-return REPL, and both descriptions spell this out. The API tools are likewise distinct: yade_query_api is keyword search, yade_browse_api drills into the class tree, and the lifecycle tools (status/list/interrupt) each handle a clearly separate concern.

    Naming Consistency5/5

    All seven tools share a uniform yade_ prefix followed by snake_case verb_noun (execute_task, execute_code, check_task_status, interrupt_task, list_tasks, browse_api, query_api). The pattern is predictable and readable throughout.

    Tool Count5/5

    Seven tools is well-scoped for a simulation bridge: two execution modes, three async-lifecycle operations, and two API-discovery helpers. Each tool earns its place with no redundancy or filler.

    Completeness4/5

    The surface covers the core lifecycle (submit, poll, list, cancel) plus API discovery and live REPL inspection, which is a coherent workflow. Minor gaps exist — no explicit task cleanup/deletion or a dedicated bulk-output retrieval beyond status polling — but these are workable around.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      This project provides a robust integration between AI assistants and FreeCAD CAD software using the Model Context Protocol (MCP). It allows external applications to interact with FreeCAD through a standardized interface, offering multiple connection methods and specialized tools.
      27
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      MCP server that gives AI agents full access to ITASCA PFC - browse documentation, run simulations, capture plots, all through natural conversation. Built on the Model Context Protocol, pfc-mcp turns any MCP-compatible AI client (Claude Code, Codex CLI, Gemini CLI, OpenCode, toyoura-nagisa, etc.) into a PFC co-pilot that can look up commands, execute scripts, monitor long-running simulations.
      7
      232
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI agents to automate COMSOL Multiphysics simulations, including model management, geometry building, physics configuration, meshing, solving, and results visualization through the MCP protocol.
      78
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Automates OpenFOAM CFD simulations via MCP, enabling AI agents to mesh, run, and post-process cases from natural language prompts without any API keys.
      MIT