Skip to content

Commit 440d638

Browse files
committed
changes from review
1 parent 8c2646d commit 440d638

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/toolhive/guides-cli/network-isolation.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,36 @@ thv run --isolate-network --permission-profile none --volume /home/user/aws-diag
240240
This approach is more flexible since you can easily change the host directory
241241
without editing a profile file.
242242

243+
## Accessing other workloads on the same container network
244+
245+
To allow an MCP server to access other workloads on the same network, you need
246+
to configure network isolation to include the appropriate hostnames and ports.
247+
This is commonly needed when your MCP server needs to communicate with
248+
databases, APIs, or other services that are running on your local host during
249+
development.
250+
251+
For example, in Docker environments, you can use `host.docker.internal` to
252+
access services on the host. Create a permission profile that allows this
253+
hostname and the required port:
254+
255+
```json title="internal-access-profile.json"
256+
{
257+
"network": {
258+
"outbound": {
259+
"insecure_allow_all": false,
260+
"allow_host": ["host.docker.internal"],
261+
"allow_port": [3000]
262+
}
263+
}
264+
}
265+
```
266+
267+
Run the MCP server with this profile:
268+
269+
```bash
270+
thv run --isolate-network --permission-profile ./internal-access-profile.json <SERVER>
271+
```
272+
243273
## Related information
244274

245275
- [`thv run` command reference](../reference/cli/thv_run.md)

0 commit comments

Comments
 (0)