Package org.mcpjava.server
Interface McpRequest
- All Superinterfaces:
MetaCarrier
Provides information about the current request, including the request ID and the metadata fields.
Tool, Prompt, Resource, and ResourceTemplate methods can accept this interface as a parameter. It will be automatically injected by the framework implementation before the method is invoked.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mcpjava.server.MetaCarrier
MetaCarrier.Builder<THIS extends MetaCarrier.Builder<THIS>> -
Method Summary
Modifier and TypeMethodDescriptionGets the description of the client, as sent by the client itselfid()Gets the MCP protocol version in use for this requestGets the map of capabilities that the client supportsGets the session ID, if the request is part of a sessionMethods inherited from interface org.mcpjava.server.MetaCarrier
metadata
-
Method Details
-
id
Object id()- Returns:
- the request id
-
sessionId
Gets the session ID, if the request is part of a session- Returns:
- the session ID, or an empty
Optionalif the request is not associated with a session
-
protocolVersion
String protocolVersion()Gets the MCP protocol version in use for this request- Returns:
- the protocol version, e.g.
2025-11-25or2025-06-18
-
rawClientCapabilities
Gets the map of capabilities that the client supports- Returns:
- the raw map of supported capabilities reported by the client
-
clientInfo
ImplementationInfo clientInfo()Gets the description of the client, as sent by the client itself- Returns:
- the client information
-