modelcontextprotocol / modelcontextprotocol/java-sdk
Add Primitive repository APIs (`ResourceRepository`, `ToolsRepository`, ... )
未关闭
还没有人认领这个 Issue。
enhancement
feature/repositories
P3
- 主要语言
- Java
- 星标
- 3.7k
- 派生
- 1.1k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 9
描述
Currently, McpStatelessAsyncServer and McpAsyncServer save resources, tools, prompts, and completionswithCopyOnWriteArrayList`.
I want to provide an API (for example, ResourcesRepository) that, by default, uses the current in-memory strategy but can be replaced, for example, by a dynamic implementation that returns a different list of resources depending on the currently authenticated user.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 McpStatelessAsyncServer.java 和 McpAsyncServer.java 开始,尤其关注 issue 中引用的 CopyOnWriteArrayList 字段,并追踪资源、工具、提示和补全的存储与提供方式。定义 repository API 边界,同时保留当前的内存中行为并允许依赖用户的实现;完成标准是四个原始集合都使用可替换的 API,且不改变现有的服务器行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- backend-api-design
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100