Skip to content

fix(gateway): reject GET requests to prevent SSE reconnection loop#2305

Open
vibegui wants to merge 1 commit intomainfrom
fix/gateway-sse-loop
Open

fix(gateway): reject GET requests to prevent SSE reconnection loop#2305
vibegui wants to merge 1 commit intomainfrom
fix/gateway-sse-loop

Conversation

@vibegui
Copy link
Contributor

@vibegui vibegui commented Jan 24, 2026

Virtual MCPs are stateless aggregators that create a new transport per request. For GET requests (SSE streaming), handleRequest returns after setting up the stream, but our finally block immediately closes the transport, terminating the connection. Clients then reconnect, creating an infinite loop.

By rejecting GET requests with a 405 and JSON-RPC error, clients fall back to POST-only mode which works correctly with our stateless model.


Summary by cubic

Reject GET requests on the virtual MCP gateway to stop the SSE reconnection loop with stateless transports. Returns 405 with a JSON-RPC error so clients fall back to POST-only mode.

Written for commit a55280b. Summary will update on new commits.

Virtual MCPs are stateless aggregators that create a new transport per
request. For GET requests (SSE streaming), handleRequest returns after
setting up the stream, but our finally block immediately closes the
transport, terminating the connection. Clients then reconnect, creating
an infinite loop.

By rejecting GET requests with a 405 and JSON-RPC error, clients fall
back to POST-only mode which works correctly with our stateless model.
@github-actions
Copy link
Contributor

🧪 Benchmark

Should we run the Virtual MCP strategy benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

@github-actions
Copy link
Contributor

Release Options

Should a new version be published when this PR is merged?

React with an emoji to vote on the release type:

Reaction Type Next Version
👍 Prerelease 2.41.1-alpha.1
🎉 Patch 2.41.1
❤️ Minor 2.42.0
🚀 Major 3.0.0

Current version: 2.41.0

Deployment

  • Deploy to production (triggers ArgoCD sync after Docker image is published)

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant