spring-projects / spring-projects/spring-ai
please support parameter injection for things like `java.security.Principal` in `@McpTool` and `@Tool` handlers
Open
@tzolov is already working on this.
Since Feb 5, 2026.
mcp
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
please support parameter injection for things like java.security.Principal in @McpTool and @Tool handlers, sort of like is possible ein Spring MVC.
i dont know if there's a pluggable parameter resolver mechanism. might be useful to write an adapter for the existing Spring MVC / WebFlux resolvers, if theyre on the classpath, maybe? (not sure if that's technially feasible, but there are a lot of resolvers for Spring MVC for things like java.security.Principal, @AuthenticatedPrincipal User user, etc.
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.
Assessment
This issue has not been assessed yet.