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
docs(spec): clarify Allow header requirement for 405 responses
HTTP gateways (such as Apigee) enforce strict RFC compliance and may reject 405 responses that lack an Allow header, returning 502 Bad Gateway errors to clients. Making this requirement explicit in the MCP specification ensures SDK implementers include the header and avoid interoperability issues with enterprise infrastructure.
Copy file name to clipboardExpand all lines: docs/specification/draft/basic/transports.mdx
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,9 @@ MCP endpoint.
141
141
supported content type.
142
142
3. The server **MUST** either return `Content-Type: text/event-stream` in response to
143
143
this HTTP GET, or else return HTTP 405 Method Not Allowed, indicating that the server
144
-
does not offer an SSE stream at this endpoint.
144
+
does not offer an SSE stream at this endpoint. Per [RFC 9110 §15.5.6](https://httpwg.org/specs/rfc9110.html#status.405), if the server returns HTTP 405, it
145
+
**MUST** include an `Allow` header listing the methods it does support (e.g.,
146
+
`Allow: POST`).
145
147
4. If the server initiates an SSE stream:
146
148
- The server **MAY** send JSON-RPC _requests_ and _notifications_ on the stream.
147
149
- These messages **SHOULD** be unrelated to any concurrently-running JSON-RPC
@@ -219,7 +221,9 @@ servers which want to establish stateful sessions:
219
221
the client application) **SHOULD** send an HTTP DELETE to the MCP endpoint with the
220
222
`MCP-Session-Id` header, to explicitly terminate the session.
221
223
- The server **MAY** respond to this request with HTTP 405 Method Not Allowed,
222
-
indicating that the server does not allow clients to terminate sessions.
224
+
indicating that the server does not allow clients to terminate sessions. If the
225
+
server returns HTTP 405, it **MUST** include an `Allow` header listing the methods
0 commit comments