@@ -24,9 +24,7 @@ In the **stdio** transport:
2424- The client launches the MCP server as a subprocess.
2525- The server reads JSON-RPC messages from its standard input (` stdin ` ) and sends messages
2626 to its standard output (` stdout ` ).
27- - Messages may be JSON-RPC requests, notifications, responses—or a JSON-RPC
28- [ batch] ( https://www.jsonrpc.org/specification#batch ) containing one or more requests
29- and/or notifications.
27+ - Messages are individual JSON-RPC requests, notifications, or responses.
3028- Messages are delimited by newlines, and ** MUST NOT** contain embedded newlines.
3129- The server ** MAY** write UTF-8 strings to its standard error (` stderr ` ) for logging
3230 purposes. Clients ** MAY** capture, forward, or ignore this logging.
@@ -85,35 +83,27 @@ MCP endpoint.
85831 . The client ** MUST** use HTTP POST to send JSON-RPC messages to the MCP endpoint.
86842 . The client ** MUST** include an ` Accept ` header, listing both ` application/json ` and
8785 ` text/event-stream ` as supported content types.
88- 3 . The body of the POST request ** MUST** be one of the following:
89- - A single JSON-RPC _ request_ , _ notification_ , or _ response_
90- - An array [ batching] ( https://www.jsonrpc.org/specification#batch ) one or more
91- _ requests and/or notifications_
92- - An array [ batching] ( https://www.jsonrpc.org/specification#batch ) one or more
93- _ responses_
94- 4 . If the input consists solely of (any number of) JSON-RPC _ responses_ or
95- _ notifications_ :
86+ 3 . The body of the POST request ** MUST** be a single JSON-RPC _ request_ , _ notification_ , or _ response_ .
87+ 4 . If the input is a JSON-RPC _ response_ or _ notification_ :
9688 - If the server accepts the input, the server ** MUST** return HTTP status code 202
9789 Accepted with no body.
9890 - If the server cannot accept the input, it ** MUST** return an HTTP error status code
9991 (e.g., 400 Bad Request). The HTTP response body ** MAY** comprise a JSON-RPC _ error
10092 response_ that has no ` id ` .
101- 5 . If the input contains any number of JSON-RPC _ requests _ , the server ** MUST** either
93+ 5 . If the input is a JSON-RPC _ request _ , the server ** MUST** either
10294 return ` Content-Type: text/event-stream ` , to initiate an SSE stream, or
10395 ` Content-Type: application/json ` , to return one JSON object. The client ** MUST**
10496 support both these cases.
105976 . If the server initiates an SSE stream:
106- - The SSE stream ** SHOULD** eventually include one JSON-RPC _ response_ per each
107- JSON-RPC _ request_ sent in the POST body. These _ responses_ ** MAY** be
108- [ batched] ( https://www.jsonrpc.org/specification#batch ) .
109- - The server ** MAY** send JSON-RPC _ requests_ and _ notifications_ before sending a
98+ - The SSE stream ** SHOULD** eventually include JSON-RPC _ response_ for the
99+ JSON-RPC _ request_ sent in the POST body.
100+ - The server ** MAY** send JSON-RPC _ requests_ and _ notifications_ before sending the
110101 JSON-RPC _ response_ . These messages ** SHOULD** relate to the originating client
111- _ request_ . These _ requests_ and _ notifications_ ** MAY** be
112- [ batched] ( https://www.jsonrpc.org/specification#batch ) .
113- - The server ** SHOULD NOT** close the SSE stream before sending a JSON-RPC _ response_
114- per each received JSON-RPC _ request_ , unless the [ session] ( #session-management )
102+ _ request_ .
103+ - The server ** SHOULD NOT** close the SSE stream before sending the JSON-RPC _ response_
104+ for the received JSON-RPC _ request_ , unless the [ session] ( #session-management )
115105 expires.
116- - After all JSON-RPC _ responses _ have been sent, the server ** SHOULD** close the SSE
106+ - After the JSON-RPC _ response _ has been sent, the server ** SHOULD** close the SSE
117107 stream.
118108 - Disconnection ** MAY** occur at any time (e.g., due to network conditions).
119109 Therefore:
@@ -133,9 +123,7 @@ MCP endpoint.
133123 this HTTP GET, or else return HTTP 405 Method Not Allowed, indicating that the server
134124 does not offer an SSE stream at this endpoint.
1351254 . If the server initiates an SSE stream:
136- - The server ** MAY** send JSON-RPC _ requests_ and _ notifications_ on the stream. These
137- _ requests_ and _ notifications_ ** MAY** be
138- [ batched] ( https://www.jsonrpc.org/specification#batch ) .
126+ - The server ** MAY** send JSON-RPC _ requests_ and _ notifications_ on the stream.
139127 - These messages ** SHOULD** be unrelated to any concurrently-running JSON-RPC
140128 _ request_ from the client.
141129 - The server ** MUST NOT** send a JSON-RPC _ response_ on the stream ** unless**
0 commit comments