Command Palette

Search for a command to run...

UnylyUnyly
Browse all

FEFLOW Server

FreeNot checked

Enables AI assistants to control FEFLOW 7.5 groundwater simulation software through MCP, supporting model loading, mesh operations, parameter management, and re

GitHubEmbed

About

Enables AI assistants to control FEFLOW 7.5 groundwater simulation software through MCP, supporting model loading, mesh operations, parameter management, and result export.

README

通过 MCP(Model Context Protocol)协议,使 AI 助手能够操控 FEFLOW 7.5 地下水模拟软件。

架构

┌─────────────────────────────────────────────────────────┐
│  MCP 客户端 (Claude Code / VS Code)                      │
│  通过 stdio 通信                                         │
├─────────────────────────────────────────────────────────┤
│  server.py (Python 3.13, D:\anaconda\python.exe)        │
│  ├── MCP 协议处理 (mcp 库)                               │
│  ├── 工具定义 (19 个 MCP 工具)                           │
│  └── FEFLOWService (业务逻辑层)                          │
│       └── FEFLOWController (子进程管理)                   │
│            └── subprocess.Popen                          │
├─────────────────────────────────────────────────────────┤
│  feflow_bridge.py (Python 3.9, pytorch conda env)       │
│  ├── ifm 模块导入 (FEFLOW IFM Python API)                │
│  ├── stdin/stdout JSON 协议                              │
│  └── FEFLOWBridge 核心类                                 │
│       └── FEFLOW Kernel DLL (D:\专业软件\bin64\)         │
└─────────────────────────────────────────────────────────┘

为什么使用双 Python 版本?

  • FEFLOW 7.5 的 IFM Python API 仅支持 Python 3.6-3.9(通过 .pyd 文件)
  • MCP SDK (mcp 包) 需要 Python >= 3.10
  • 解决方案:MCP 服务器运行于 Python 3.13,通过子进程桥接到 Python 3.9 环境

文件结构

FEFLOW_MCP/
├── server.py               # MCP 服务器主入口 (Python 3.13)
├── feflow_controller.py    # 桥接控制器,管理子进程生命周期
├── feflow_bridge.py        # FEFLOW IFM 桥接脚本 (Python 3.9)
├── config.json             # 配置文件
├── requirements.txt        # Python 依赖
├── .mcp.json              # MCP 客户端配置
└── README.md               # 本文件

环境要求

组件 路径 说明
FEFLOW 7.5 D:\专业软件\ 需设置 FEFLOW75_ROOT 环境变量
Python 3.13 (系统) D:\anaconda\python.exe 运行 MCP 服务器,需安装 mcp
Python 3.9 (conda) D:\anaconda\envs\pytorch\python.exe 运行 FEFLOW IFM API 桥接

安装

# 1. 进入项目目录
cd C:\Users\温涛\Desktop\FEFLOW_MCP

# 2. 安装 MCP 服务器依赖(Python 3.13 环境)
pip install mcp pydantic

# 3. 确认 Python 3.9 环境可用
D:\anaconda\envs\pytorch\python.exe --version  # 应输出 3.9.x

# 4. 配置 MCP 客户端
# 将 .mcp.json 中的内容合并到你的 MCP 客户端配置中

MCP 工具清单

文档管理

工具名 说明 必填参数
load_document 加载模型文件 (.fem/.dac) path
save_document 保存模型 path (可选)
close_document 关闭模型 -
get_model_info 模型综合信息 -

网格操作

工具名 说明 必填参数
get_number_of_nodes 节点总数 -
get_number_of_elements 单元总数 -
get_node_coordinates 节点坐标 -
get_element_nodes 单元连接关系 -
get_mesh_stats 网格统计(含包围盒) -

参数管理

工具名 说明 必填参数
list_parameters 列出可用参数类型 -
get_param_values 读取参数值 param_name
set_param_values 设置参数值 param_name, values

模拟结果

工具名 说明 必填参数
get_results 获取模拟结果 -
get_time_steps_info 时间步信息 -

材料属性 & 导出

工具名 说明 必填参数
get_material_properties 材料属性 -
export_results_csv 导出结果为 CSV output_path
export_results_shapefile 导出网格为 GIS 格式 output_dir

系统

工具名 说明 必填参数
get_kernel_info 内核版本信息 -

使用示例

加载模型并查看信息:

1. load_document → path: "C:/models/aquifer.fem"
2. get_model_info → 获取节点/单元数量
3. get_mesh_stats → 获取包围盒范围
4. get_param_values → param_name: "P_CONDUCT"

支持的文件格式

  • .fem — FEFLOW 有限元模型文件
  • .dac — FEFLOW 模拟结果文件(含时间序列数据)

from github.com/Followmyself/DHI_FEFLOW_MCP

Installing FEFLOW Server

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/Followmyself/DHI_FEFLOW_MCP

FAQ

Is FEFLOW Server MCP free?

Yes, FEFLOW Server MCP is free — one-click install via Unyly at no cost.

Does FEFLOW Server need an API key?

No, FEFLOW Server runs without API keys or environment variables.

Is FEFLOW Server hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install FEFLOW Server in Claude Desktop, Claude Code or Cursor?

Open FEFLOW Server on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare FEFLOW Server with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All ai MCPs