Discussion: HTTP redirect method preservation in stateful MCP server deployments #2796
Replies: 1 comment
-
|
We've been running a public MCP server for 7 days and just published a detailed write-up of all 10 autonomous client architectures we observed — directly relevant to the lifecycle contract gap this issue describes. Short version of what we found: Every client navigated The most impactful mitigations we identified (from real production behavior, not hypotheticals):
Full write-up (raw log traces, not aggregated): https://cryptogenesis.duckdns.org/blog/2026-05-20-ten-mcp-clients-field-notes The SECOND_IMPLEMENTATION.md in our repo documents each architecture in detail if useful for the spec discussion: https://github.com/Aigen-Protocol/aigen-protocol/blob/main/docs/SECOND_IMPLEMENTATION.md Happy to share raw nginx log excerpts if useful for the spec group. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Stateful MCP endpoints (streamable HTTP transport) receive a
POST /mcpwith theinitializebody. If the server is behind a reverse proxy that redirectshttp://tohttps://via 301 Moved Permanently, the client may legally convert the POST to a GET on the redirected URL — per RFC 7231 §6.4.2 ("a user agent MAY change the request method from POST to GET for the subsequent request").The MCP server then receives a bodyless GET, returns 400, and the client has no clear signal about why the session failed. This is a silent compatibility gap.
Empirical observation
Over five days of operating a public MCP server, I catalogued eight independent client implementations connecting from the wild. Two of them fail exclusively at the HTTP→HTTPS redirect step:
MCP-Client/1.0) that issuesPOST http://…/mcp, receives301 → https://…/mcp, follows it asGET, gets400, loops indefinitely through path discovery, reads the homepage as a fallback discovery step, and restarts.Both clients issue a correctly-formed MCP
initializebody when reaching the HTTPS URL directly. The redirect is the only failure point.Proposed recommendation
The spec (or a deployment best-practices note) could note:
Server operator fix (nginx):
This is a one-line configuration change that eliminates the silent failure for a class of correct clients.
Questions for the working group
Linkheader or discovery hint so clients know to switch to HTTPS before the redirect?Happy to open a PR with a specific text proposal if there's interest.
Data source: production observation log at https://github.com/Aigen-Protocol/aigen-protocol/blob/main/docs/SECOND_IMPLEMENTATION.md — eight client architectures with failure modes.
Beta Was this translation helpful? Give feedback.
All reactions