modelcontextprotocol / modelcontextprotocol/java-sdk
Add ability to intercept tool call executions.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.1k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 9
Description
https://github.com/modelcontextprotocol/java-sdk/blob/082444e18f1cb9269bcc7a3ecb6ec860e0159d1b/mcp-spring/mcp-spring-webmvc/src/main/java/io/modelcontextprotocol/server/transport/WebMvcSseServerTransportProvider.java#L328
I want to add interceptors for MCP tool, but I don't know how to add them.If I want to get something from request'body, I can't get them through this contextExtractor for the body stream can only be read once.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at mcp-spring/mcp-spring-webmvc/src/main/java/io/modelcontextprotocol/server/transport/WebMvcSseServerTransportProvider.java around line 328. Trace how contextExtractor receives the request and how the body stream is consumed, then clarify the expected interceptor timing and body-access behavior with maintainers. Done means tool call executions can be intercepted without losing the required request context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100