Skip to content

Conversation

@chulkilee
Copy link
Contributor

Fixes #91

@hardikmodi1
Copy link

Looks like elicitation also requires stateful server. Can someone please confirm if that is the case or not? If yes, can we please merge this?

@quuu
Copy link
Collaborator

quuu commented Jan 3, 2026

@chulkilee this works, but just as an FYI this library was meant for serverless environments

Where are you deploying your MCP server that you'd be able to use stateful session ID's?

(open to merging this, just would love some more context)

I don't want to give people the impression that if they add a sessionIdGenerator, and they deploy to Vercel/workers/etc - that it'll work

@chulkilee
Copy link
Contributor Author

@quuu Using this library in a serverless environment (e.g. Vercel) doesn't mean inherently it cannot (or should not) support stateful sessions. Allowing users of this library to specify a session id would enable them to handle stateful operation in their own code.

I'm aware of a few limitation of the MCP Typescript SDK v1 around stateful session handling (e.g. relying on in-memory data), and that MCP is exploring different stateless support mechanisms (blog). But at this point this PR is a minimal change that simply exposes the session identifier to tool callbacks.

@quuu quuu merged commit 8c51d39 into vercel:main Jan 6, 2026
1 check passed
@chulkilee chulkilee deleted the sessionIdGenerator branch January 6, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session ID support?

3 participants