EPANET MCP Server

io.github.Applied-Artificial-Intelligence-Eurecat由 GitHub 账号 Applied-Artificial-Intelligence-Eurecat 发布v0.1.2更新于 Nov 3, 2026

MCP server for EPANET water-distribution network simulation and scenario analysis.

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

本地 MCP 服务器,让助手加载 EPANET 供水管网模型、运行水力与水质模拟,并构建假设情景分析。

可以做什么
  • 加载、卸载和列出管网模型(含内置基准模型),查看节点、管段、用水模式、控制规则、曲线和选项
  • 运行水力、水质及完整模拟,并读取指定时刻的压力或流量
  • 修改模型参数,如需水量、用水模式、管径、粗糙度、管段状态与长度、水泵转速与扬程曲线、阀门设置、水池与水库水位以及模拟时间步长
  • 新增或删除控制规则,并保存修改后的管网
  • 生成假设情景,包括需水量变化、漏损、污染、压力变化、水泵或阀门控制以及多重故障事件
适用场景
适用于处理 EPANET 管网模型文件并希望以对话方式探索的场景:汇总管网概况、查看压力与流量、测试参数调整,或运行漏损、污染与故障情景,而无需手工编辑文件。
运行要求
以 Python 包形式通过 stdio 在本地运行(pip install epanet-mcp-server)。需要 Python 3.10 及以上、ePyT 2.0 及以上和 mcp 1.0 及以上。未声明认证、API 密钥或环境变量。需要在桌面客户端中配置。
安装前请注意
工具可修改管网参数、新增或删除控制规则并将管网保存到磁盘,可能覆盖模型文件。情景工具会克隆源会话,但直接修改类工具作用于已加载的管网。使用保存结果前请先核对。

安装

在 SourceWeft 中

  1. 打开 控制台中的 EPANET MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

EPANET MCP Server

[Linter] [Pytest] [PyPI version] [MCP Registry]

A Model Context Protocol (MCP) server that exposes EPANET water-distribution network modelling capabilities through ePyT - the EPANET Python Toolkit.

Any MCP-compatible LLM can load water network models, run simulations, modify parameters, and generate complex what-if scenarios through natural language.


Features

CategoryTools
Load & Inspectload_network, unload_network, list_networks, list_bundled_networks, get_network_summary, get_nodes, get_links, get_patterns, get_controls, get_curves, get_options
Simulaterun_hydraulic_simulation, run_quality_simulation, run_full_simulation, get_pressure_at_time, get_flow_at_time
Modifyset_node_base_demand, set_pattern, add_pattern, set_pipe_diameter, set_pipe_roughness, set_pipe_status, set_pipe_length, set_pump_status, set_pump_speed, set_pump_head_curve, set_valve_setting, set_valve_status, set_tank_parameters, set_reservoir_head, set_simulation_duration, set_hydraulic_timestep, set_quality_timestep, set_quality_type, add_control, delete_control, save_network
Scenarioscreate_demand_perturbation, create_leakage_event, create_contamination_event, create_pressure_change_scenario, create_pump_control_scenario, create_valve_control_scenario, create_multi_failure_scenario

Requirements

  • Python ≥ 3.10
  • ePyT ≥ 2.0
  • mcp ≥ 1.0
bash
pip install epyt mcp

Installation

bash
git clone https://github.com/Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server.gitcd epanet-mcp-serverpip install -e .

Running the server

stdio (for Claude Desktop / Claude Code)

bash
epanet-mcp-server# orpython -m epanet_mcp.server

SSE / HTTP

bash
epanet-mcp-server --transport sse --port 8000

Claude Desktop configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your platform:

json
{  "mcpServers": {    "epanet": {      "command": "epanet-mcp-server",      "args": []    }  }}

If not on PATH:

json
{  "mcpServers": {    "epanet": {      "command": "python",      "args": ["-m", "epanet_mcp.server"],      "cwd": "/path/to/epanet-mcp-server/src"    }  }}

Claude Code (.mcp.json)

Place this in the root of your project or ~/.claude/:

json
{  "mcpServers": {    "epanet": {      "command": "epanet-mcp-server",      "args": []    }  }}

Example interactions

Once the server is connected, you can ask things like:

"Load Net1.inp and show me a summary of the network."

"Run a full simulation and tell me which node has the lowest pressure at hour 12."

"Double the base demand at junction 11 and re-run the simulation. How does pressure change?"

"Simulate a burst on pipe 10 with a 20% leakage fraction."

"Inject 10 mg/L of chlorine at node 11 between hours 1 and 3 and show me the contamination spread."

"What happens to pressures if the reservoir head drops from 150 m to 120 m?"

"Schedule Pump 9 to start at 06:00 and stop at 22:00."

"Close pipes 10 and 11 and the pump simultaneously. Where are service disruptions?"


Architecture

src/epanet_mcp/├── server.py          # FastMCP server – tool registration + entry point├── session.py         # Thread-safe registry of open ePyT sessions├── utils.py           # numpy → Python serialisation helpers└── tools/    ├── inspection.py  # load / inspect network models    ├── simulation.py  # run hydraulic & quality simulations    ├── modification.py# in-memory parameter changes    └── scenarios.py   # what-if scenario generators (clone + modify + run)

Session model: Each loaded network lives in a named session. Scenario tools automatically clone the source session into a new independent session so the baseline network is never mutated.


Running the tests

bash
pip install pytestpytest tests/ -v

Bundled networks

ePyT ships with many standard benchmark networks including Net1, Net2, L-TOWN, Hanoi, Anytown, Balerma and others. Use list_bundled_networks to discover them all.


License

MIT

来源:README.md,提交 9419676

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分