Skip to content

Commit 4bb6101

Browse files
author
Zachary German
committed
Adding explicit HTTP 400 Bad Request guidance
1 parent 09998fe commit 4bb6101

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/specification/draft/basic/transports.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,19 @@ MCP endpoint.
9090
2. The client **MUST** include an `Accept` header, listing both `application/json` and
9191
`text/event-stream` as supported content types.
9292
3. The body of the POST request **MUST** be a single JSON-RPC _request_, _notification_, or _response_.
93-
4. If the input is a JSON-RPC _response_ or _notification_:
94-
- If the server accepts the input, the server **MUST** return HTTP status code 202
95-
Accepted with no body.
96-
- If the server cannot accept the input, it **MUST** return an HTTP error status code
97-
(e.g., 400 Bad Request). The HTTP response body **MAY** comprise a JSON-RPC _error
98-
response_ that has no `id`.
99-
5. If the input is a JSON-RPC _request_, the server **MUST** either
93+
4. If the server cannot accept the input, it **MUST** return an HTTP error status code
94+
(e.g., 400 Bad Request).
95+
- If the input is not accepted due to unmet `Accept` header or body requirements, the error
96+
**MUST** be of HTTP status code 400 Bad Request.
97+
- If the input is a JSON-RPC _response_ or _notification_, the HTTP response body
98+
**MAY** comprise a JSON-RPC _error response_ that has no `id`.
99+
5. If the input is a JSON-RPC _response_ or _notification_, the server **MUST** return
100+
HTTP status code 202 Accepted with no body.
101+
6. If the input is a JSON-RPC _request_, the server **MUST** either
100102
return `Content-Type: text/event-stream`, to initiate an SSE stream, or
101103
`Content-Type: application/json`, to return one JSON object. The client **MUST**
102104
support both these cases.
103-
6. If the server initiates an SSE stream:
105+
7. If the server initiates an SSE stream:
104106
- The SSE stream **SHOULD** eventually include JSON-RPC _response_ for the
105107
JSON-RPC _request_ sent in the POST body.
106108
- The server **MAY** send JSON-RPC _requests_ and _notifications_ before sending the

0 commit comments

Comments
 (0)