Repository navigation
Description
Summary
For upstream servers using the streamable HTTP transport, mcpproxy never receives notifications/tools/list_changed. The handler added for #209 is in place, but the HTTP transport is built without a standalone GET stream, so server-initiated notifications have nowhere to arrive. In practice, tool adds, removes and description/schema changes reach downstream clients only on the next tool-discovery poll (default 5 minutes, observed 6 to 7 minutes).
Upstreams using protocol: sse are not affected: with the same probe server on SSE, changes reached mcpproxy in about 0.1 s.
Version
- mcpproxy-go v0.73.0 (linux-amd64 release binary)
- mark3labs/mcp-go v1.0.0 (from
go.mod)
Cause
internal/transport/http.go builds the streamable HTTP transport without transport.WithContinuousListening():
httpTransport, err := transport.NewStreamableHTTP(cfg.URL, opts...)Without that option, mcp-go never opens the standalone GET SSE stream that the MCP spec uses for server-to-client messages outside a request (client/transport/streamable_http.go:38 in mcp-go v1.0.0). The notification handler in internal/upstream/core/connection_lifecycle.go (the MethodNotificationToolsListChanged case) therefore never fires for HTTP upstreams.
Reproduction
- Run a streamable HTTP MCP server (TypeScript SDK 1.32.2) with
capabilities.tools.listChanged: truethat can add, remove or change a tool on demand and sendsnotifications/tools/list_changedwhen it does. - Add it to mcpproxy as
protocol: httpwithtrust_mode: auto. Keep default intervals. - Connect a client to
/mcp/alland keep its GET stream open. - Add a tool on the upstream.
Observed:
| step | upstream sent list_changed | mcpproxy re-listed | downstream client got list_changed |
|---|---|---|---|
| add tool | 17:40:30.434 | 17:46:28.999 (+358 s, discovery poll) | 17:46:36.205 |
| remove tool | 17:49:58 | 17:56:28.898 (+391 s, discovery poll) | 17:56:37.717 |
- The upstream's request log shows no
GETfrom mcpproxy at any point, onlyPOSTs. - Control: a plain client connected directly to the same upstream with a GET stream received the notification 2.9 s after the change.
- Same probe server exposed over SSE and added as
protocol: sse: add, remove and description/schema change were each reflected in mcpproxy's tool list within 0.1 s.
So the downstream side (mcpproxy to clients) works; only the upstream HTTP receive path is missing.
Expected
An HTTP upstream that advertises tools.listChanged should have its changes picked up within seconds, as SSE upstreams already are.
Suggested fix
Pass transport.WithContinuousListening() when building the streamable HTTP transport (perhaps only when the upstream's initialize result advertises tools.listChanged). The spec allows a server to answer the GET with 405 Method Not Allowed, so that case should fall back quietly to polling.
Why the poll is not a good workaround
tool_discovery_intervalcannot go below 30 s, and neither the REST server endpoints normcpproxy upstream addcan set it per server; only a whole-configPATCH /api/v1/configcan.- Polling a large upstream is costly: one of our upstreams (another mcpproxy aggregating many servers) returns a ~178 KB
tools/list, so a 30 s poll is about 0.5 GB a day for no change. - For scale-to-zero upstreams (Cloud Run), any polling keeps waking the service.
Activity
fix(transport): GET-stream transport built without http.DefaultTransp…
Dumbris commentedon Nov 16, 2026
Fixed in #1915.
mcpproxy now keeps one standalone GET stream open to a streamable-HTTP upstream, but only when the upstream's
initializeresult advertisescapabilities.tools.listChanged. Other upstreams get no extra held connection, which matters for scale-to-zero hosts.If the upstream refuses the stream (405, 400, 406, 401, 403, a cross-origin redirect, or an answer that isn't an event stream), mcpproxy logs one INFO line and falls back to the discovery poll. Transient failures back off from 1s up to 2 minutes. The stream also follows session re-initialize, reconnect and server removal.
test: closeHTTPFixture cuts connections until Close returns (#1910)
test(runtime): rate-limit echo upstream closes instead of Shutdown (#…
test(runtime): let the list_changed test own its notification, and co…