Skip to content

Commit 60dbfcd

Browse files
committed
Move session ID entirely out of band
1 parent 29fcf7e commit 60dbfcd

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

docs/specification/draft/basic/transports.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,15 @@ server, beginning with the [initialization phase]({{< ref "lifecycle" >}}). To s
160160
servers which want to establish stateful sessions:
161161

162162
1. A server using the Streamable HTTP transport **MAY** assign a session ID at
163-
initialization time, by including it in the `sessionId` field of the
164-
`InitializeResult`.
163+
initialization time, by including it in an `Mcp-Session-Id` header on the HTTP
164+
response containing the `InitializeResult`.
165165
- The session ID **SHOULD** be globally unique and cryptographically secure (e.g., a
166166
securely generated UUID, a JWT, or a cryptographic hash).
167-
- The session ID **MUST** only contain visible ASCII characters.
168-
2. If a `sessionId` is returned in the `InitializeResult`, clients using the Streamable
169-
HTTP transport **MUST** include it in the `Mcp-Session-Id` header on all of their
170-
subsequent HTTP requests.
167+
- The session ID **MUST** only contain visible ASCII characters (ranging from 0x21 to
168+
0x7E).
169+
2. If an `Mcp-Session-Id` is returned by the server during initialization, clients using
170+
the Streamable HTTP transport **MUST** include it in the `Mcp-Session-Id` header on
171+
all of their subsequent HTTP requests.
171172
- Servers that require a session ID **SHOULD** respond to requests without an
172173
`Mcp-Session-Id` header (other than initialization) with HTTP 400 Bad Request.
173174
3. The server **MAY** terminate the session at any time, after which it **MUST** respond

schema/draft/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,6 @@
651651
},
652652
"serverInfo": {
653653
"$ref": "#/definitions/Implementation"
654-
},
655-
"sessionId": {
656-
"description": "A session ID, if the server assigns one. This can be used to implement\nresumable sessions; for an example, see the Streamable HTTP transport.\n\nThis string must only contain visible ASCII characters (ranging from 0x21 to 0x7E).",
657-
"pattern": "^[\\x21-\\x7E]+$",
658-
"type": "string"
659654
}
660655
},
661656
"required": [

schema/draft/schema.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,6 @@ export interface InitializeResult extends Result {
168168
capabilities: ServerCapabilities;
169169
serverInfo: Implementation;
170170

171-
/**
172-
* A session ID, if the server assigns one. This can be used to implement
173-
* resumable sessions; for an example, see the Streamable HTTP transport.
174-
*
175-
* This string must only contain visible ASCII characters (ranging from 0x21 to 0x7E).
176-
*
177-
* @TJS-pattern ^[\x21-\x7E]+$
178-
*/
179-
sessionId?: string;
180-
181171
/**
182172
* Instructions describing how to use the server and its features.
183173
*

0 commit comments

Comments
 (0)