spring-projects / spring-projects/spring-ai

please support parameter injection for things like `java.security.Principal` in `@McpTool` and `@Tool` handlers

Open
#5,375 1 comment 0 reactions 2 assignees View on GitHub

@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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.