Client configuration
ToolHive can automatically configure supported AI clients to work with MCP servers. This guide shows you how to set up and manage client configurations.
Understanding client configuration
AI applications need to know where to find MCP servers before they can use them. You can configure clients with ToolHive in three ways:
- Auto-discovery: ToolHive automatically finds and configures supported clients.
- Manual registration: Register specific clients for ToolHive to manage.
- Custom configuration: For unsupported clients or custom setups, configure them to connect to ToolHive-managed MCP servers using the SSE protocol.
With the first two methods, ToolHive automatically updates client configuration when you start or remove an MCP server. For a complete list of supported clients and compatibility details, see the Client compatibility reference.
Enable auto-discovery
Auto-discovery is the easiest way to configure supported clients. When enabled, ToolHive automatically finds and configures supported clients on your system when you run an MCP server.
Enable auto-discovery with the following command:
thv config auto-discovery true
From now on, any new servers you start with
thv run
will be automatically configured in
your client.
When you enable auto-discovery, ToolHive doesn't add existing MCP servers to
your client configuration. It only configures new servers that you start with
thv run
. To add existing servers, you can
either:
- Stop and restart each server with
thv stop
andthv restart
(see Lifecycle management), or - Manually register your clients with
thv config register-client <client-name>
, which adds all existing servers to the client configuration.
To disable auto-discovery:
thv config auto-discovery false
Manually register clients
If you want more control over client configuration, you can manually register clients.
Use the following command to register a client:
thv config register-client <client-name>
Replace <client-name>
with the name of your client. Common client names
include:
claude-code
- Claude Code CLIcursor
- Cursor IDEroo-code
- Roo Code extension for VS Codevscode
- VS Code (GitHub Copilot)vscode-insider
- VS Code Insiders edition
Example:
thv config register-client vscode
Run
thv config register-client --help
for the latest list of supported clients.
To list currently registered clients:
thv config list-registered-clients
Repeat the registration step for any additional clients you want to configure.
You might need to restart your client application for the configuration to take effect.
To remove a client configuration:
thv config remove-client <client-name>
Other clients or tools
If you have other clients or development libraries that ToolHive doesn't directly support, you can still configure them to use ToolHive-managed MCP servers as long as they support the SSE protocol. Check your client or library documentation for configuration details.
List your running MCP servers to get the URL:
thv list
Example output:
CONTAINER ID NAME IMAGE STATE TRANSPORT PORT URL
c06b6f6c09d7 fetch mcp/fetch:latest running stdio 43832 http://localhost:43832/sse#fetch
0489fddf7c10 github ghcr.io/github/github-mcp-server:latest running stdio 19046 http://localhost:19046/sse#github
You can also get the list in JSON format, which works with many clients that use the standard configuration format:
thv list --format mcpservers
Example output:
{
"mcpServers": {
"fetch": {
"url": "http://localhost:43832/sse#fetch"
},
"github": {
"url": "http://localhost:19046/sse#github"
}
}
}
Configure your client or library to connect to the MCP server using the URL that ToolHive provides.
Troubleshooting
Client is not auto-discovered
If your client isn't configured automatically:
-
Make sure auto-discovery is enabled:
thv config auto-discovery true
-
Check if your client supports auto-discovery in the Client compatibility reference.
-
Try manually registering the client:
thv config register-client <client-name>
Client can't connect to MCP server
If your client can't connect to the MCP server:
-
Verify the MCP server is running:
thv list
-
If auto-discovery isn't enabled, check if the client is registered:
thv config list-registered-clients
-
Make sure the URL is correct and accessible. Use
curl
to test the connection:curl <mcp-server-url>
-
Restart your client application
Client can connect but tools aren't available
If your client connects to the MCP server but tools aren't available:
-
Make sure the MCP server is running and accessible:
thv list
curl <mcp-server-url> -
Check the MCP server logs:
thv logs <server-name>
-
Make sure the MCP server is properly configured in your client
-
For VS Code, make sure the MCP server is started in the settings (see the VS Code with Copilot section in the Client compatibility reference)
-
If you've implemented authentication for your MCP server, make sure the client has the necessary permissions to access the tools