spring-projects / spring-projects/spring-ai
Metadata injection in tool calls
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 5
Description
Here's the translation of your technical proposal for Spring optimization:
When MCP invokes tools, can we add a metadata injection mechanism? The workflow would be:
User login → Authentication service returns tenantId → Store in MCP context
Tools automatically carry tenantId during invocation
Data queries perform tenant permission filtering using tenantId to prevent unauthorized access
MCP should enforce these verifications before tool execution:
Client requests must carry tenantId metadata (Item 6)
Server must validate the ownership relationship between user session and tenantId (Item 1)
Tools can only access resources within the tenantId's authorized scope
This proposal clearly outlines a multi-tenant security pattern using tenant isolation. You might want to reference Spring Security's existing tenant isolation capabilities and Spring Cloud Context's property propagation mechanisms when submitting this to Spring. Would you like me to help format this as an official Spring Enhancement Proposal (SEP) template?
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
Review the MCP tool invocation path and the existing authentication or context handling first. Compare the proposal with Spring Security tenant isolation and Spring Cloud Context property propagation, then verify that tenant metadata is validated against the user session and restricted to authorized resources before tool execution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, authorization, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100