Skip to content

Feature/distributed session storage#1048

Open
galm1007 wants to merge 3 commits into
modelcontextprotocol:mainfrom
galm1007:feature/distributed-session-storage
Open

Feature/distributed session storage#1048
galm1007 wants to merge 3 commits into
modelcontextprotocol:mainfrom
galm1007:feature/distributed-session-storage

Conversation

@galm1007

Copy link
Copy Markdown

These are the exact changes in vlin529's PR

I have simply resolved the conflict to allow to merge after approval.

shandaWWL and others added 3 commits April 10, 2026 01:24
Introduce a `McpSessionStore` interface that abstracts session storage,
enabling custom implementations (e.g., Redis, JDBC) for distributed and
multi-instance MCP server deployments.

Changes:
- Add `McpSessionStore` interface with save/get/remove/values/clear ops
- Add `InMemoryMcpSessionStore` as the default ConcurrentHashMap-backed
  implementation (preserving existing behavior)
- Refactor `HttpServletStreamableServerTransportProvider` to use
  `McpSessionStore` instead of a hardcoded ConcurrentHashMap
- Add `sessionStore()` method to the Builder for custom store injection
- Default to `InMemoryMcpSessionStore` when no custom store is provided

This is a non-breaking change: existing code continues to work without
modification as the default in-memory store is used automatically.

Closes modelcontextprotocol#274
Relates to modelcontextprotocol#107, modelcontextprotocol#738, modelcontextprotocol#376
# Conflicts:
#	mcp-core/src/main/java/io/modelcontextprotocol/server/transport/HttpServletStreamableServerTransportProvider.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants