# EPANET MCP Server

An MCP server that wraps ePyT and EPANET for water-distribution modelling. Load networks, run hydraulic simulations, and build what-if scenarios through natural language.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10 repo stars
- Author: Applied-Artificial-Intelligence-Eurecat
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server
- Updated: 2026-06-02
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/epanet-mcp-server

## What it does

The server exposes EPANET capabilities through ePyT as MCP tools. Any MCP-compatible LLM can load a network model, inspect its nodes and links, run hydraulic or quality simulations, and read pressures or flows at specific times. The code is organised as a FastMCP server with a thread-safe session registry and tool modules for inspection, simulation, modification, and scenarios.

Scenario tools clone the source session into a fresh one, so the baseline network stays untouched. Built-in generators cover demand spikes, pipe bursts with a leakage fraction, contamination events, pump and valve control changes, and multi-failure cases. Each loaded network lives in a named session, so several models can sit open at once.

Python 3.10 or newer is required, along with ePyT ≥ 2.0 and the mcp package ≥ 1.0. Install dependencies with `pip install epyt mcp`, then either clone the repo and run `pip install -e .` or go straight to `uvx epanet-mcp-server`. The stdio entry point is `epanet-mcp-server`; for HTTP use `--transport sse --port 8000`. The server will not start without ePyT present.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add epanet-mcp-server -- uvx epanet-mcp-server
```
uvx runs the command named after the package; if the README names another one, use uvx --from epanet-mcp-server <command>

### Codex

**Platform CLI**
```bash
codex mcp add epanet-mcp-server -- uvx epanet-mcp-server
```
uvx runs the command named after the package; if the README names another one, use uvx --from epanet-mcp-server <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "epanet-mcp-server": {
            "command": "uvx",
            "args": [
                "epanet-mcp-server"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from epanet-mcp-server <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "epanet-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "epanet-mcp-server"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from epanet-mcp-server <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add epanet-mcp-server uvx epanet-mcp-server
```
uvx runs the command named after the package; if the README names another one, use uvx --from epanet-mcp-server <command>

## When to use it
- load a water network model and inspect its structure
- run a hydraulic simulation without writing EPANET code by hand
- check pressure and flow at a given simulation hour
- model a pipe burst or leak with a leakage fraction
- compare what-if scenarios without mutating the baseline network

## Example prompts
- Load Net1.inp and give me a network summary.
- Run a full simulation and find the node with the lowest pressure at hour 12.

## Similar
- [QueueSim](https://affpapa.org/en/nevibecode/mcp/queuesim.md) — MCP server · 782 installs
- [ITASCA MCP Server](https://affpapa.org/en/nevibecode/mcp/itasca-mcp-server.md) — MCP server · ★ 234 repo stars
- [Multisim MCP](https://affpapa.org/en/nevibecode/mcp/multisim-mcp.md) — MCP server · ★ 48 repo stars
- [blender-optics-simulator](https://affpapa.org/en/nevibecode/mcp/blender-optics-simulator.md) — MCP server · ★ 38 repo stars
- [NetLogo MCP](https://affpapa.org/en/nevibecode/mcp/netlogo-mcp.md) — MCP server · ★ 28 repo stars
- [Shaderous](https://affpapa.org/en/nevibecode/mcp/shaderous.md) — MCP server · ★ 15 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
