File size: 3,118 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Connecting clients

Base URL: `https://<owner>-<space-name>.hf.space`
(shown on the Space page once it's running β€” e.g. `https://razaali10-epanet-mcp-server.hf.space`)

Two endpoints:
- **Streamable HTTP** β†’ `…/mcp`  (preferred by all five clients below)
- **SSE** β†’ `…/sse`  (legacy fallback; Claude Desktop via `mcp-remote`)

If you set the `CLIENT_API_KEY` Space secret, every client must send
`Authorization: Bearer <key>` (or `X-API-Key: <key>`).

| Client | Transport | Static API-key header? | Notes |
|--------|-----------|------------------------|-------|
| HuggingChat | Streamable HTTP | βœ… | Add under Settings β†’ add MCP server |
| Codex | Streamable HTTP | βœ… | `http_headers` in `config.toml` |
| Perplexity | Streamable HTTP | βœ… (API Key / header) | Pro/Max/Enterprise only |
| Gemini CLI | Streamable HTTP | βœ… | `httpUrl` + `headers` in `settings.json` |
| ChatGPT | Streamable HTTP | ❌ (OAuth/None only) | **Run the Space with no key**, select "No authentication" |

> ⚠️ **ChatGPT** cannot send a static API key. To use it, leave `CLIENT_API_KEY`
> unset (open mode). If you need the key on for the other four, that's fine β€”
> just skip ChatGPT, or run a second open instance for it.

---

## HuggingChat (HF ChatUI)
Settings β†’ Tools / MCP β†’ add server:
- **URL**: `https://<space>.hf.space/mcp`
- **Header**: `Authorization: Bearer <YOUR_KEY>`

## Codex (`~/.codex/config.toml`)
```toml
[mcp_servers.epanet]
url = "https://<space>.hf.space/mcp"
http_headers = { Authorization = "Bearer <YOUR_KEY>" }
```

## Perplexity (Pro / Max / Enterprise)
Account settings β†’ Connectors β†’ **+ Custom connector β†’ Remote**:
- **MCP Server URL**: `https://<space>.hf.space/mcp`
- **Transport**: Streamable HTTP
- **Authentication**: API Key β†’ send as header `X-API-Key: <YOUR_KEY>`
  (or `Authorization: Bearer <YOUR_KEY>`)

## Gemini CLI (`~/.gemini/settings.json`)
```json
{
  "mcpServers": {
    "epanet": {
      "httpUrl": "https://<space>.hf.space/mcp",
      "headers": { "Authorization": "Bearer <YOUR_KEY>" },
      "timeout": 30000
    }
  }
}
```
Or one-liner:
```bash
gemini mcp add --transport http \
  --header "Authorization: Bearer <YOUR_KEY>" \
  epanet https://<space>.hf.space/mcp
```

## ChatGPT (Developer Mode β€” Plus/Pro/Business/Enterprise/Edu)
Requires the Space in **open mode** (no `CLIENT_API_KEY`).
Settings β†’ Apps/Connectors β†’ Advanced β†’ **Developer mode** β†’ Create app:
- **URL**: `https://<space>.hf.space/mcp`
- **Transport**: Streamable HTTP
- **Authentication**: No authentication

## Claude Desktop (SSE via mcp-remote)
```json
{
  "mcpServers": {
    "epanet": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://<space>.hf.space/sse",
               "--header", "Authorization: Bearer <YOUR_KEY>"]
    }
  }
}
```

---

## First things to try
1. "List the bundled networks."
2. "Load net3.inp from /home/user/app/networks/ and summarise it."
3. "Run a hydraulic simulation on net3 and tell me the lowest-pressure node at hour 12."
4. "Simulate a 20% burst on a pipe in net3 and compare pressures to baseline."