{
  "markdown": "# EPANET MCP Server\n\n[![Linter](https://github.com/Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server/actions/workflows/linter.yml/badge.svg?branch=main)](https://github.com/Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server/actions/workflows/linter.yml)\n[![Pytest](https://github.com/Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server/actions/workflows/test.yml)\n[![PyPI version](https://img.shields.io/pypi/v/epanet-mcp-server.svg?label=PyPI)](https://pypi.org/project/epanet-mcp-server/)\n[![MCP Registry](https://img.shields.io/badge/MCP%20Registry-listed-blue.svg)](https://registry.modelcontextprotocol.io/?q=io.github.Applied-Artificial-Intelligence-Eurecat%2Fepanet-mcp-server)\n\nA [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that\nexposes EPANET water-distribution network modelling capabilities through\n[ePyT](https://github.com/KIOS-Research/EPyT) - the EPANET Python Toolkit.\n\nAny MCP-compatible LLM can load water network models, run\nsimulations, modify parameters, and generate complex what-if scenarios through\nnatural language.\n\n---\n\n## Features\n\n| Category | Tools |\n|---|---|\n| **Load & Inspect** | `load_network`, `unload_network`, `list_networks`, `list_bundled_networks`, `get_network_summary`, `get_nodes`, `get_links`, `get_patterns`, `get_controls`, `get_curves`, `get_options` |\n| **Simulate** | `run_hydraulic_simulation`, `run_quality_simulation`, `run_full_simulation`, `get_pressure_at_time`, `get_flow_at_time` |\n| **Modify** | `set_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` |\n| **Scenarios** | `create_demand_perturbation`, `create_leakage_event`, `create_contamination_event`, `create_pressure_change_scenario`, `create_pump_control_scenario`, `create_valve_control_scenario`, `create_multi_failure_scenario` |\n\n---\n\n## Requirements\n\n- Python ≥ 3.10\n- [ePyT](https://pypi.org/project/epyt/) ≥ 2.0\n- [mcp](https://pypi.org/project/mcp/) ≥ 1.0\n\n```bash\npip install epyt mcp\n```\n\n---\n\n## Installation\n\n```bash\ngit clone https://github.com/Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server.git\ncd epanet-mcp-server\npip install -e .\n```\n\n---\n\n## Running the server\n\n### stdio (for Claude Desktop / Claude Code)\n\n```bash\nepanet-mcp-server\n# or\npython -m epanet_mcp.server\n```\n\n### SSE / HTTP\n\n```bash\nepanet-mcp-server --transport sse --port 8000\n```\n\n---\n\n## Claude Desktop configuration\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json`\n(macOS) or the equivalent on your platform:\n\n```json\n{\n  \"mcpServers\": {\n    \"epanet\": {\n      \"command\": \"epanet-mcp-server\",\n      \"args\": []\n    }\n  }\n}\n```\n\nIf not on `PATH`:\n\n```json\n{\n  \"mcpServers\": {\n    \"epanet\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"epanet_mcp.server\"],\n      \"cwd\": \"/path/to/epanet-mcp-server/src\"\n    }\n  }\n}\n```\n\n---\n\n## Claude Code (`.mcp.json`)\n\nPlace this in the root of your project or `~/.claude/`:\n\n```json\n{\n  \"mcpServers\": {\n    \"epanet\": {\n      \"command\": \"epanet-mcp-server\",\n      \"args\": []\n    }\n  }\n}\n```\n\n---\n\n## Example interactions\n\nOnce the server is connected, you can ask things like:\n\n> **\"Load Net1.inp and show me a summary of the network.\"**\n\n> **\"Run a full simulation and tell me which node has the lowest pressure at hour 12.\"**\n\n> **\"Double the base demand at junction 11 and re-run the simulation. How does pressure change?\"**\n\n> **\"Simulate a burst on pipe 10 with a 20% leakage fraction.\"**\n\n> **\"Inject 10 mg/L of chlorine at node 11 between hours 1 and 3 and show me the contamination spread.\"**\n\n> **\"What happens to pressures if the reservoir head drops from 150 m to 120 m?\"**\n\n> **\"Schedule Pump 9 to start at 06:00 and stop at 22:00.\"**\n\n> **\"Close pipes 10 and 11 and the pump simultaneously. Where are service disruptions?\"**\n\n---\n\n## Architecture\n\n```\nsrc/epanet_mcp/\n├── server.py          # FastMCP server – tool registration + entry point\n├── session.py         # Thread-safe registry of open ePyT sessions\n├── utils.py           # numpy → Python serialisation helpers\n└── tools/\n    ├── inspection.py  # load / inspect network models\n    ├── simulation.py  # run hydraulic & quality simulations\n    ├── modification.py# in-memory parameter changes\n    └── scenarios.py   # what-if scenario generators (clone + modify + run)\n```\n\n**Session model**: Each loaded network lives in a named session.  Scenario\ntools automatically clone the source session into a new independent session so\nthe baseline network is never mutated.\n\n---\n\n## Running the tests\n\n```bash\npip install pytest\npytest tests/ -v\n```\n\n---\n\n## Bundled networks\n\nePyT ships with many standard benchmark networks including Net1, Net2, L-TOWN,\nHanoi, Anytown, Balerma and others.  Use `list_bundled_networks` to discover\nthem all.\n\n---\n\n## License\n\nMIT\n\n<!-- mcp-name: io.github.Applied-Artificial-Intelligence-Eurecat/epanet-mcp-server -->\n",
  "bytes": 5340,
  "sha": "121e2666088c7a0aebf49e67c019c352ed137577ac9fdebc9f56133924b82fbb",
  "repo_slug": "applied-artificial-intelligence-eurecat/epanet-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_applied_artificial_intelligenc_67d8e30b/readme"
}