Skip to content

Commit 06fa36a

Browse files
committed
Update port randomization
1 parent a8b849f commit 06fa36a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/toolhive/guides-cli/run-mcp-servers.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,14 @@ selects a random port to expose from the container to the host and sets the
323323

324324
```mermaid
325325
graph LR
326-
A[MCP client] -->|HTTP request to<br/>proxy port: 7654| B[ToolHive proxy<br/>process<br/>Port: 7654]
327-
B -->|Forwards to<br/>host port: 8432| C[<strong>MCP container</strong><br/>Host: 8432 → Container: 8432<br/>ENV: MCP_PORT=8432]
326+
A[MCP client] -->|HTTP request to<br/>proxy port: 5432| B[ToolHive proxy<br/>process<br/>Port: 5432]
327+
B -->|Forwards to<br/>host port: 9876| C[<strong>MCP container</strong><br/>Host: 9876 → Container: 7654<br/>ENV: MCP_PORT=7654]
328328
C -->|Response| B
329329
B -->|Response| A
330330
```
331331

332332
This is equivalent to running a Docker container with
333-
`docker run -p <random_port>:<random_port> ...`
333+
`docker run -p <random_host_port>:<random_container_port> ...`
334334

335335
For MCP servers that use a specific port or don't recognize those environment
336336
variables, specify the container port for ToolHive to expose using the

0 commit comments

Comments
 (0)