Skip to content
Back to search

ANSYS-Workbench-mcp

基于 MCP 的 Ansys Workbench 本地桥接工具,支持 Codex 通过 Workbench journal、文件队列 IPC 和 MAPDL 批处理实现项目创建、更新与分析自动化。

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/hongwenwang36-eng/ANSYS-Workbench-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/hongwenwang36-eng/ANSYS-Workbench-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/hongwenwang36-eng--ansys-workbench-mcp/badge.svg)](/listings/hongwenwang36-eng--ansys-workbench-mcp)

HTML

<a href="/listings/hongwenwang36-eng--ansys-workbench-mcp"><img src="/api/listings/hongwenwang36-eng--ansys-workbench-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

cd D:\
git clone https://github.com/hongwenwang36-eng/ANSYS-Workbench-mcp.git ansys-workbench-mcp
cd D:\ansys-workbench-mcp
py -3.13 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt

没有 Python 3.13 时,可用 `py -0p` 查看已安装版本,并替换上面的版本号。

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 240 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Ansys Workbench MCP
  2. <div align="center">
  3. [English](README.en.md) | **简体中文** | [繁體中文](README.zh-TW.md) | [한국어](README.ko.md) | [日本語](README.ja.md)
  4. </div>
  5. ![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python&logoColor=white)
  6. ![Platform](https://img.shields.io/badge/Platform-Windows-0078D4?logo=windows)
  7. ![Ansys](https://img.shields.io/badge/Tested-Ansys%202025%20R1-FFB71B)
  8. ![License](https://img.shields.io/badge/License-MIT-green)
  9. 让 Codex 或其他 MCP 客户端直接控制 **SpaceClaim、Ansys Workbench、Ansys Meshing、System Coupling、ICEM CFD、MAPDL、Fluent、CFX-Pre、CFX Solver 和 CFD-Post**。
  10. 项目使用 Ansys 官方支持的 Journal、Workbench Scripting、Tcl/Replay 和批处理入口,不依赖鼠标点击或屏幕识别。
  11. > [!NOTE]
  12. > 本项目不是 Ansys 官方产品。目前面向 Windows,并在 Ansys 2025 R1 上完成实机验证。
  13. ## 可实现的仿真
  14. | 仿真类型 | 求解器 | 已实测的范围 |
  15. | --- | --- | --- |
  16. | 结构静力与非线性 | Mechanical APDL | 线性静力、无摩擦接触、双线性塑性 |
  17. | 结构动力学 | Mechanical APDL | 模态、预应力模态、谐响应、瞬态、响应谱、随机振动 |
  18. | 热分析 | Mechanical、Mechanical APDL | 稳态导热、瞬态加热 |
  19. | 热–结构耦合 | Mechanical APDL | 将温度场传给结构模型,计算热膨胀 |
  20. | 流体仿真 | Fluent、CFX | 流道流动、静态混合、空化 |
  21. | 共轭传热 | Fluent | 求解流体与固体温度场,核对界面热流 |
  22. | 双向流固耦合 | System Coupling、Fluent、Mechanical APDL | 交换流体力与结构位移。CFX–Mechanical 的 Workbench 路线已验证系统拓扑 |
  23. ## 实测案例 · Fluent 双向流固耦合
  24. 脉动水流经过双材料柔性悬臂挡板。Fluent 计算流体载荷,System Coupling 将载荷传给 Mechanical APDL,并将结构位移反馈给 Fluent 动网格。
  25. - 流道尺寸为 80.6 × 22 × 4 mm,挡板高 10 mm、厚 0.6 mm。入口水速在 0.12 s 内从零升至 0.09 m/s,再降至零。
  26. - 24 个时间步均已收敛,界面两个方向的映射面积覆盖率均为 100%。挡板最大总位移为 0.259 mm,最大节点平均等效应力为 43.7 kPa,均出现在 45 ms。
  27. - 60 ms 时跨中截面最大流速为 0.299 m/s。结果来自一套网格和固定时间步长,尚未进行网格及时间步长独立性验证。
  28. **60 ms 水流速度与静表压**
  29. ![Fluent 流固耦合算例的速度与压力云图](docs/images/fluent-fsi-flow.png)
  30. **45 ms 挡板位移与等效应力**
  31. ![Fluent 流固耦合算例的结构位移与应力云图](docs/images/fluent-fsi-structure.png)
  32. ## 工作原理
  33. Codex 或其他 MCP 客户端通过标准输入输出(stdio)调用本地 Python 服务。服务根据工具选择常驻桥接或批处理,并通过 MCP 返回执行状态、日志摘要或文件路径。
  34. ```mermaid
  35. flowchart LR
  36. Client["MCP 客户端"] <-->|stdio| Server["MCP Server"]
  37. Server --> Live["常驻桥接"]
  38. Server --> Batch["批处理(可后台)"]
  39. Live --> Output["结果与日志"]
  40. Batch --> Output
  41. Output -.-> Checks["诊断与校验"]
  42. ```
  43. - **常驻桥接。** Workbench 通过 JSON 命令文件与当前工程会话通信,可创建分析系统、更新工程、配置 System Coupling。ICEM CFD 通过 Tcl 命令文件在当前会话中执行脚本,两个桥接都通过 JSON 返回响应。
  44. - **批处理。** 服务向 Ansys 程序传入 Journal、脚本或求解输入文件,可运行 SpaceClaim 几何、独立 Ansys Meshing、ICEM Replay、MAPDL、Fluent、CFX、CFD-Post 和独立 System Coupling。前面的 Fluent 流固耦合案例使用独立 System Coupling,在 Fluent 与 MAPDL 之间交换流体力和结构位移。
  45. - **后台作业。** 长时间批处理可用 `start_ansys_job` 提交。凭作业 ID 可用 `get_ansys_job` 在重连后查询状态和日志,也可用 `stop_ansys_job` 取消本地作业。
  46. - **结果检查。** 需要排查失败时,用 `diagnose_ansys_log` 定位求解日志中的错误。需要验收计算指标时,用 `verify_simulation` 检查 CSV 数据的单位和阈值。默认运行时目录(如 `commands/`、`results/`、`icem/`、`runs/`)由服务按需创建,并由 `.gitignore` 排除。
  47. ## 快速开始
  48. ### 1. 安装
  49. ```powershell
  50. cd D:\
  51. git clone https://github.com/hongwenwang36-eng/ANSYS-Workbench-mcp.git ansys-workbench-mcp
  52. cd D:\ansys-workbench-mcp
  53. py -3.13 -m venv .venv
  54. .\.venv\Scripts\python.exe -m pip install -r requirements.txt
  55. ```
  56. 没有 Python 3.13 时,可用 `py -0p` 查看已安装版本,并替换上面的版本号。
  57. ### 2. 配置 Codex
  58. 在 `%USERPROFILE%\.codex\config.toml` 中加入:
  59. ```toml
  60. [mcp_servers.ansys-workbench]
  61. command = 'D:\ansys-workbench-mcp\.venv\Scripts\python.exe'
  62. args = ['D:\ansys-workbench-mcp\mcp_server.py']
  63. cwd = 'D:\ansys-workbench-mcp'
  64. startup_timeout_sec = 30
  65. tool_timeout_sec = 600
  66. enabled = true
  67. [mcp_servers.ansys-workbench.env]
  68. ANSYS_WORKBENCH_MCP_HOME = 'D:\ansys-workbench-mcp'
  69. ANSYS_RUNWB2 = 'D:\Program Files\ANSYS Inc\v251\Framework\bin\Win64\RunWB2.exe'
  70. ANSYS_MECHANICAL = 'D:\Program Files\ANSYS Inc\v251\aisol\bin\winx64\AnsysWBU.exe'
  71. ANSYS_MAPDL = 'D:\Program Files\ANSYS Inc\v251\ansys\bin\winx64\ANSYS251.exe'
  72. ANSYS_FLUENT = 'D:\Program Files\ANSYS Inc\v251\fluent\ntbin\win64\fluent.exe'
  73. ANSYS_SPACECLAIM = 'D:\Program Files\ANSYS Inc\v251\scdm\SpaceClaim.exe'
  74. ANSYS_CFX_SOLVE = 'D:\Program Files\ANSYS Inc\v251\CFX\bin\cfx5solve.exe'
  75. ANSYS_CFX_PRE = 'D:\Program Files\ANSYS Inc\v251\CFX\bin\cfx5pre.exe'
  76. ANSYS_CFX_POST = 'D:\Program Files\ANSYS Inc\v251\CFX\bin\cfx5post.exe'
  77. ANSYS_ICEM_CFD = 'D:\Program Files\ANSYS Inc\v251\icemcfd\win64_amd\bin\icemcfd.bat'
  78. ANSYS_SYSTEM_COUPLING = 'D:\Program Files\ANSYS Inc\v251\SystemCoupling\bin\systemcoupling.bat'
  79. ```
  80. 如果安装位置不同,修改对应环境变量。保存后重启 Codex。
  81. ### 3. 检查连接
  82. 先调用 `check_ansys_installation` 检查 Ansys 程序路径。操作当前 Workbench 工程时再启动并检查常驻桥接。
  83. ```text
  84. start_workbench_bridge
  85. check_workbench_connection
  86. ```
  87. 独立 Ansys Meshing 和求解器批处理可以直接调用。
  88. ## 专业 Skill 与实机基准
  89. 12 个项目级 Skill 覆盖工作流、几何、网格、结构、动力学、热、CFD、耦合、参数研究、诊断、验证和后处理。[Skill 清单与复跑方法](docs/skills-and-validation.md)
  90. [完整实机验证记录](docs/validation-record.md) · [Ansys Meshing 与 ICEM 示例](examples/meshing/README.md)
  91. ## MCP 工具
  92. <details>
  93. <summary>展开全部 57 个工具</summary>
  94. | 工具 | 说明 |
  95. | --- | --- |
  96. | `check_ansys_installation` | 检查 Ansys 程序和 bridge 路径 |
  97. | `write_ansys_script` | 安全写入受支持的 Ansys 脚本文件,默认禁止覆盖 |
  98. | `check_icem_installation` | 检查 ICEM CFD 和 Tcl bridge |
  99. | `start_icem_bridge` | 启动 ICEM CFD 常驻会话 |
  100. | `stop_icem_bridge` | 停止 ICEM CFD 常驻会话 |
  101. | `check_icem_connection` | 检查 ICEM bridge 连接 |
  102. | `execute_icem_script` | 在 ICEM 中执行 Tcl/Replay |
  103. | `get_icem_session_info` | 查询 ICEM 会话信息 |
  104. | `list_icem_commands` | 查询 ICEM Tcl 命令 |
  105. | `run_icem_replay` | 批处理运行 Replay 文件 |
  106. | `start_workbench_bridge` | 启动 Workbench bridge |
  107. | `stop_workbench_bridge` | 停止 Workbench bridge |
  108. | `check_workbench_connection` | 检查 Workbench 连接 |
  109. | `execute_workbench_script` | 在 Workbench 中执行脚本 |
  110. | `get_project_info` | 获取当前项目信息 |
  111. | `open_project` | 打开 `.wbpj` 项目 |
  112. | `save_project` | 保存当前项目 |
  113. | `update_project` | 执行项目更新 |
  114. | `probe_workbench_analysis_templates_live` | 探测可用分析模板 |
  115. | `probe_system_coupling_live` | 探测 System Coupling 模板和脚本接口 |
  116. | `create_cfx_mechanical_fsi_project_live` | 创建并连接 CFX–Mechanical–System Coupling 工程 |
  117. | `connect_system_coupling_participants_live` | 把现有系统连接为耦合参与方 |
  118. | `get_system_coupling_status_live` | 查询参与方、区域、变量、传递和设置 |
  119. | `configure_system_coupling_settings_live` | 配置耦合步长、时长和迭代控制 |
  120. | `create_system_coupling_data_transfer_live` | 创建通用数据传递 |
  121. | `configure_cfx_mechanical_two_way_fsi_live` | 创建位移与力两条双向 FSI 传递 |
  122. | `export_system_coupling_setup_live` | 导出 System Coupling `.sci` 设置 |
  123. | `run_system_coupling_solution_live` | 更新并运行耦合 Solution |
  124. | `create_workbench_analysis_system_live` | 创建通用分析系统 |
  125. | `create_steady_state_thermal_system_live` | 创建稳态热系统 |
  126. | `create_transient_thermal_system_live` | 创建瞬态热系统 |
  127. | `create_static_structural_system_live` | 创建静力结构系统 |
  128. | `create_transient_structural_system_live` | 创建瞬态结构系统 |
  129. | `create_modal_analysis_system_live` | 创建模态系统 |
  130. | `create_harmonic_response_system_live` | 创建谐响应系统 |
  131. | `create_response_spectrum_system_live` | 创建响应谱系统 |
  132. | `create_random_vibration_system_live` | 创建随机振动系统 |
  133. | `create_cfx_flow_system_live` | 创建 CFX 系统 |
  134. | `create_fluent_flow_system_live` | 尝试创建 Fluent 系统 |
  135. | `create_thermal_bar_demo_live` | 创建并求解热分析示例 |
  136. | `run_spaceclaim_script` | 批处理运行 SpaceClaim Python 并验证几何输出 |
  137. | `run_cfx_pre_session` | 批处理运行 CFX-Pre session 并验证 `.cfx/.def` 输出 |
  138. | `run_cfx_post_session` | 批处理运行 CFD-Post `.cse` 并验证导出文件 |
  139. | `generate_ansys_mesh` | 从几何创建独立 Ansys Meshing 工程、划分并导出网格 |
  140. | `run_workbench_journal` | 批处理运行 Workbench journal,可验证日志标志和结果文件 |
  141. | `create_workbench_analysis_system` | 批处理创建分析系统 |
  142. | `create_steady_state_thermal_system` | 批处理创建稳态热系统 |
  143. | `run_system_coupling_script` | System Coupling Python batch |
  144. | `start_ansys_job` | 后台提交批处理,支持请求去重 |
  145. | `get_ansys_job` | 查询持久任务、结果及日志 |
  146. | `stop_ansys_job` | 停止指定后台进程树 |
  147. | `diagnose_ansys_log` | 定位日志错误和行号 |
  148. | `verify_simulation` | 按单位和阈值检查 CSV 指标 |
  149. | `run_mapdl_input` | 运行 MAPDL 输入文件 |
  150. | `run_fluent_journal` | 运行 Fluent journal |
  151. | `run_cfx_solver` | 运行 CFX `.def` |
  152. | `create_and_run_thermal_bar_demo` | 批处理运行热分析示例 |
  153. </details>
  154. ## MCP 资源
  155. | URI | 内容 |
  156. | --- | --- |
  157. | `ansys-workbench://status` | Workbench bridge 状态 |
  158. | `ansys-workbench://installation` | Ansys 安装路径检查结果 |
  159. | `ansys-workbench://icem/status` | ICEM CFD bridge 状态 |
  160. ## 故障排查
  161. | 问题 | 处理 |
  162. | --- | --- |
  163. | Codex 看不到工具 | 检查 `config.toml` 路径并重启 Codex |
  164. | Ansys 路径不存在 | 修改相应的 `ANSYS_*` 环境变量 |
  165. | Workbench bridge 超时 | 先 `stop_workbench_bridge`,再重新启动;查看 `mcp.log` |
  166. | ICEM bridge 超时 | 先用 `start_icem_bridge(batch=true)`;查看 `icem/icem_bridge.log` |
  167. | Fluent 模板不可用 | 使用 `run_fluent_journal`,或用 `template_name` 指定本机模板 |
  168. MCP 客户端不可用时,可在仓库根目录运行 `.\.venv\Scripts\python.exe stop_mcp.py`,向当前桥接工作目录写入停止信号。
  169. ## 开发与测试
  170. ```powershell
  171. .\.venv\Scripts\python.exe -m unittest discover -s tests -v
  172. ```
  173. 测试会核对 README、57 个注册工具、3 个资源、bridge 版本、脚本安全写入、CFX 前后处理命令以及 ICEM IPC 行为。
  174. ## License
  175. [MIT](LICENSE)
  176. ## 本版更新
  177. ### 新增
  178. - 新增 12 个 ANSYS Skill,覆盖几何、网格、仿真、验证与后处理等环节。
  179. - 新增 `generate_ansys_mesh`,从几何创建独立 Mesh 工程,设置网格控制,导出 `.meshdat` 并重开核对统计。
  180. - 新增后台任务提交、查询与停止,增加日志诊断、CSV 数值验收和独立 System Coupling 批处理。MCP 工具从 50 个增至 57 个。
  181. - 新增结构、动力学、热、网格、Fluent、CFX 和耦合的可复跑算例及验收记录。
  182. ### 修改与修复
  183. - 加强批处理产物检查,零字节输出会被判为失败。停止后台任务时同步终止所属 Windows 作业进程。
  184. - 修正 Fluent 批处理云图导出、Mechanical 节点 CSV 导出及重开后图片刷新。
  185. - 重排五语 README,集中展示仿真能力、实测云图和版本更新。

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.