Package io.micronaut.mcp.http.server
Record Class McpHttpRequest
java.lang.Object
java.lang.Record
io.micronaut.mcp.http.server.McpHttpRequest
- Record Components:
protocolVersion
- MCP VersionsessionId
- Session IDlastEventId
- Last Event ID
@Introspected
public record McpHttpRequest(@NonNull String protocolVersion, @Nullable String sessionId, @Nullable String lastEventId)
extends Record
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMcpHttpRequest
(@NonNull String protocolVersion, @Nullable String sessionId, @Nullable String lastEventId) Creates an instance of aMcpHttpRequest
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@Nullable String
Returns the value of thelastEventId
record component.@NonNull String
Returns the value of theprotocolVersion
record component.@Nullable String
Returns the value of thesessionId
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
HTTP_HEADER_MCP_PROTOCOL_VERSION
- See Also:
-
DEFAULT_PROTOCOL_VERSION
- See Also:
-
HTTP_HEADER_MCP_SESSION_ID
- See Also:
-
HTTP_HEADER_DEFAULT_LAST_EVENT_ID
- See Also:
-
-
Constructor Details
-
McpHttpRequest
public McpHttpRequest(@Header(name="MCP-Protocol-Version",defaultValue="2025-03-26") @NonNull @NonNull String protocolVersion, @Header("Mcp-Session-Id") @Nullable @Nullable String sessionId, @Header("Last-Event-ID") @Nullable @Nullable String lastEventId) Creates an instance of aMcpHttpRequest
record class.- Parameters:
protocolVersion
- the value for theprotocolVersion
record componentsessionId
- the value for thesessionId
record componentlastEventId
- the value for thelastEventId
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
protocolVersion
@Header(name="MCP-Protocol-Version", defaultValue="2025-03-26") @NonNull public @NonNull String protocolVersion()Returns the value of theprotocolVersion
record component.- Returns:
- the value of the
protocolVersion
record component
-
sessionId
Returns the value of thesessionId
record component.- Returns:
- the value of the
sessionId
record component
-
lastEventId
Returns the value of thelastEventId
record component.- Returns:
- the value of the
lastEventId
record component
-