Skip to content

Commit 003bb33

Browse files
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.
1 parent e16fd35 commit 003bb33

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

docs/specification/draft/basic/transports.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ MCP endpoint.
141141
supported content type.
142142
3. The server **MUST** either return `Content-Type: text/event-stream` in response to
143143
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`).
145147
4. If the server initiates an SSE stream:
146148
- The server **MAY** send JSON-RPC _requests_ and _notifications_ on the stream.
147149
- These messages **SHOULD** be unrelated to any concurrently-running JSON-RPC
@@ -219,7 +221,9 @@ servers which want to establish stateful sessions:
219221
the client application) **SHOULD** send an HTTP DELETE to the MCP endpoint with the
220222
`MCP-Session-Id` header, to explicitly terminate the session.
221223
- 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
226+
it does support.
223227

224228
### Sequence Diagram
225229

0 commit comments

Comments
 (0)