Repository navigation
Description
Bug description
thv proxy stdio <workload> cannot connect to the Semgrep remote MCP server. The stdio bridge offers protocolVersion: 2026-07-28 upstream. Semgrep's server rejects it with HTTP 400 instead of negotiating down, and the bridge does not retry with an older supported version, so initialize fails. MCP clients that rely on thv proxy stdio (for example Claude Desktop) therefore can't use this workload.
The same workload works for clients that connect to the streamable HTTP proxy URL directly.
Environment
- ToolHive CLI v0.53.0 (commit fa7e344), bundled in ToolHive Studio 0.40.2
- macOS 27.2.1 (arm64), OrbStack runtime
- Workload: Semgrep remote MCP (registry
io.github.stacklok/semgrep-remote), transport streamable-http, statusrunning
Steps to reproduce
- Run the Semgrep remote workload so it is
runninginthv list. - Send a single initialize request through the stdio bridge:
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' | thv proxy stdio semgrep- For comparison, POST the same initialize directly to the workload's local proxy URL:
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:<port>/mcp \
-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}'Actual behavior
Step 2 logs:
level=ERROR msg="upstream initialize failed" error="transport error: server returned 4xx for initialize POST, likely a legacy SSE server
sending \"notifications/initialized\": rejected by transport: Post \"http://127.0.0.1:<port>/mcp\": context canceled: request failed with status 400: {\"jsonrpc\":\"2.0\",\"id\":\"server-error\",\"error\":{\"code\":-32600,\"message\":\"Bad Request: Unsupported protocol version: 2026-07-28. Supported versions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25\"}}"
Step 3 returns 200.
The client asked for 2025-06-18, but the bridge sent 2026-07-28 upstream.
Expected behavior
The stdio bridge should complete initialize with a version both sides support. It could forward the client's requested protocolVersion, or fall back to the newest version the server lists (here 2025-11-25) when the server rejects 2026-07-28. It also shouldn't label the 400 as a "legacy SSE server".
Notes
- I couldn't find an existing issue for this. The release notes for v0.55 through v0.64 don't appear to mention a fix, but I haven't tested a newer standalone CLI, because Studio 0.40.2 still bundles v0.53.0.
- Possibly related to the 2026-07-28 dual-era work (Epic: MCP protocol currency and 2026-07-28 stateless readiness #5743).
Activity
Cover stdio proxy protocol-version fallback (#7124)