11---
22title : Custom permissions
33description :
4- How to create and apply custom permission profiles for MCP servers in
5- ToolHive.
4+ How to create and apply filesystem permissions and network isolation for MCP
5+ servers using permission profiles in ToolHive.
66sidebar_position : 50
77---
88
@@ -40,17 +40,18 @@ Profiles include the following sections:
4040 the container's file system.
4141- ` write ` : List of file system paths that the MCP server can write to (this also
4242 implies read access).
43- - ` network ` : Network access rules for outbound connections.
43+ - ` network ` : Network access rules for outbound connections (see
44+ [ Network isolation] ( #network-isolation ) for details):
4445 - ` outbound ` : Outbound network access rules, which include:
4546 - ` insecure_allow_all ` : If set to ` true ` , allows unrestricted outbound
4647 network access. This isn't recommended for production use.
47- - ` allow_transport ` : List of allowed transport protocols (e.g., ` tcp ` ,
48- ` udp ` ).
4948 - ` allow_host ` : List of allowed hostnames or IP addresses for outbound
5049 connections. To allow all subdomains of a domain, prefix the domain with a
5150 period (e.g., ` .github.com ` allows any subdomain of ` github.com ` ).
5251 Wildcards are not supported.
5352 - ` allow_port ` : List of allowed ports for outbound connections.
53+ - ` allow_transport ` : List of allowed transport protocols (e.g., ` tcp ` ,
54+ ` udp ` ).
5455
5556## Default permissions in the ToolHive registry
5657
@@ -100,8 +101,8 @@ output in JSON format for easier customization. Use the contents of the
100101ToolHive includes two built-in profiles that you can use without creating a
101102custom file:
102103
103- - The ` network ` profile permits outbound network access. It's the default
104- profile applied to MCP servers when you run a server without the
104+ - The ` network ` profile permits all outbound network access. It's the default
105+ profile applied to MCP servers when you run a custom server without the
105106 ` --permission-profile ` flag.
106107
107108 :::important
@@ -116,7 +117,7 @@ custom file:
116117 that don't require any external connectivity. File system access is limited to
117118 paths you explicitly mount using the ` --volume ` flag.
118119
119- ## Create a custom permissions profile
120+ ## Create a custom permission profile
120121
121122Create a JSON file with your desired permissions, like ` ~/custom-profile.json ` .
122123For example:
@@ -144,7 +145,7 @@ This profile:
144145- Allows outbound TCP or UDP connections to ` localhost ` and ` google.com `
145146 (including subdomains) on ports 80 and 443
146147
147- ## Apply a permissions profile
148+ ## Apply a permission profile
148149
149150### Using a built-in profile
150151
@@ -177,11 +178,12 @@ thv run --isolate-network --permission-profile </path/to/custom-profile.json> <s
177178
178179## Network isolation
179180
180- To enforce the network access rules defined in your permission profile, use the
181- ` --isolate-network ` flag when running the MCP server:
181+ To enforce the network access rules defined in the registry or your custom
182+ permission profile, use the ` --isolate-network ` flag when running the MCP
183+ server:
182184
183185``` bash
184- thv run --isolate-network --permission-profile < /path/to/custom-profile.json> < server-name>
186+ thv run --isolate-network [ --permission-profile < /path/to/custom-profile.json> ] < server-name>
185187```
186188
187189When you enable network isolation, ToolHive creates a secure network
@@ -208,7 +210,7 @@ ToolHive creates two separate networks in the container runtime:
208210- An internal network (` toolhive-<server-name>-internal ` ) for each MCP server
209211 that isolates it from external access
210212
211- The MCP server container connects only to the internal network, while the proxy
213+ The MCP server container only connects to the internal network, while the proxy
212214and DNS containers connect to both networks. This design ensures that all
213215network traffic flows through controlled points, allowing ToolHive to enforce
214216the access rules you specify in your permission profile.
0 commit comments