Spaces:
Running
Running
File size: 2,277 Bytes
5c027f4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | ---
title: EPANET MCP Server
emoji: π§
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
license: mit
short_description: EPANET/ePyT water-network modelling over MCP (HTTP + SSE)
---
# π§ EPANET MCP Server
A remote [Model Context Protocol](https://modelcontextprotocol.io) server that exposes
EPANET water-distribution modelling β powered by [ePyT](https://github.com/KIOS-Research/EPyT) β
to any MCP-capable client. Load `.inp` models, run hydraulic/quality simulations, modify
parameters, and generate what-if scenarios in natural language.
It wraps the upstream [`epanet-mcp-server`](https://pypi.org/project/epanet-mcp-server/)
(44 tools) and serves it over **both** modern transports at once, behind an optional API key.
## Endpoints
| Transport | Path | Clients |
|-----------|------|---------|
| Streamable HTTP | `/mcp` | HuggingChat, Codex, Perplexity, Gemini, ChatGPT (dev mode) |
| HTTP + SSE | `/sse` | Claude Desktop (via `mcp-remote`), other legacy clients |
| Health probe | `/health` | uptime checks (no auth) |
Base URL once deployed: `https://<owner>-<space-name>.hf.space`
## Authentication
Set a Space **secret** named `CLIENT_API_KEY`. When present, every request to `/mcp`,
`/sse`, and `/messages/` must send it:
```
Authorization: Bearer <YOUR_KEY>
```
(`X-API-Key: <YOUR_KEY>` is also accepted.) Leave the secret unset to run open β useful for
ChatGPT connectors, which only support OAuth or no-auth. `/` and `/health` are always public.
## Networks
ePyT ships 52 benchmark networks (Net1/2/3, Hanoi, Anytown, L-TOWN, Balerma, β¦) β call
`list_bundled_networks` to see them. Custom networks are bundled under
`/home/user/app/networks/` and loaded by absolute path, e.g.:
```
load_network("/home/user/app/networks/net3.inp", "net3")
```
Bundled here: `net3.inp`, `net3_PDD.inp`, `ky4.inp`, `ky10.inp`, `Net6.inp`, `BIWS.inp`.
## Smoke test
`smoke_test.py` runs the full MCP handshake (initialize β tools/list β tools/call) over
both transports and checks the auth gate:
```
python smoke_test.py --base-url https://<owner>-<space-name>.hf.space --api-key <YOUR_KEY>
```
See `CLIENTS.md` for copy-paste connection configs for each client.
Built on `epanet-mcp-server` by Applied-AI-Eurecat (MIT).
|