Package io.modelcontextprotocol.server
Interface McpTransportContextExtractor<T>
- Type Parameters:
T- transport-specific representation of the request which allows extracting metadata for use in the MCP features implementations.
public interface McpTransportContextExtractor<T>
The contract for extracting metadata from a generic transport request of type
McpTransportContextExtractor.- Author:
- Dariusz Jędrzejczyk
-
Method Summary
Modifier and TypeMethodDescriptionextract(T request, McpTransportContext transportContext) Given an empty context, provides the means to fill it with transport-specific metadata extracted from the request.
-
Method Details
-
extract
Given an empty context, provides the means to fill it with transport-specific metadata extracted from the request.- Parameters:
request- the generic representation for the request in the context of a specific transport implementationtransportContext- the mutable context which can be filled in with metadata- Returns:
- the context filled in with metadata. It can be the same instance as provided or a new one.
-