|
2 | 2 |
|
3 | 3 | <img src="docs/images/toolhive.png" alt="ToolHive Logo" width="300" />
|
4 | 4 |
|
5 |
| -ToolHive (thv) is a lightweight, secure, and fast manager for MCP (Model Context Protocol) servers. It is written in Golang and has extensive test coverage—including input validation—to ensure reliability and security. |
| 5 | +ToolHive (thv) is a lightweight, secure, and fast manager for MCP (Model Context |
| 6 | +Protocol) servers. It is written in Golang and has extensive test |
| 7 | +coverage—including input validation—to ensure reliability and security. |
6 | 8 |
|
7 |
| -Under the hood, ToolHive acts as a very thin client for the Docker/Podman Unix socket API. This design choice allows it to remain both efficient and lightweight while still providing powerful, container-based isolation for running MCP servers. |
| 9 | +Under the hood, ToolHive acts as a very thin client for the Docker/Podman Unix |
| 10 | +socket API. This design choice allows it to remain both efficient and |
| 11 | +lightweight while still providing powerful, container-based isolation for |
| 12 | +running MCP servers. |
8 | 13 |
|
9 | 14 | <img src="./docs/images/thv-readme-demo.svg" alt="Terminal Recording">
|
10 | 15 |
|
11 | 16 | ## Why ToolHive?
|
12 | 17 |
|
13 |
| -Deploying MCP servers requires complex multi-step processes with a lot of friction: involving running random potentially harmful commands (e.g. using `uv` or `npx`), manually managing security credentials (e.g. putting an api token into a text file), and wrestling with inconsistent packaging methods. ToolHive aims to solve this by starting containers in a locked-down environment, granting only the minimal permissions required to run. This significantly reduces the attack surface, imporves usability, and enforces best practices for container security. |
| 18 | +Deploying MCP servers requires complex multi-step processes with a lot of |
| 19 | +friction: involving running random potentially harmful commands (e.g. using `uv` |
| 20 | +or `npx`), manually managing security credentials (e.g. putting an api token |
| 21 | +into a text file), and wrestling with inconsistent packaging methods. ToolHive |
| 22 | +aims to solve this by starting containers in a locked-down environment, granting |
| 23 | +only the minimal permissions required to run. This significantly reduces the |
| 24 | +attack surface, improves usability, and enforces best practices for container |
| 25 | +security. |
14 | 26 |
|
15 | 27 | ToolHive radically simplifies MCP deployment by:
|
16 |
| - - Ease of Use: Instantly deploy MCP servers through Docker containers. Users can start their MCP servers with a single, straightforward command. No need to install and fight with different versions of python / node / etc. |
17 | 28 |
|
18 |
| -- Enhanced Security: Secure by default: the tool securely manages secrets and configurations, greatly reducing leaks & risks. No more plaintext secrets in configuration files |
| 29 | +- Ease of use: Instantly deploy MCP servers through Docker containers. Users can |
| 30 | + start their MCP servers with a single, straightforward command. No need to |
| 31 | + install and fight with different versions of python / node / etc. |
19 | 32 |
|
20 |
| -- Standardized Packaging: Leveraging OCI container standards, the project provides a repeatable, standardized packaging method for MCP servers, ensuring compatibility and reliability. |
| 33 | +- Enhanced security: Secure by default: the tool securely manages secrets and |
| 34 | + configurations, greatly reducing leaks & risks. No more plaintext secrets in |
| 35 | + configuration files |
21 | 36 |
|
| 37 | +- Standardized packaging: Leveraging OCI container standards, the project |
| 38 | + provides a repeatable, standardized packaging method for MCP servers, ensuring |
| 39 | + compatibility and reliability. |
22 | 40 |
|
23 |
| -### Key Benefits |
24 |
| -- Curated MCP Registry: Includes a registry of curated MCPs with verified configurations — users can effortlessly discover and deploy MCP servers without any manual setup. Just select one from the list and safely run it with just one command. |
| 41 | +### Key benefits |
25 | 42 |
|
26 |
| -- Enterprise-Ready Authorization: Offers robust authorization controls tailored for enterprise environments, securely managing tool access and integrating seamlessly with existing infrastructures (e.g., Kubernetes). |
| 43 | +- Curated MCP registry: Includes a registry of curated MCPs with verified |
| 44 | + configurations — users can effortlessly discover and deploy MCP servers |
| 45 | + without any manual setup. Just select one from the list and safely run it with |
| 46 | + just one command. |
27 | 47 |
|
28 |
| -- Seamless Integration: Compatible with popular development tools such as Copilot, Continue, Claude Desktop, Stitch, and more, streamlining your workflow. |
| 48 | +- Enterprise-ready authorization: Offers robust authorization controls tailored |
| 49 | + for enterprise environments, securely managing tool access and integrating |
| 50 | + seamlessly with existing infrastructures (e.g., Kubernetes). |
29 | 51 |
|
30 |
| -## Getting Started |
| 52 | +- Seamless integration: Compatible with popular development tools such as GitHub |
| 53 | + Copilot, Cursor, Roo Code, and more, streamlining your workflow. |
| 54 | + |
| 55 | +## Getting started |
31 | 56 |
|
32 | 57 | TODO: Add simple installation instructions
|
33 | 58 |
|
34 | 59 | ## Usage
|
35 | 60 |
|
36 |
| -### Running an MCP Server |
| 61 | +### Running an MCP server |
37 | 62 |
|
38 |
| -First, find the MCP server you want to run. You can search for available MCP servers in the registry using: |
| 63 | +First, find the MCP server you want to run. You can search for available MCP |
| 64 | +servers in the registry using: |
39 | 65 |
|
40 | 66 | ```bash
|
41 | 67 | thv search <search-term>
|
42 | 68 | ```
|
43 | 69 |
|
44 |
| -This command will return a list of available MCP servers that match the search term. |
| 70 | +This command will return a list of available MCP servers that match the search |
| 71 | +term. |
45 | 72 |
|
46 |
| -Once you find the MCP server you want to run, you can start it using the `thv run` command. For example, to run a specific MCP server: |
| 73 | +Once you find the MCP server you want to run, you can start it using the |
| 74 | +`thv run` command. For example, to run a specific MCP server: |
47 | 75 |
|
48 | 76 | ```bash
|
49 | 77 | thv run <name-of-mcp-server>
|
50 | 78 | ```
|
51 | 79 |
|
52 |
| -The registry already contains all the parameters needed to run the server, so you don't need to specify any additional arguments. |
53 |
| -ToolHive will automatically pull the image and start the server. |
| 80 | +The registry already contains all the parameters needed to run the server, so |
| 81 | +you don't need to specify any additional arguments. ToolHive will automatically |
| 82 | +pull the image and start the server. |
54 | 83 |
|
55 |
| -### Listing Running MCP Servers |
| 84 | +### Listing running MCP servers |
56 | 85 |
|
57 | 86 | Use:
|
58 | 87 |
|
59 | 88 | ```bash
|
60 | 89 | thv list
|
61 | 90 | ```
|
62 | 91 |
|
63 |
| -This lists all active MCP servers managed by ToolHive, along with their current status. |
| 92 | +This lists all active MCP servers managed by ToolHive, along with their current |
| 93 | +status. |
64 | 94 |
|
65 |
| -### Browsing the Registry |
| 95 | +### Browsing the registry |
66 | 96 |
|
67 |
| -You can also browse the registry to see all available MCP servers. Use the following command: |
| 97 | +You can also browse the registry to see all available MCP servers. Use the |
| 98 | +following command: |
68 | 99 |
|
69 | 100 | ```bash
|
70 | 101 | thv registry list
|
71 | 102 | ```
|
72 | 103 |
|
73 |
| -This will display a list of all available MCP servers in the registry, along with their descriptions and other relevant information. |
| 104 | +This will display a list of all available MCP servers in the registry, along |
| 105 | +with their descriptions and other relevant information. |
74 | 106 |
|
75 | 107 | To view detailed information about a specific MCP server, use:
|
76 | 108 |
|
77 | 109 | ```bash
|
78 | 110 | thv registry info <name-of-mcp-server>
|
79 | 111 | ```
|
80 | 112 |
|
81 |
| -This command will provide you with detailed information about the MCP server, including its configuration, available options, and any other relevant details. |
| 113 | +This command will provide you with detailed information about the MCP server, |
| 114 | +including its configuration, available options, and any other relevant details. |
82 | 115 |
|
83 |
| -We're open to adding more MCP servers to the registry. If you have a specific server in mind, please submit a pull request or open an issue on our GitHub repository. |
84 |
| -We're tracking the the list in [registry.json](pkg/registry/data/registry.json). |
| 116 | +We're open to adding more MCP servers to the registry. If you have a specific |
| 117 | +server in mind, please submit a pull request or open an issue on our GitHub |
| 118 | +repository. We're tracking the the list in |
| 119 | +[registry.json](pkg/registry/data/registry.json). |
85 | 120 |
|
86 |
| -### Running a Custom MCP Server |
| 121 | +### Running a custom MCP server |
87 | 122 |
|
88 |
| -If you want to run a custom MCP server that is not in the registry, you can do so by specifying the image name and any additional arguments. For example: |
| 123 | +If you want to run a custom MCP server that is not in the registry, you can do |
| 124 | +so by specifying the image name and any additional arguments. For example: |
89 | 125 |
|
90 | 126 | ```bash
|
91 | 127 | thv run --transport sse --name my-mcp-server --port 8080 my-mcp-server-image:latest -- my-mcp-server-args
|
92 | 128 | ```
|
93 | 129 |
|
94 |
| -This command closely resembles `docker run` but focuses on security and simplicity. When invoked: |
| 130 | +This command closely resembles `docker run` but focuses on security and |
| 131 | +simplicity. When invoked: |
95 | 132 |
|
96 |
| -* ToolHive creates a container from the specified image (`my-mcp-server-image:latest`). |
| 133 | +- ToolHive creates a container from the specified image |
| 134 | + (`my-mcp-server-image:latest`). |
97 | 135 |
|
98 |
| -* It configures the container to listen on the chosen port (8080). |
| 136 | +- It configures the container to listen on the chosen port (8080). |
99 | 137 |
|
100 |
| -* Labels the container so it can be tracked by ToolHive: |
| 138 | +- Labels the container so it can be tracked by ToolHive: |
101 | 139 |
|
102 |
| - ```yaml |
103 |
| - toolhive: true |
104 |
| - toolhive-name: my-mcp-server |
105 |
| - ``` |
| 140 | + ```yaml |
| 141 | + toolhive: true |
| 142 | + toolhive-name: my-mcp-server |
| 143 | + ``` |
106 | 144 |
|
107 |
| -* Sets up the specified transport (e.g., SSE, stdio), potentially using a reverse proxy, depending on user choice. |
| 145 | +- Sets up the specified transport (e.g., SSE, stdio), potentially using a |
| 146 | + reverse proxy, depending on user choice. |
108 | 147 |
|
109 |
| -### Transport Modes |
| 148 | +### Transport modes |
110 | 149 |
|
111 |
| -* **SSE**: |
| 150 | +- **SSE**: |
112 | 151 |
|
113 |
| - If the transport is `sse`, ToolHive creates a reverse proxy on a random port that forwards requests to the container. This means the container itself does not directly expose any ports. |
| 152 | + If the transport is `sse`, ToolHive creates a reverse proxy on a random port |
| 153 | + that forwards requests to the container. This means the container itself does |
| 154 | + not directly expose any ports. |
114 | 155 |
|
115 |
| -* **STDIO**: |
| 156 | +- **STDIO**: |
116 | 157 |
|
117 |
| - If the transport is `stdio`, ToolHive redirects SSE traffic to the container's standard input and output. |
118 |
| - This acts as a secure proxy, ensuring that the container does not have direct access to the network nor |
119 |
| - the host machine. |
| 158 | + If the transport is `stdio`, ToolHive redirects SSE traffic to the container's |
| 159 | + standard input and output. This acts as a secure proxy, ensuring that the |
| 160 | + container does not have direct access to the network nor the host machine. |
120 | 161 |
|
121 | 162 | ## Permissions
|
122 | 163 |
|
123 |
| -Containers launched by ToolHive come with a minimal set of permissions, strictly limited to what is required. Permissions can be further customized via a JSON-based permission profile provided with the `--permission-profile` flag. |
| 164 | +Containers launched by ToolHive come with a minimal set of permissions, strictly |
| 165 | +limited to what is required. Permissions can be further customized via a |
| 166 | +JSON-based permission profile provided with the `--permission-profile` flag. |
124 | 167 |
|
125 | 168 | An example permission profile file could be:
|
126 | 169 |
|
127 | 170 | ```json
|
128 | 171 | {
|
129 |
| - "read": [ |
130 |
| - "/var/run/mcp.sock" |
131 |
| - ], |
132 |
| - "write": [ |
133 |
| - "/var/run/mcp.sock" |
134 |
| - ], |
| 172 | + "read": ["/var/run/mcp.sock"], |
| 173 | + "write": ["/var/run/mcp.sock"], |
135 | 174 | "network": {
|
136 | 175 | "outbound": {
|
137 | 176 | "insecure_allow_all": false,
|
138 |
| - "allow_transport": [ |
139 |
| - "tcp", |
140 |
| - "udp" |
141 |
| - ], |
142 |
| - "allow_host": [ |
143 |
| - "localhost", |
144 |
| - "google.com" |
145 |
| - ], |
146 |
| - "allow_port": [ |
147 |
| - 80, |
148 |
| - 443 |
149 |
| - ] |
| 177 | + "allow_transport": ["tcp", "udp"], |
| 178 | + "allow_host": ["localhost", "google.com"], |
| 179 | + "allow_port": [80, 443] |
150 | 180 | }
|
151 | 181 | }
|
152 | 182 | }
|
153 | 183 | ```
|
154 | 184 |
|
155 |
| -This profile lets the container read and write to the `/var/run/mcp.sock` Unix socket and also make outbound network requests to `localhost` and `google.com` on ports `80` and `443`. |
| 185 | +This profile lets the container read and write to the `/var/run/mcp.sock` Unix |
| 186 | +socket and also make outbound network requests to `localhost` and `google.com` |
| 187 | +on ports `80` and `443`. |
156 | 188 |
|
157 | 189 | Two built-in profiles are included for convenience:
|
158 | 190 |
|
159 |
| -* `stdio`: Grants minimal permissions with no network access. |
160 |
| -* `network`: Permits outbound network connections to any host on any port (not recommended for production use). |
| 191 | +- `stdio`: Grants minimal permissions with no network access. |
| 192 | +- `network`: Permits outbound network connections to any host on any port (not |
| 193 | + recommended for production use). |
161 | 194 |
|
162 |
| -## Client Compability |
| 195 | +## Client compatibility |
163 | 196 |
|
164 |
| -| Client | Supported | Notes | |
165 |
| -|--------|-----------|-------| |
166 |
| -| Copilot (VS Code) | ✅ | |
167 |
| -| Cursor | ✅ | |
168 |
| -| Roo Code | ✅ | |
169 |
| -| PydanticAI | ✅ | |
170 |
| -| Continue| ❌ | Continue doesn't yet support SSE |
171 |
| -| Claude Desktop | ❌ | Claude Desktop doesn't yet support SSE |
| 197 | +| Client | Supported | Notes | |
| 198 | +| ----------------- | --------- | -------------------------------------- | |
| 199 | +| Copilot (VS Code) | ✅ | v1.99.0+ or Insiders version | |
| 200 | +| Cursor | ✅ | | |
| 201 | +| Roo Code | ✅ | | |
| 202 | +| PydanticAI | ✅ | | |
| 203 | +| Continue | ❌ | Continue doesn't yet support SSE | |
| 204 | +| Claude Desktop | ❌ | Claude Desktop doesn't yet support SSE | |
172 | 205 |
|
173 |
| -## Running ToolHive Inside of a Local Kind Cluster |
| 206 | +## Running ToolHive in a local kind cluster |
174 | 207 |
|
175 |
| -In order to run this against a local Kind Cluster, follow the [# Running ToolHive Inside a Local Kubernetes Kind Cluster With Ingress](./docs/running-toolhive-in-kind-cluster.md) doc. |
| 208 | +To run ToolHive in a local lind cluster, follow the |
| 209 | +[# Running ToolHive Inside a Local Kubernetes Kind Cluster With Ingress](./docs/running-toolhive-in-kind-cluster.md) |
| 210 | +doc. |
176 | 211 |
|
177 | 212 | ## License
|
178 | 213 |
|
179 |
| -This project is licensed under the Apache 2.0 License. See the LICENSE file for details. |
| 214 | +This project is licensed under the Apache 2.0 License. See the |
| 215 | +[LICENSE](./LICENSE) file for details. |
| 216 | + |
| 217 | +<!-- markdownlint-disable-file MD033 --> |
0 commit comments