Package io.modelcontextprotocol.common
Interface McpTransportContext
public interface McpTransportContext
Context associated with the transport layer. It allows to add transport-level metadata
for use further down the line. Specifically, it can be beneficial to extract HTTP
request metadata for use in MCP feature implementations.
- Author:
- Dariusz Jędrzejczyk
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final McpTransportContextAn empty, unmodifiable context.static final StringKey for use in Reactor Context to transport the context to user land. -
Method Summary
-
Field Details
-
KEY
Key for use in Reactor Context to transport the context to user land.- See Also:
-
EMPTY
An empty, unmodifiable context.
-
-
Method Details
-
create
Create an unmodifiable context containing the given metadata.- Parameters:
metadata- the transport metadata- Returns:
- the context containing the metadata
-
get
Extract a value from the context.- Parameters:
key- the key under the data is expected- Returns:
- the associated value or
nullif missing.
-