Skip to content

Commit ef09329

Browse files
author
Zachary German
committed
Account for bypassing of initialization
1 parent 09998fe commit ef09329

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

docs/specification/draft/basic/lifecycle.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ sequenceDiagram
3939

4040
### Initialization
4141

42-
The initialization phase **MUST** be the first interaction between client and server.
42+
The initialization phase **SHOULD** be the first interaction between client and server.
43+
Bypassing initialization is appropriate when the client has prior knowledge of, and accounts for,
44+
the protocol versions, capabilities, and initialization bypass support of all servers it interacts with.
4345
During this phase, the client and server:
4446

4547
- Establish protocol version compatibility

docs/specification/draft/basic/transports.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,10 @@ act as a cursor within that particular stream.
172172
### Session Management
173173

174174
An MCP "session" consists of logically related interactions between a client and a
175-
server, beginning with the [initialization phase](/specification/draft/basic/lifecycle). To support
176-
servers which want to establish stateful sessions:
175+
server. To support servers which want to establish stateful sessions:
177176

178-
1. A server using the Streamable HTTP transport **MAY** assign a session ID at
179-
initialization time, by including it in an `Mcp-Session-Id` header on the HTTP
180-
response containing the `InitializeResult`.
177+
1. A server using the Streamable HTTP transport **MAY** assign a session ID by including
178+
it in an `Mcp-Session-Id` header on any HTTP response.
181179
- The session ID **SHOULD** be globally unique and cryptographically secure (e.g., a
182180
securely generated UUID, a JWT, or a cryptographic hash).
183181
- The session ID **MUST** only contain visible ASCII characters (ranging from 0x21 to
@@ -190,7 +188,8 @@ servers which want to establish stateful sessions:
190188
3. The server **MAY** terminate the session at any time, after which it **MUST** respond
191189
to requests containing that session ID with HTTP 404 Not Found.
192190
4. When a client receives HTTP 404 in response to a request containing an
193-
`Mcp-Session-Id`, it **MUST** start a new session by sending a new `InitializeRequest`
191+
`Mcp-Session-Id` obtained through an [initialization phase](/specification/draft/basic/lifecycle),
192+
it **SHOULD** start a new session by sending a new `InitializeRequest`
194193
without a session ID attached.
195194
5. Clients that no longer need a particular session (e.g., because the user is leaving
196195
the client application) **SHOULD** send an HTTP DELETE to the MCP endpoint with the

0 commit comments

Comments
 (0)