modelcontextprotocol / modelcontextprotocol/java-sdk

Add Primitive repository APIs (`ResourceRepository`, `ToolsRepository`, ... )

Open
#578 20 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature/repositories P3
Dominant language
Java
Stars
3.7k
Forks
1.1k
Avg merge
1d 15h
Merged PRs (30d)
9

Description

Currently, McpStatelessAsyncServer and McpAsyncServer save resources, tools, prompts, and completionswithCopyOnWriteArrayList`.

https://github.com/modelcontextprotocol/java-sdk/blob/main/mcp-core/src/main/java/io/modelcontextprotocol/server/McpStatelessAsyncServer.java#L60-L68

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.

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with McpStatelessAsyncServer.java and McpAsyncServer.java, especially the CopyOnWriteArrayList fields referenced in the issue, and trace how resources, tools, prompts, and completions are stored and served. Define the repository API boundary while preserving the current in-memory behavior and allowing user-dependent implementations; done means all four primitive collections use the replaceable APIs without changing existing server behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.