feat(server): support sync stateless MCP primitive repositories#1034
Open
ultramancode wants to merge 1 commit into
Open
feat(server): support sync stateless MCP primitive repositories#1034ultramancode wants to merge 1 commit into
ultramancode wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds opt-in sync/stateless repository contracts for dynamic MCP server primitives:
tools, resources, prompts, and completions.
This is a narrower rework of #953 based on the design discussion in #578.
Motivation and Context
Some MCP servers need to expose different tools, resources, prompts, or completion
handlers depending on the authenticated user, tenant, token, headers, or other
request context.
This PR keeps the first repository shape narrow:
Mono<...>McpTransportContextMcpSchema.PaginatedRequestExchange-dependent flows such as sampling, elicitation, logging, and progress stay
on the existing handler API for now.
Design Notes
This PR follows the direction discussed in #578:
registrations remain available.
repository variants across the full server matrix.
stateless async core adapts calls internally using the existing
immediate-execution/offload model.
McpTransportContext, keeping the API focused on request-context based discoveryand execution.
configured together for the same primitive family.
How Has This Been Tested?
Added in-process stateless server tests for request-context based discovery and
resolution, completions, paginated list requests, runtime add/remove behavior, and
repository/static registration conflict validation.
I also tested the repository path locally with a small servlet server that resolves
primitives from request context.
Breaking Changes
None intended.
Existing static registration APIs continue to work. Repositories are opt-in and are
configured through the stateless sync server builder.
Types of changes
Checklist