FEFLOW MCP Server

FEFLOW MCP Server

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

Category
Visit Server

README

FEFLOW MCP 服务器

通过 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 模拟结果文件(含时间序列数据)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured