ANSYS Workbench MCP

ANSYS Workbench MCP

A clean MCP server and ACT extension for controlling ANSYS Workbench and ANSYS Mechanical from any MCP client, enabling launching Workbench journals, executing Mechanical Python scripts, and interacting with a running Mechanical session via file queue or socket timer bridge.

Category
访问服务器

README

ANSYS Workbench MCP

中文说明

A clean, GitHub-ready MCP server and ACT extension for controlling ANSYS Workbench and ANSYS Mechanical from Kimi, Claude, Codex, or any other MCP client.

The package exposes MCP tools that can:

  • detect the ANSYS Workbench/Mechanical environment,
  • launch Workbench journals,
  • launch Mechanical Python scripts via ansys-mechanical,
  • track asynchronous jobs,
  • submit Python requests to a running Mechanical session through a file queue,
  • execute Python inside Mechanical through a localhost socket timer bridge.

Note: This package does not include ANSYS binaries or solver licenses. It only provides the glue between an MCP client and a locally installed ANSYS product.


Prerequisites

  • Windows (Workbench/Mechanical and the ACT extension are Windows-only).
  • ANSYS Workbench / Mechanical 2024 R2 or later (paths in this repo use v242 as the default).
  • The WorkbenchMCP ACT extension enabled inside Mechanical.
  • Python 3.10+ (the py launcher is used by setup.ps1).
  • A local ANSYS license and, for Mechanical scripting, a running Mechanical GUI.

Quick Install

Open a PowerShell window in the package root and run:

.\setup.ps1

The script will:

  1. Detect the ANSYS install root from ANSYS_ROOT, AWP_ROOT*, or common paths.
  2. Create a Python virtual environment at .venv and install this package in editable mode with the mechanical extras.
  3. Copy workbench_plugin\* into %APPDATA%\Ansys\<v242>\ACT\extensions\WorkbenchMCP.
  4. Register the MCP server in both ~\.kimi\mcp.json and ~\.claude\settings.json.

If the auto-detected version is wrong, override it:

.\setup.ps1 -Version 251

Restart your MCP client after the script finishes.


Manual ACT Extension Installation

If you prefer not to run setup.ps1, or you are on a version that the script did not detect, install the ACT extension manually:

  1. Copy the files in workbench_plugin\ to:

    %APPDATA%\Ansys\v242\ACT\extensions\WorkbenchMCP\
    

    Replace v242 with your actual ANSYS version folder.

  2. The extension directory should contain:

    WorkbenchMCP.xml
    main.py
    mechanical_queue_processor.py
    mechanical_socket_timer_v7.py
    
  3. Open ANSYS Workbench, start a project, and open Mechanical.

  4. In Mechanical, enable the Workbench MCP toolbar from Automation > ACT Extensions if it is not already visible.


Using the MCP Tools

Once the server is registered and Mechanical is open with the ACT extension loaded, the following tool categories are available:

1. Detection

  • workbench_detect_tool — finds RunWB2.exe, the PyMechanical CLI, the ANSYS root, and job directories.

2. Launch Workbench Journals

  • workbench_run_journal_tool — runs a Workbench journal (.py or .wbjn) asynchronously.
  • workbench_job_status_tool — checks whether a launched job is still running.
  • workbench_job_log_tool — reads stdout or stderr for a job.
  • workbench_list_jobs_tool — lists recent jobs.

3. Run Mechanical Scripts

  • mechanical_run_script_tool — launches ansys-mechanical.exe with a Python script.

4. Mechanical File Queue

These tools talk to a file-based queue that Mechanical processes through the ACT extension:

  • workbench_queue_install_info_tool — shows the queue folder paths and instructions.
  • workbench_queue_submit_tool — submits a raw JSON request to the queue.
  • workbench_queue_list_tool — lists pending requests and responses.
  • workbench_queue_response_tool — reads a response by request ID.
  • workbench_queue_ping_tool — sends a ping and waits for Mechanical to process it.
  • workbench_queue_state_tool — reads the current Mechanical state.
  • workbench_queue_execute_python_tool — executes Python inside the open Mechanical session.
  • workbench_queue_process_with_socket_timer_tool — asks the socket timer bridge to process the pending queue.

5. Mechanical Socket Timer Bridge

The socket timer runs inside Mechanical on 127.0.0.1:9885 and provides the fastest round-trip execution:

  • workbench_socket_timer_ping_tool — ping the bridge.
  • workbench_socket_timer_state_tool — read the bridge state.
  • workbench_socket_timer_execute_python_tool — execute Python in Mechanical.
  • workbench_socket_timer_stop_tool — stop the bridge.

You can start the bridge from the Workbench MCP toolbar in Mechanical (Socket Timer Start). With WORKBENCH_MCP_AUTO_START_SOCKET=1 (the default), the ACT extension attempts to start it automatically when Mechanical loads.


Example Prompts / Workflow

Verify the environment

Run workbench_detect_tool to make sure ANSYS Workbench and the PyMechanical CLI are found.

Open a project and launch Mechanical

Set ANSYS_PROJECT_PATH to the .wbpj file you want to open, then run the journal:

Use workbench_run_journal_tool with journals/open_project_and_edit_model.py to open the project at C:\Models\my_model.wbpj.

Set ANSYS_PROJECT_PATH in the MCP server environment or pass it to the journal process.

Execute Python inside the open Mechanical session

Use workbench_socket_timer_execute_python_tool to list the analyses in the open Mechanical model: print([a.Name for a in Model.Analyses])

Diagnose a project without opening the GUI

Run the diagnose_project.py journal against C:\Models\my_model.wbpj and show the output.

Boundaries and Limitations

Please read these carefully to set correct expectations:

  • Mechanical must be open with the ACT extension loaded. The MCP tools cannot drive a fully headless, unattended batch FEA workflow on their own. The file queue and socket timer require an active Mechanical GUI session.
  • Localhost-only transport. The file queue and socket timer bridge listen on 127.0.0.1:9885. They are not exposed to the network and are not secure for multi-user or remote use.
  • Long solves require client polling. workbench_run_journal_tool and mechanical_run_script_tool launch jobs asynchronously. The MCP client must call workbench_job_status_tool or workbench_job_log_tool to wait for completion.
  • Workbench project locks can block saves. If a .wbpj project is already open in another Workbench process, the lock files may prevent save_project.py from overwriting the project. The journals include best-effort lock cleanup, but this is not a guarantee.
  • No ANSYS binaries or licenses are included. You must provide a licensed ANSYS installation and a valid Python environment. The mechanical extras install ansys-mechanical-core; the actual solver remains ANSYS-owned.
  • The ACT extension lives in the user profile. setup.ps1 copies it to %APPDATA%\Ansys\<version>\ACT\extensions\WorkbenchMCP. This is per-user, per-version, and may need to be repeated after a major ANSYS upgrade.

Repository Layout

ansys-workbench-mcp/
├── server.py                          # FastMCP server exposing all tools
├── pyproject.toml                     # Package metadata and dependencies
├── .env.example                       # Environment variables template
├── .gitignore                         # Ignores runtime outputs
├── setup.ps1                          # One-click install script
├── install_mcp_config.py              # JSON merge helper for MCP configs
├── README.md                          # This file
├── examples/
│   └── codex_config.example.toml      # Example Codex MCP config shape
├── journals/                          # Reusable Workbench journal scripts
│   ├── open_project_and_edit_model.py
│   ├── update_model2.py
│   ├── save_project.py
│   ├── diagnose_project.py
│   └── workbench_lock_utils.py
├── tools/                             # Python-side MCP helpers
│   ├── workbench_bridge.py
│   ├── workbench_file_queue.py
│   └── workbench_socket_timer.py
└── workbench_plugin/                  # ACT extension for Mechanical
    ├── WorkbenchMCP.xml
    ├── main.py
    ├── mechanical_queue_processor.py
    └── mechanical_socket_timer_v7.py

License and Legal

This is an independent integration package. It is not affiliated with or endorsed by ANSYS, Inc. ANSYS, Workbench, Mechanical, and related trademarks are property of ANSYS, Inc. or its subsidiaries.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选