Monitor and manage MCP servers
Monitoring
ToolHive provides visibility into the status of your MCP servers. You can check the status of running servers and view their logs using the ToolHive CLI.
List running servers
To see all currently running MCP servers:
thv list
This shows the server name, package, status, url, port, tool type, group, and created at. Remote servers display their target URL in the URL column. The word 'remote' is indicated in both the package and tool type columns, making it easy to identify remote servers.
To include stopped servers in the list:
thv list --all
View server logs
Containerized servers
To view the logs of a running or stopped containerized MCP server, use the
thv logs
command. You can optionally follow
the logs with the --follow
option, which shows the most recent log entries and
updates in real time.
thv logs <SERVER_NAME> [--follow]
Remote servers
The thv logs command only works with local containers. For remote MCP servers, there’s no container to read logs from, so you’ll need to check the log files directly in the ToolHive application directory. The path depends on your platform:
- macOS:
~/Library/Application Support/toolhive/logs/<SERVER_NAME>.log
- Linux:
~/.local/share/toolhive/logs/<SERVER_NAME>.log
The specific log file path is displayed when you start a server with
thv run
.
Lifecycle management
MCP servers can be started, stopped, restarted, and removed using the ToolHive CLI. The commands are similar to Docker commands, but they're designed to work with the ToolHive CLI and MCP servers.
Stop a server
To stop a running MCP server:
thv stop <SERVER_NAME>
This stops the server and the associated proxy process, removes the MCP server's entry from your configured clients, but keeps the container for future use. For remote servers, this terminates the proxy process but preserves the configuration.
Add the --group
flag to stop all servers in a specific group:
thv stop --group <GROUP_NAME>
Add the --all
flag to stop all running servers.
Restart a server
To restart a stopped MCP server and add it back to your configured clients:
thv restart <SERVER_NAME>
For remote servers, restarting will:
- Recreate the proxy process
- Re-establish connection to the remote server
- Re-authenticate with the remote server (triggers new OAuth flow)
Add the --group
flag to restart all servers in a specific group:
thv restart --group <GROUP_NAME>
Remove a server
To remove an MCP server:
thv rm <SERVER_NAME>
This removes the container and cleans up the MCP server's entry in your configured clients. If the server is still running, it will be stopped as part of the removal. For remote servers, this removes the proxy process, configuration, and stored authentication tokens.
Add the --group
flag to remove all servers in a specific group:
thv rm --group <GROUP_NAME>
If you use docker rm
to remove an MCP container that ToolHive created, it
won't clean up the MCP server's entry in your configured clients. Use
thv rm
to make sure the entry is removed.
Remote server authentication
Remote servers with OAuth authentication will automatically refresh tokens when they expire during normal operation. However, restarting a remote server always triggers a new OAuth authentication flow:
thv restart <REMOTE_SERVER_NAME>
This will always prompt for re-authentication, even if valid tokens exist.