Package org.springframework.ai.mcp
Record Class McpConnectionInfo
java.lang.Object
java.lang.Record
org.springframework.ai.mcp.McpConnectionInfo
- Record Components:
clientCapabilities- the MCP client capabilitiesclientInfo- the MCP client informationinitializeResult- the MCP server initialization result
public record McpConnectionInfo(io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities, io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo, io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult)
extends Record
MCP connection info record containing the client and server related metadata.
- Author:
- Ilayaperumal Gopinathan, Christian Tzolov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for constructing McpConnectionInfo instances. -
Constructor Summary
ConstructorsConstructorDescriptionMcpConnectionInfo(io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities, io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo, io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult) Creates an instance of aMcpConnectionInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic McpConnectionInfo.Builderbuilder()Creates a new Builder instance for constructing McpConnectionInfo.io.modelcontextprotocol.spec.McpSchema.ClientCapabilitiesReturns the value of theclientCapabilitiesrecord component.io.modelcontextprotocol.spec.McpSchema.ImplementationReturns the value of theclientInforecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.io.modelcontextprotocol.spec.McpSchema.InitializeResultReturns the value of theinitializeResultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpConnectionInfo
public McpConnectionInfo(io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities, io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo, io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult) Creates an instance of aMcpConnectionInforecord class.- Parameters:
clientCapabilities- the value for theclientCapabilitiesrecord componentclientInfo- the value for theclientInforecord componentinitializeResult- the value for theinitializeResultrecord component
-
-
Method Details
-
builder
Creates a new Builder instance for constructing McpConnectionInfo.- Returns:
- a new Builder instance
-
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). -
clientCapabilities
public io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities()Returns the value of theclientCapabilitiesrecord component.- Returns:
- the value of the
clientCapabilitiesrecord component
-
clientInfo
public io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo()Returns the value of theclientInforecord component.- Returns:
- the value of the
clientInforecord component
-
initializeResult
public io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult()Returns the value of theinitializeResultrecord component.- Returns:
- the value of the
initializeResultrecord component
-