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 class
Builder 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 aMcpConnectionInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic McpConnectionInfo.Builder
builder()
Creates a new Builder instance for constructing McpConnectionInfo.io.modelcontextprotocol.spec.McpSchema.ClientCapabilities
Returns the value of theclientCapabilities
record component.io.modelcontextprotocol.spec.McpSchema.Implementation
Returns the value of theclientInfo
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.io.modelcontextprotocol.spec.McpSchema.InitializeResult
Returns the value of theinitializeResult
record component.final String
toString()
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 aMcpConnectionInfo
record class.- Parameters:
clientCapabilities
- the value for theclientCapabilities
record componentclientInfo
- the value for theclientInfo
record componentinitializeResult
- the value for theinitializeResult
record 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 theclientCapabilities
record component.- Returns:
- the value of the
clientCapabilities
record component
-
clientInfo
public io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo()Returns the value of theclientInfo
record component.- Returns:
- the value of the
clientInfo
record component
-
initializeResult
public io.modelcontextprotocol.spec.McpSchema.InitializeResult initializeResult()Returns the value of theinitializeResult
record component.- Returns:
- the value of the
initializeResult
record component
-