modelcontextprotocol / modelcontextprotocol/java-sdk
I would like to maintain MCP server state persisted (sessionId)
未关闭
还没有人认领这个 Issue。
enhancement
feature/session-storage
P2
- 主要语言
- Java
- 星标
- 3.7k
- 派生
- 1.1k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 9
描述
Now the session id is maintained in memory in a map. But since I have my MCP server multiple pods running, I would like the state to be persisted in redis or in a DB.
I would like to override the session Validator as a parameter in the HttpServletStreamableServerTransportProvider
Current Behavior
Currently only the session creation can be customised but not maintaining the state fully.
Context
I am not able to implement stateful session in a distributed setup
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 HttpServletStreamableServerTransportProvider 开始,检查会话创建、验证以及内存中的会话映射是如何处理的。定义一个用于自定义会话验证和持久化的扩展点,使其能够跨多个 pod 工作,并以 Redis 或数据库为目标;当有状态会话不再依赖单个进程时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, redis
- 领域
- backend, distributed-systems
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100