Skip to content

Add putAll(Map) to McpTransportContext - #1288

Open
chemicL wants to merge 1 commit into
mainfrom
transport-context-merge-overlay
Open

chemicL wants to merge 1 commit into
mainfrom
transport-context-merge-overlay

Conversation

@chemicL

@chemicL chemicL commented Oct 27, 2026

Copy link
Copy Markdown
Member

Transports need to add their own keys to the context a user-provided extractor built, for instance the decoded Mcp-Param-* headers:

  • the provided keys take precedence over the user-extracted ones
  • neither the user's context nor the map is modified
  • custom McpTransportContext implementations keep working unchanged

Contexts created via McpTransportContext.create are merged into a single map. Other implementations are wrapped once, and further merges combine into a single wrapper rather than adding layers.

This is an alternative implementation to #1285

Transports need to add their own keys to the context a user-provided
extractor built, for instance the decoded Mcp-Param-* headers:

- the provided keys take precedence over the user-extracted ones
- neither the user's context nor the map is modified
- custom McpTransportContext implementations keep working unchanged

Contexts created via McpTransportContext.create are merged into a single
map. Other implementations are wrapped once, and further merges combine
into a single wrapper rather than adding layers.

Signed-off-by: Dariusz Jedrzejczyk <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/server enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant