Closed
Description
Scenario:
- Run an MCP server using a protocol scheme, but no
--name
parameter - ToolHive auto-generates a name, but there's a mismatch between the name shown in
thv list
and the name added to client configs - Remove the server; ToolHive fails to remove from the client config because of the mismatch
Reproduction:
$ thv run uvx://mcp-server-fetch
$ thv list
CONTAINER ID NAME IMAGE STATE TRANSPORT PORT URL
666aa88c52bf toolhivelocal-uvx-mcp-server-fetch-1746827186 toolhivelocal/uvx-mcp-server-fetch:20250509174618 running stdio 19639 http://localhost:19639/sse#toolhivelocal-uvx-mcp-server-fetch-1746827186
Note the name: toolhivelocal-uvx-mcp-server-fetch-1746827186
. Compare to the name in the client config file, example for roo-code, which omits the (random?) -1746827186
suffix:
{
"mcpServers": {
"toolhivelocal-uvx-mcp-server-fetch": {"url": "http://localhost:19639/sse#toolhivelocal-uvx-mcp-server-fetch"}
}
}
Then try to remove the server:
$ thv stop toolhivelocal-uvx-mcp-server-fetch-1746827186
<snipped>
$ thv rm toolhivelocal-uvx-mcp-server-fetch-1746827186
5:47PM INF Removing container toolhivelocal-uvx-mcp-server-fetch-1746827186...
5:47PM INF Deleted run configuration for toolhivelocal-uvx-mcp-server-fetch
5:47PM INF Saved state for toolhivelocal-uvx-mcp-server-fetch removed
5:47PM INF Container toolhivelocal-uvx-mcp-server-fetch-1746827186 removed
5:47PM INF Removing MCP server from client configuration: /Users/dan/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json
5:47PM ERR Failed to patch file: hujson: patch operation 0: value not found
5:47PM INF Successfully removed the MCPServer toolhivelocal-uvx-mcp-server-fetch-1746827186 from the client config file
5:47PM INF Successfully removed MCP server from client configuration: /Users/dan/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json
Note: 5:47PM ERR Failed to patch file: hujson: patch operation 0: value not found
is followed by two "Successfully removed" messages, which are not true.
Result:
Entry remains in the mcp_settings.json file:
{
"mcpServers": {
"toolhivelocal-uvx-mcp-server-fetch": {"url": "http://localhost:19639/sse#toolhivelocal-uvx-mcp-server-fetch"}
}
}
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
ChrisJBurns commentedon May 13, 2025
@danbarr This has been fixed in #372 feel free to give it a quick test and if you're happy feel free to close
danbarr commentedon May 13, 2025
LGTM, thanks for the fix!