Skip to content

thv proxy stdio: upstream initialize fails against Semgrep remote MCP (Unsupported protocol version 2026-07-28), no fallback #7119

Open

Description

@ramzimalhas

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, status running

Steps to reproduce

  1. Run the Semgrep remote workload so it is running in thv list.
  2. 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
  1. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue needs initial triage by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions