You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #5301 fixed the per-session HTTP HeaderForward gap reported in #5289. The regression test TestHTTPSession_AppliesHeaderForwardToPostInitializeRequests (in pkg/vmcp/session/internal/backend/) drives a real MCP client through the production transport chain, but exercises only the streamable-http transport because that is the only transport our test fakes can speak.
createMCPClient (pkg/vmcp/session/internal/backend/mcp_session.go) supports both streamable-http and sse. The BuildHeaderForwardTripper wrap is applied to the shared base before the per-transport switch, so SSE is wired correctly today — but a future refactor that moves the wrap into the streamable-http arm only would silently re-break SSE (the exact failure mode of the original #5289 bug, just on a different branch).
What is needed
Extend the canonical fakeBackend test helper (in pkg/vmcp/session/internal/backend/mcp_session_capabilities_test.go) to support the SSE transport, OR add a sibling SSE fake in the same file. The fake must:
Serve GET /sse with Content-Type: text/event-stream.
Push the initial endpoint event so the mark3labs mcp-go SSE client knows where to POST commands.
Accept POST /messages (or whatever endpoint the client requests) for outbound JSON-RPC requests, recording inbound headers per method (same recording shape fakeBackend already has for streamable-http after PR Wire HeaderForward into vMCP per-session HTTP client #5301's second commit).
Push responses back over the SSE stream in event: message, data: {...}\n\n format.
Close cleanly when the test ends.
Table-drive TestHTTPSession_AppliesHeaderForwardToPostInitializeRequests over both transport types so the regression is enforced for SSE as well as streamable-http. Each table row asserts the post-initialize request carries the configured X-MCP-Toolsets header.
A test SSE fake exists in pkg/vmcp/session/internal/backend/ that can serve a full initialize → tools/list → tools/call handshake to an mcp-go SSE client.
Header recording works identically for both transports (same headersFor(method) accessor).
TestHTTPSession_AppliesHeaderForwardToPostInitializeRequests runs as a table over both transports and passes for each.
Motivation
PR #5301 fixed the per-session HTTP HeaderForward gap reported in #5289. The regression test
TestHTTPSession_AppliesHeaderForwardToPostInitializeRequests(inpkg/vmcp/session/internal/backend/) drives a real MCP client through the production transport chain, but exercises only thestreamable-httptransport because that is the only transport our test fakes can speak.createMCPClient(pkg/vmcp/session/internal/backend/mcp_session.go) supports bothstreamable-httpandsse. TheBuildHeaderForwardTripperwrap is applied to the shared base before the per-transport switch, so SSE is wired correctly today — but a future refactor that moves the wrap into the streamable-http arm only would silently re-break SSE (the exact failure mode of the original #5289 bug, just on a different branch).What is needed
Extend the canonical
fakeBackendtest helper (inpkg/vmcp/session/internal/backend/mcp_session_capabilities_test.go) to support the SSE transport, OR add a sibling SSE fake in the same file. The fake must:GET /ssewithContent-Type: text/event-stream.endpointevent so the mark3labsmcp-goSSE client knows where to POST commands.POST /messages(or whatever endpoint the client requests) for outbound JSON-RPC requests, recording inbound headers per method (same recording shapefakeBackendalready has for streamable-http after PR Wire HeaderForward into vMCP per-session HTTP client #5301's second commit).event: message, data: {...}\n\nformat.Table-drive
TestHTTPSession_AppliesHeaderForwardToPostInitializeRequestsover both transport types so the regression is enforced for SSE as well as streamable-http. Each table row asserts the post-initialize request carries the configuredX-MCP-Toolsetsheader.Apply the same table-drive to the overlap-precedence and
AddHeadersFromSecretsubtests that PR Wire HeaderForward into vMCP per-session HTTP client #5301 added, so both subbranches get equivalent coverage.Out of scope
Acceptance criteria
pkg/vmcp/session/internal/backend/that can serve a fullinitialize→tools/list→tools/callhandshake to an mcp-go SSE client.headersFor(method)accessor).TestHTTPSession_AppliesHeaderForwardToPostInitializeRequestsruns as a table over both transports and passes for each.-race.Related: #5289, #5301, #5302.