-
Notifications
You must be signed in to change notification settings - Fork 1.6k
SEP-1372: Clarifying Semantics of Behavior Without Initialization #1372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d54a81c
8cd6446
2d8b382
a334963
abd6891
542e4c6
5ace833
ab6f0b3
8341818
56c841a
9ef44f9
99f3ec1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -186,14 +186,14 @@ servers which want to establish stateful sessions: | |||||||||
| 0x7E). | ||||||||||
| 2. If an `Mcp-Session-Id` is returned by the server during initialization, clients using | ||||||||||
| the Streamable HTTP transport **MUST** include it in the `Mcp-Session-Id` header on | ||||||||||
| all of their subsequent HTTP requests. | ||||||||||
| all of their subsequent HTTP requests meant for that session. | ||||||||||
| - Servers that require a session ID **SHOULD** respond to requests without an | ||||||||||
| `Mcp-Session-Id` header (other than initialization) with HTTP 400 Bad Request. | ||||||||||
| 3. The server **MAY** terminate the session at any time, after which it **MUST** respond | ||||||||||
| to requests containing that session ID with HTTP 404 Not Found. | ||||||||||
| 4. When a client receives HTTP 404 in response to a request containing an | ||||||||||
| `Mcp-Session-Id`, it **MUST** start a new session by sending a new `InitializeRequest` | ||||||||||
| without a session ID attached. | ||||||||||
| 4. When a client receives HTTP 404 in response to a request containing an `Mcp-Session-Id`, | ||||||||||
| it **MUST** stop using that `Mcp-Sesssion-Id` and **SHOULD** start a new session by | ||||||||||
| sending a new `InitializeRequest` without a session ID attached. | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current spec only allows sessions to be established by InitializeRequest, and we should not expand that in this PR (I'm backing out changes that allowed this).
Comment on lines
+195
to
+196
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ZachGerman @simonrussell what do you think of this revision?
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that's quite right because the client can't start a new session, it can only stop using a previous session. I think it needs to be more along the lines of "sending a new request without a session ID attached"
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on client's not really "starting" sessions, but "utilizing" them when an ID is offered by the server, which is being done either through initialization or by sending a request without a session ID attached. Maybe something like: |
||||||||||
| 5. Clients that no longer need a particular session (e.g., because the user is leaving | ||||||||||
| the client application) **SHOULD** send an HTTP DELETE to the MCP endpoint with the | ||||||||||
| `Mcp-Session-Id` header, to explicitly terminate the session. | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.