-
Notifications
You must be signed in to change notification settings - Fork 182
Closed
Labels
apiItems related to the APIItems related to the APIbugSomething isn't workingSomething isn't workingcliChanges that impact CLI functionalityChanges that impact CLI functionality
Description
Problem
The ToolHive API (/api/v1beta/workloads) does not return running remote workloads that are visible via thv list. This causes mcp-optimizer to not discover those servers.
Without a fix, mcp-optimizer is much less useful for reducing context window bloat because remote servers must be registered separately with MCP clients, bypassing mcp-optimizer entirely.
Environment
- ToolHive: v0.6.17
- Platform: macOS (darwin/arm64)
Steps to Reproduce
-
Start the API server:
thv serve --port 50000
-
Run a container-based workload:
thv run time -
Run a remote workload:
thv run --name cloudflare_docs https://docs.mcp.cloudflare.com/sse
-
Verify both appear in CLI:
thv list # Shows both time (container) and cloudflare_docs (remote) -
Query the API:
curl http://127.0.0.1:50000/api/v1beta/workloads
-
Observe that the remote workload is missing from the API response
Expected Behavior
API returns both workloads:
{
"workloads": [
{"name": "time", "remote": null, ...},
{"name": "cloudflare_docs", "remote": true, ...}
]
}Actual Behavior
API returns only the container workload:
{
"workloads": [
{"name": "time", "remote": null, ...}
]
}Individual query also fails:
curl http://127.0.0.1:50000/api/v1beta/workloads/cloudflare_docs
# Returns: "Workload configuration not found"Notes
thv listcorrectly shows both workloads- The discrepancy is between the CLI and the
thv serveAPI - This may indicate an issue with how remote workload state is stored/retrieved by the API server
Impact
mcp-optimizer cannot discover running remote workloads, making those tools unavailable to MCP clients.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiItems related to the APIItems related to the APIbugSomething isn't workingSomething isn't workingcliChanges that impact CLI functionalityChanges that impact CLI functionality