-
Notifications
You must be signed in to change notification settings - Fork 587
Make "Stateless" mode sessionless #760
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
Conversation
- This removes the requirement to configure data protection which is the motivating reason for this change - This means that McpServer.ClientInfo will always be null in stateless mode
322d89b to
a3b519b
Compare
tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStreamableHttpTests.cs
Show resolved
Hide resolved
# Conflicts: # src/ModelContextProtocol.AspNetCore/StreamableHttpHandler.cs # src/ModelContextProtocol.Core/Server/McpServerExtensions.cs
|
@halter73 our MCP server is a remote stateless server, and logging client info is very important to us. With this change, we found it impossible to know the origin client where a tool call comes from. Is there a reason why we stopped encoding client info into session id in stateless mode? Any workaround you can recommend? The reason we chose stateless mode is that we deploy to multi-instance azure app service and we don't have a good session affinity solution. Any suggestion on that? If we can use stateful mode we will be happy to do so. //cc @mikekistler |
We could also consider removing
McpServerOptions.KnownClientInfoandStreamableHttpServerTransport.OnInitRequestReceivedsince the StreamableHttpHandler no longer uses them, but they still could be useful to people trying to use StreamableHttpServerTransport directly.I'll be on vacation the next two weeks. If someone wants to go ahead and merge this before I get back, that's fine by me. Otherwise, I'll address any feedback once I'm back from vacation.
Fixes #682