Skip to content

Commit 66ab7d8

Browse files
authored
Update client configuration docs (#24)
Updates to reflect the removal of auto-discovery in stacklok/toolhive#811 and the new setup/status commands in stacklok/toolhive#821
1 parent 77121ae commit 66ab7d8

File tree

3 files changed

+120
-123
lines changed

3 files changed

+120
-123
lines changed

docs/toolhive/guides-cli/client-configuration.md

Lines changed: 76 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,82 +5,74 @@ description:
55
sidebar_position: 40
66
---
77

8-
ToolHive can automatically configure supported AI clients to work with MCP
9-
servers. This guide shows you how to set up and manage client configurations.
8+
ToolHive automatically configures supported AI clients to work with MCP servers.
9+
This guide shows you how to set up and manage client configurations.
1010

1111
## Understanding client configuration
1212

13-
AI applications need to know where to find MCP servers before they can use them.
14-
You can configure clients with ToolHive in three ways:
13+
Before an AI application can use ToolHive MCP servers, it needs to know where to
14+
find them. You can configure clients in two ways:
1515

16-
1. **Auto-discovery**: ToolHive automatically finds and configures supported
17-
clients.
18-
2. **Manual registration**: Register specific clients for ToolHive to manage.
19-
3. **Custom configuration**: For unsupported clients or custom setups, configure
20-
them to connect to ToolHive-managed MCP servers using the SSE or Streamable
21-
HTTP protocol.
16+
1. **Register a supported client**: Register your client with ToolHive so it
17+
automatically manages and updates the client's configuration as you start,
18+
stop, and remove MCP servers.
19+
2. **Manual configuration**: For clients that ToolHive doesn't directly support,
20+
manually configure them to connect to ToolHive-managed MCP servers using the
21+
SSE or Streamable HTTP protocol.
2222

23-
With the first two methods, ToolHive automatically updates client configuration
24-
when you start or remove an MCP server. For a complete list of supported clients
25-
and compatibility details, see the
23+
For a complete list of supported clients and compatibility details, see the
2624
[Client compatibility reference](../reference/client-compatibility.mdx).
2725

28-
## Enable auto-discovery
26+
## Register clients
2927

30-
Auto-discovery is the easiest way to configure supported clients. When enabled,
31-
ToolHive automatically finds and configures supported clients on your system
32-
when you run an MCP server.
33-
34-
Enable auto-discovery with the following command:
28+
The easiest way to register clients is to run the
29+
[setup command](../reference/cli/thv_client_setup.md):
3530

3631
```bash
37-
thv config auto-discovery true
32+
thv client setup
3833
```
3934

40-
From now on, any new servers you start with
41-
[`thv run`](../reference/cli/thv_run.md) will be automatically configured in
42-
your client.
43-
44-
:::note
35+
ToolHive discovers supported clients installed on your system and lets you
36+
select which ones to register. ToolHive detects clients based on the presence of
37+
the client's configuration file in its default location. See the
38+
[Client compatibility reference](../reference/client-compatibility.mdx) for
39+
details on which clients ToolHive supports and how it detects them.
4540

46-
When you enable auto-discovery, ToolHive doesn't add existing MCP servers to
47-
your client configuration. It only configures new servers that you start with
48-
[`thv run`](../reference/cli/thv_run.md). To add existing servers, you can
49-
either:
41+
To view the current status of detected and configured clients, run:
5042

51-
1. Stop and restart each server with [`thv stop`](../reference/cli/thv_stop.md)
52-
and [`thv restart`](../reference/cli/thv_restart.md) (see
53-
[Lifecycle management](./manage-mcp-servers.md#lifecycle-management)), or
54-
2. Manually register your clients with
55-
[`thv config register-client <client-name>`](../reference/cli/thv_config_register-client.md),
56-
which adds all existing servers to the client configuration.
43+
```bash
44+
thv client status
45+
```
5746

58-
:::
47+
:::note
5948

60-
To disable auto-discovery:
49+
ToolHive previously included an "auto-discovery" mode. We removed this mode in
50+
v0.1.0 to simplify client configuration and ensure consistent control and
51+
behavior. If you previously enabled client auto-discovery, ToolHive will
52+
explicitly register all detected clients the first time you run v0.1.0 and
53+
higher.
6154

62-
```bash
63-
thv config auto-discovery false
64-
```
55+
Going forward, use the `thv client setup` command to manage your client
56+
configurations.
6557

66-
## Manually register clients
58+
:::
6759

68-
If you want more control over client configuration, you can manually register
69-
clients.
60+
## Alternative client registration
7061

71-
Use the following command to register a client:
62+
If you prefer to register clients manually or in an automated script, use the
63+
`thv config register-client` command:
7264

7365
```bash
74-
thv config register-client <client-name>
66+
thv config register-client <CLIENT_NAME>
7567
```
7668

77-
Replace `<client-name>` with the name of your client. Common client names
69+
Replace `<CLIENT_NAME>` with the name of your client. Common client names
7870
include:
7971

8072
- `claude-code` - Claude Code CLI
8173
- `cursor` - Cursor IDE
82-
- `roo-code` - Roo Code extension for VS Code
83-
- `vscode` - VS Code (GitHub Copilot)
74+
- `roo-code` - Roo Code extension for Visual Studio Code
75+
- `vscode` - Visual Studio Code (GitHub Copilot)
8476
- `vscode-insider` - VS Code Insiders edition
8577

8678
Example:
@@ -107,30 +99,33 @@ effect.
10799
To remove a client configuration:
108100

109101
```bash
110-
thv config remove-client <client-name>
102+
thv config remove-client <CLIENT_NAME>
111103
```
112104

113105
## Other clients or tools
114106

115107
If you have other clients or development libraries that ToolHive doesn't
116108
directly support, you can still configure them to use ToolHive-managed MCP
117-
servers as long as they support the SSE or Streamable HTTP protocol. Check your
118-
client or library documentation for configuration details.
109+
servers if they support the SSE or Streamable HTTP protocol. Check your client
110+
or library documentation for configuration details.
119111

120112
List your running MCP servers to get the URL:
121113

122114
```bash
123115
thv list
124116
```
125117

126-
Example output:
118+
Example output (some fields omitted for brevity):
127119

128120
```text
129-
CONTAINER ID NAME IMAGE STATE TRANSPORT PORT URL
130-
c06b6f6c09d7 fetch mcp/fetch:latest running stdio 43832 http://localhost:43832/sse#fetch
131-
0489fddf7c10 github ghcr.io/github/github-mcp-server:latest running stdio 19046 http://localhost:19046/sse#github
121+
NAME PACKAGE STATUS URL PORT
122+
github ghcr.io/github/github-mcp-server:latest running http://127.0.0.1:55264/sse#github 55264
123+
osv ghcr.io/stackloklabs/osv-mcp/server:latest running http://127.0.0.1:22089/mcp 22089
132124
```
133125

126+
In this example, the `github` server uses the SSE transport (URL ends in
127+
`/sse`), and the `osv` server uses Streamable HTTP (URL ends in `/mcp`).
128+
134129
You can also get the list in JSON format, which works with many clients that use
135130
the standard configuration format:
136131

@@ -143,44 +138,43 @@ Example output:
143138
```json
144139
{
145140
"mcpServers": {
146-
"fetch": {
147-
"url": "http://localhost:43832/sse#fetch"
148-
},
149141
"github": {
150-
"url": "http://localhost:19046/sse#github"
142+
"url": "http://127.0.0.1:55264/sse#github"
143+
},
144+
"osv": {
145+
"url": "http://127.0.0.1:22089/mcp"
151146
}
152147
}
153148
}
154149
```
155150

156-
Configure your client or library to connect to the MCP server using the URL that
151+
Configure your client or library to connect to the MCP server using the URL
157152
ToolHive provides.
158153

159154
## Related information
160155

156+
- [`thv client` command reference](../reference/cli/thv_client.md)
161157
- [`thv config` command reference](../reference/cli/thv_config.md)
162158
- [Client compatibility](../reference/client-compatibility.mdx)
163159
- [Run MCP servers](run-mcp-servers.mdx)
164160

165161
## Troubleshooting
166162

167-
### Client is not auto-discovered
168-
169-
If your client isn't configured automatically:
163+
### Client is not detected by `thv client setup`
170164

171-
1. Make sure auto-discovery is enabled:
165+
If ToolHive doesn't detect your client:
172166

173-
```bash
174-
thv config auto-discovery true
175-
```
176-
177-
2. Check if your client supports auto-discovery in the
167+
1. Verify ToolHive supports your client in the
178168
[Client compatibility reference](../reference/client-compatibility.mdx).
179169

170+
2. Make sure you installed the client in its default location. ToolHive detects
171+
clients based on their configuration files. If the client isn't in its
172+
default location, ToolHive can't detect it.
173+
180174
3. Try manually registering the client:
181175

182176
```bash
183-
thv config register-client <client-name>
177+
thv config register-client <CLIENT_NAME>
184178
```
185179

186180
### Client can't connect to MCP server
@@ -193,20 +187,20 @@ If your client can't connect to the MCP server:
193187
thv list
194188
```
195189

196-
2. If auto-discovery isn't enabled, check if the client is registered:
190+
2. Check if the client is registered:
197191

198192
```bash
199-
thv config list-registered-clients
193+
thv client status
200194
```
201195

202196
3. Make sure the URL is correct and accessible. Use `curl` to test the
203197
connection:
204198

205199
```bash
206-
curl <mcp-server-url>
200+
curl <MCP_SERVER_URL>
207201
```
208202

209-
4. Restart your client application
203+
4. Restart your client application.
210204

211205
### Client can connect but tools aren't available
212206

@@ -217,26 +211,26 @@ If your client connects to the MCP server but tools aren't available:
217211
```bash
218212
thv list
219213

220-
curl <mcp-server-url>
214+
curl <MCP_SERVER_URL>
221215
```
222216

223217
2. Check the MCP server logs:
224218

225219
```bash
226-
thv logs <server-name>
220+
thv logs <SERVER_NAME>
227221
```
228222

229-
3. Make sure the MCP server is properly configured in your client
230-
4. For VS Code, make sure the MCP server is started in the settings (see the VS
231-
Code with Copilot section in the
232-
[Client compatibility reference](../reference/client-compatibility.mdx#vs-code-with-copilot))
223+
3. Make sure you properly configured the MCP server in your client.
224+
4. For Visual Studio Code, make sure you started the MCP server in the settings
225+
(see the VS Code with Copilot section in the
226+
[Client compatibility reference](../reference/client-compatibility.mdx#vs-code-with-copilot)).
233227
5. If you've implemented authentication for your MCP server, make sure the
234-
client has the necessary permissions to access the tools
228+
client has the necessary permissions to access the tools.
235229

236230
### Containerized client can't connect to MCP server
237231

238232
If you're running an MCP client inside a container and it can't connect to an
239-
MCP server running on the same host, make sure to use the correct host address.
233+
MCP server running on the same host, make sure you use the correct host address.
240234
The ToolHive proxy is a standard OS process, so it listens on the host's network
241235
interface.
242236

docs/toolhive/reference/client-compatibility.mdx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ and/or Streamable HTTP protocol, but you'll need to configure them manually.
2727
To work with ToolHive, your client needs to:
2828

2929
1. Support the Model Context Protocol (MCP)
30-
2. Connect to MCP servers using the server-sent events (SSE) transport protocol
30+
2. Connect to MCP servers using the server-sent events (SSE) or Streamable HTTP
31+
transport protocol
3132
3. Have the correct MCP server URL configured
3233

3334
## Automatic configuration support
3435

35-
ToolHive can automatically configure supported clients to connect to MCP
36-
servers. You can either register clients manually or use auto-discovery, which
37-
finds and configures supported clients on your system automatically.
36+
ToolHive can
37+
[automatically configure supported clients](../guides-cli/client-configuration.md)
38+
to connect to MCP servers.
3839

39-
Check the table above to see which clients support automatic configuration and
40-
auto-discovery.
40+
Check the table above to see which clients support automatic configuration.
4141

4242
For other clients, you'll need to set up the MCP server URL yourself.
4343

@@ -90,9 +90,8 @@ palette and select "Preferences: Open User Settings (JSON)".
9090

9191
:::
9292

93-
When you register VS Code as a client or enable auto-discovery, ToolHive
94-
automatically updates the global MCP configuration file whenever you run an MCP
95-
server. You can also
93+
When you register VS Code as a client, ToolHive automatically updates the global
94+
MCP configuration file whenever you run an MCP server. You can also
9695
[configure project-specific MCP servers](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server-to-your-workspace)
9796
by creating a `.vscode/mcp.json` file in your project directory.
9897

@@ -117,9 +116,8 @@ Example configuration:
117116

118117
Cursor automatically detects the transport mode for HTTP MCP servers.
119118

120-
When you register Cursor as a client or enable auto-discovery, ToolHive
121-
automatically updates the global MCP configuration file whenever you run an MCP
122-
server. You can also
119+
When you register Cursor as a client, ToolHive automatically updates the global
120+
MCP configuration file whenever you run an MCP server. You can also
123121
[configure project-specific MCP servers](https://docs.cursor.com/context/model-context-protocol#configuration-locations)
124122
by creating a `.cursor/mcp.json` file in your project directory.
125123

@@ -144,10 +142,9 @@ Example configuration:
144142
}
145143
```
146144

147-
When you register Claude Code as a client or enable auto-discovery, ToolHive
148-
automatically updates the global MCP configuration file whenever you run an MCP
149-
server. You can also
150-
[configure project-specific MCP servers](https://docs.anthropic.com/en/docs/claude-code/tutorials#understanding-mcp-server-scopes)
145+
When you register Claude Code as a client, ToolHive automatically updates the
146+
global MCP configuration file whenever you run an MCP server. You can also
147+
[configure project-specific MCP servers](https://docs.anthropic.com/en/docs/claude-code/mcp#understanding-mcp-server-scopes)
151148
by creating a `.mcp.json` file in your project directory, or add servers using
152149
the `claude` CLI:
153150

@@ -187,9 +184,9 @@ Example configuration:
187184
}
188185
```
189186

190-
When you register Roo Code or Cline as a client or enable auto-discovery,
191-
ToolHive automatically updates the global MCP configuration file whenever you
192-
run an MCP server. With Roo Code, you can also configure
187+
When you register Roo Code or Cline as a client, ToolHive automatically updates
188+
the global MCP configuration file whenever you run an MCP server. With Roo Code,
189+
you can also configure
193190
[project-specific MCP servers](https://docs.roocode.com/features/mcp/using-mcp-in-roo#editing-mcp-settings-files)
194191
by creating a `.roo/mcp.json` file in your project directory.
195192

0 commit comments

Comments
 (0)