Skip to content

Commit 3ebf55e

Browse files
claudespicelukekim
authored andcommitted
docs: Add runtime.mcp.allowed_hosts configuration
Document the new runtime.mcp.allowed_hosts setting that controls which Host header values are accepted on the /v1/mcp endpoint for DNS rebinding attack prevention.
1 parent be579e9 commit 3ebf55e

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

website/docs/components/tools/mcp.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ tools:
6262
from: mcp:http://localhost:8090/v1/mcp
6363
```
6464

65+
### Allowed Hosts
66+
67+
By default the `/v1/mcp` endpoint only accepts requests with a `Host` header matching `localhost`, `127.0.0.1`, or `::1` to prevent DNS rebinding attacks. To allow additional hosts, configure [`runtime.mcp.allowed_hosts`](../../reference/spicepod/runtime#runtimemcp):
68+
69+
```yaml
70+
runtime:
71+
mcp:
72+
allowed_hosts:
73+
- localhost
74+
- my-host.internal:8090
75+
```
76+
77+
Set `allowed_hosts: ["*"]` to disable host checking entirely.
78+
6579
## Configuration Options
6680

6781
### `from`

website/docs/features/large-language-models/mcp.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ tools:
7070
from: mcp:http://localhost:8090/v1/mcp
7171
```
7272

73+
### Allowed Hosts
74+
75+
By default the `/v1/mcp` endpoint only accepts requests with a `Host` header matching `localhost`, `127.0.0.1`, or `::1` to prevent DNS rebinding attacks. To allow additional hosts, configure [`runtime.mcp.allowed_hosts`](../../reference/spicepod/runtime#runtimemcp):
76+
77+
```yaml
78+
runtime:
79+
mcp:
80+
allowed_hosts:
81+
- localhost
82+
- my-host.internal:8090
83+
```
84+
85+
Set `allowed_hosts: ["*"]` to disable host checking entirely.
86+
7387
## Additional Configuration Options
7488

7589
### `from`

website/docs/reference/spicepod/runtime.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,39 @@ runtime:
554554
| `max_message_size` | Yes | - | Maximum size of a single Arrow Flight message. |
555555
| `do_put_rate_limit_enabled` | Yes | `true` | Whether rate limiting is applied to `DoPut` Arrow Flight operations. |
556556

557+
## `runtime.mcp`
558+
559+
Configures settings for the Spice MCP server endpoint (`/v1/mcp`).
560+
561+
### `runtime.mcp.allowed_hosts`
562+
563+
Controls which `Host` header values are accepted on the `/v1/mcp` endpoint. This prevents [DNS rebinding](https://en.wikipedia.org/wiki/DNS_rebinding) attacks against the MCP server.
564+
565+
| Behavior | Configuration |
566+
| --- | --- |
567+
| **Default** (not set) | Only `localhost`, `127.0.0.1`, and `::1` are permitted. Requests with any other `Host` value receive `403 Forbidden`. |
568+
| **Explicit list** | Replaces the defaults entirely. Only the listed hosts are accepted. |
569+
| **Wildcard** (`["*"]`) | Disables host checking — all `Host` header values are accepted. |
570+
571+
```yaml
572+
runtime:
573+
mcp:
574+
allowed_hosts:
575+
- localhost
576+
- my-host.internal:8090
577+
```
578+
579+
To disable host checking entirely:
580+
581+
```yaml
582+
runtime:
583+
mcp:
584+
allowed_hosts:
585+
- "*"
586+
```
587+
588+
Each entry can be a bare hostname (`example.com`), a host-port pair (`example.com:8090`), or a full origin URL (`https://example.com`).
589+
557590
## `runtime.ready_state`
558591

559592
Controls when the runtime readiness probe (`/v1/ready`) reports the runtime as ready. This is particularly useful for Kubernetes readiness probes.

0 commit comments

Comments
 (0)