@@ -24,9 +24,7 @@ In the **stdio** transport:
24
24
- The client launches the MCP server as a subprocess.
25
25
- The server reads JSON-RPC messages from its standard input (` stdin ` ) and sends messages
26
26
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.
30
28
- Messages are delimited by newlines, and ** MUST NOT** contain embedded newlines.
31
29
- The server ** MAY** write UTF-8 strings to its standard error (` stderr ` ) for logging
32
30
purposes. Clients ** MAY** capture, forward, or ignore this logging.
@@ -85,35 +83,27 @@ MCP endpoint.
85
83
1 . The client ** MUST** use HTTP POST to send JSON-RPC messages to the MCP endpoint.
86
84
2 . The client ** MUST** include an ` Accept ` header, listing both ` application/json ` and
87
85
` 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_ :
96
88
- If the server accepts the input, the server ** MUST** return HTTP status code 202
97
89
Accepted with no body.
98
90
- If the server cannot accept the input, it ** MUST** return an HTTP error status code
99
91
(e.g., 400 Bad Request). The HTTP response body ** MAY** comprise a JSON-RPC _ error
100
92
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
102
94
return ` Content-Type: text/event-stream ` , to initiate an SSE stream, or
103
95
` Content-Type: application/json ` , to return one JSON object. The client ** MUST**
104
96
support both these cases.
105
97
6 . 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
110
101
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 )
115
105
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
117
107
stream.
118
108
- Disconnection ** MAY** occur at any time (e.g., due to network conditions).
119
109
Therefore:
@@ -133,9 +123,7 @@ MCP endpoint.
133
123
this HTTP GET, or else return HTTP 405 Method Not Allowed, indicating that the server
134
124
does not offer an SSE stream at this endpoint.
135
125
4 . 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.
139
127
- These messages ** SHOULD** be unrelated to any concurrently-running JSON-RPC
140
128
_ request_ from the client.
141
129
- The server ** MUST NOT** send a JSON-RPC _ response_ on the stream ** unless**
0 commit comments