Enable stateless mode for MCP HTTP transport - #64
Merged
Aaronontheweb merged 1 commit intoOct 10, 2025
Conversation
Configure the MCP server to use stateless mode by setting options.Stateless = true in WithHttpTransport(). This eliminates session management issues that cause "Session not found" errors when the server restarts or clients reconnect. Benefits: - No session IDs required - each request is independent - No Data Protection key management needed - Survives server restarts without breaking client connections - Works across multiple server instances without session affinity Trade-off: McpServer.ClientInfo will be null as client metadata is not tracked across requests in stateless mode. Resolves connection issues with MCP clients including Claude Code.
Aaronontheweb
added a commit
to Aaronontheweb/memorizer-v1
that referenced
this pull request
Oct 10, 2025
Add PR petabridge#64 (Enable stateless mode for MCP HTTP transport) to the 1.7.1 release notes under Bug Fixes section. This fix resolves "Session not found" errors experienced by MCP clients when reconnecting or after server restarts. Updates both RELEASE_NOTES.md and Directory.Build.props with the new bug fix entry.
Aaronontheweb
added a commit
that referenced
this pull request
Oct 10, 2025
* Enable stateless mode for MCP HTTP transport Configure the MCP server to use stateless mode by setting options.Stateless = true in WithHttpTransport(). This eliminates session management issues that cause "Session not found" errors when the server restarts or clients reconnect. Benefits: - No session IDs required - each request is independent - No Data Protection key management needed - Survives server restarts without breaking client connections - Works across multiple server instances without session affinity Trade-off: McpServer.ClientInfo will be null as client metadata is not tracked across requests in stateless mode. Resolves connection issues with MCP clients including Claude Code. * Update release notes with stateless mode fix Add PR #64 (Enable stateless mode for MCP HTTP transport) to the 1.7.1 release notes under Bug Fixes section. This fix resolves "Session not found" errors experienced by MCP clients when reconnecting or after server restarts. Updates both RELEASE_NOTES.md and Directory.Build.props with the new bug fix entry.
Aaronontheweb
added a commit
that referenced
this pull request
Oct 10, 2025
* Prepare release 1.7.1 * Update release notes with stateless mode fix (#65) * Enable stateless mode for MCP HTTP transport Configure the MCP server to use stateless mode by setting options.Stateless = true in WithHttpTransport(). This eliminates session management issues that cause "Session not found" errors when the server restarts or clients reconnect. Benefits: - No session IDs required - each request is independent - No Data Protection key management needed - Survives server restarts without breaking client connections - Works across multiple server instances without session affinity Trade-off: McpServer.ClientInfo will be null as client metadata is not tracked across requests in stateless mode. Resolves connection issues with MCP clients including Claude Code. * Update release notes with stateless mode fix Add PR #64 (Enable stateless mode for MCP HTTP transport) to the 1.7.1 release notes under Bug Fixes section. This fix resolves "Session not found" errors experienced by MCP clients when reconnecting or after server restarts. Updates both RELEASE_NOTES.md and Directory.Build.props with the new bug fix entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables stateless mode for the MCP HTTP transport to eliminate session management issues causing "Session not found" errors when clients reconnect or the server restarts.
Changes
WithHttpTransport()to useoptions.Stateless = trueBenefits
Trade-offs
McpServer.ClientInfowill benullin request handlers (client name/version not tracked)Testing
This resolves the "Session not found" (HTTP 404) errors when using MCP clients like Claude Code with the v1.7.1-beta1 release.
Related