Skip to content

Commit 4736c2e

Browse files
committed
2 parents 544c376 + 9ecf98e commit 4736c2e

File tree

15 files changed

+1409
-694
lines changed

15 files changed

+1409
-694
lines changed

docs/specification/2025-06-18/schema.mdx

Lines changed: 239 additions & 207 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/specification/draft/basic/transports.mdx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,26 @@ MCP endpoint.
103103
`Content-Type: application/json`, to return one JSON object. The client **MUST**
104104
support both these cases.
105105
6. If the server initiates an SSE stream:
106-
- The SSE stream **SHOULD** eventually include JSON-RPC _response_ for the
106+
- The server **SHOULD** immediately send an SSE event consisting of an event
107+
ID and an empty `data` field in order to prime the client to reconnect
108+
(using that event ID as `Last-Event-ID`).
109+
- After the server has sent an SSE event with an event ID to the client, the
110+
server **MAY** close the _connection_ (without terminating the _SSE stream_)
111+
at any time in order to avoid holding a long-lived connection. The client
112+
**SHOULD** then "poll" the SSE stream by attempting to reconnect.
113+
- If the server does close the _connection_ prior to terminating the _SSE stream_,
114+
it **SHOULD** send an SSE event with a standard `retry` field before
115+
closing the connection. The client **MUST** respect the `retry` field,
116+
waiting the given number of milliseconds before attempting to reconnect.
117+
- The SSE stream **SHOULD** eventually include a JSON-RPC _response_ for the
107118
JSON-RPC _request_ sent in the POST body.
108119
- The server **MAY** send JSON-RPC _requests_ and _notifications_ before sending the
109120
JSON-RPC _response_. These messages **SHOULD** relate to the originating client
110121
_request_.
111-
- The server **SHOULD NOT** close the SSE stream before sending the JSON-RPC _response_
112-
for the received JSON-RPC _request_, unless the [session](#session-management)
122+
- The server **MAY** terminate the SSE stream if the [session](#session-management)
113123
expires.
114-
- After the JSON-RPC _response_ has been sent, the server **SHOULD** close the SSE
115-
stream.
124+
- After the JSON-RPC _response_ has been sent, the server **SHOULD** terminate the
125+
SSE stream.
116126
- Disconnection **MAY** occur at any time (e.g., due to network conditions).
117127
Therefore:
118128
- Disconnection **SHOULD NOT** be interpreted as the client cancelling its request.

docs/specification/draft/changelog.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ the previous revision, [2025-06-18](/specification/2025-06-18).
2121
1. Clarify that servers must respond with HTTP 403 Forbidden for invalid Origin headers in Streamable HTTP transport. (PR [#1439](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1439))
2222
2. Updated the [Security Best Practices guidance](https://modelcontextprotocol.io/specification/draft/basic/security_best_practices).
2323
3. Clarify that input validation errors should be returned as Tool Execution Errors rather than Protocol Errors to enable model self-correction ([SEP-1303](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1303)).
24+
4. Support polling SSE streams by allowing servers to disconnect at will ([SEP-1699](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1699)).
2425

2526
## Other schema changes
2627

docs/specification/draft/schema.mdx

Lines changed: 341 additions & 311 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
"check:schema": "npm run check:schema:ts && npm run check:schema:json && npm run check:schema:md",
2626
"check:schema:ts": "tsc --noEmit && eslint schema/ && prettier --check \"schema/**/*.ts\"",
2727
"check:schema:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" | cat | cmp \"${f%.ts}.json\" - || exit 1; done",
28-
"check:schema:md": "for f in docs/specification/*/schema.mdx; do typedoc --entryPoints \"schema/$(basename -- $(dirname -- \"$f\"))/schema.ts\" | cmp \"$f\" - || exit 1; done",
28+
"check:schema:md": "for f in schema/*/schema.mdx; do typedoc --entryPoints \"${f%.mdx}.ts\" --schemaPageTemplate \"$f\" | cmp docs/specification/$(basename -- $(dirname -- \"$f\"))/schema.mdx - || exit 1; done",
2929
"check:docs": "npm run check:docs:format && npm run check:docs:links",
3030
"check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
3131
"check:docs:links": "cd docs && npx mint broken-links",
3232
"generate:schema": "npm run generate:schema:json && npm run generate:schema:md",
3333
"generate:schema:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" -o \"${f%.ts}.json\"; done",
34-
"generate:schema:md": "for f in docs/specification/*/schema.mdx; do typedoc --entryPoints \"schema/$(basename -- $(dirname -- \"$f\"))/schema.ts\" > \"$f\"; done",
34+
"generate:schema:md": "for f in schema/*/schema.mdx; do typedoc --entryPoints \"${f%.mdx}.ts\" --schemaPageTemplate \"$f\" > docs/specification/$(basename -- $(dirname -- \"$f\"))/schema.mdx; done",
3535
"format": "prettier --write \"**/*.{md,mdx}\" --ignore \"docs/specification/*/schema.mdx\" ",
3636
"serve:docs": "cd docs && npx mint dev",
3737
"serve:blog": "cd blog && hugo serve"
@@ -45,7 +45,7 @@
4545
"glob": "^11.0.0",
4646
"prettier": "^3.6.2",
4747
"tsx": "^4.19.1",
48-
"typedoc": "^0.28.7",
48+
"typedoc": "^0.28.14",
4949
"typescript": "^5.6.2",
5050
"typescript-eslint": "^8.0.0",
5151
"typescript-json-schema": "^0.65.1"

schema/2025-06-18/schema.mdx

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: Schema Reference
3+
---
4+
5+
<div id="schema-reference" />
6+
7+
## JSON-RPC
8+
9+
{/* @category JSON-RPC */}
10+
11+
## Common Types
12+
13+
{/* @category Common Types */}
14+
15+
## Content
16+
17+
{/* @category Content */}
18+
19+
## `completion/complete`
20+
21+
{/* @category `completion/complete` */}
22+
23+
## `elicitation/create`
24+
25+
{/* @category `elicitation/create` */}
26+
27+
## `initialize`
28+
29+
{/* @category `initialize` */}
30+
31+
## `logging/setLevel`
32+
33+
{/* @category `logging/setLevel` */}
34+
35+
## `notifications/cancelled`
36+
37+
{/* @category `notifications/cancelled` */}
38+
39+
## `notifications/initialized`
40+
41+
{/* @category `notifications/initialized` */}
42+
43+
## `notifications/message`
44+
45+
{/* @category `notifications/message` */}
46+
47+
## `notifications/progress`
48+
49+
{/* @category `notifications/progress` */}
50+
51+
## `notifications/prompts/list_changed`
52+
53+
{/* @category `notifications/prompts/list_changed` */}
54+
55+
## `notifications/resources/list_changed`
56+
57+
{/* @category `notifications/resources/list_changed` */}
58+
59+
## `notifications/resources/updated`
60+
61+
{/* @category `notifications/resources/updated` */}
62+
63+
## `notifications/roots/list_changed`
64+
65+
{/* @category `notifications/roots/list_changed` */}
66+
67+
## `notifications/tools/list_changed`
68+
69+
{/* @category `notifications/tools/list_changed` */}
70+
71+
## `ping`
72+
73+
{/* @category `ping` */}
74+
75+
## `prompts/get`
76+
77+
{/* @category `prompts/get` */}
78+
79+
## `prompts/list`
80+
81+
{/* @category `prompts/list` */}
82+
83+
## `resources/list`
84+
85+
{/* @category `resources/list` */}
86+
87+
## `resources/read`
88+
89+
{/* @category `resources/read` */}
90+
91+
## `resources/subscribe`
92+
93+
{/* @category `resources/subscribe` */}
94+
95+
## `resources/templates/list`
96+
97+
{/* @category `resources/templates/list` */}
98+
99+
## `resources/unsubscribe`
100+
101+
{/* @category `resources/unsubscribe` */}
102+
103+
## `roots/list`
104+
105+
{/* @category `roots/list` */}
106+
107+
## `sampling/createMessage`
108+
109+
{/* @category `sampling/createMessage` */}
110+
111+
## `tools/call`
112+
113+
{/* @category `tools/call` */}
114+
115+
## `tools/list`
116+
117+
{/* @category `tools/list` */}

0 commit comments

Comments
 (0)