Record Class McpServerSSE

java.lang.Object
java.lang.Record
com.github.thought2code.mcp.annotated.configuration.McpServerSSE

public record McpServerSSE(String messageEndpoint, String endpoint, String baseUrl, Integer port) extends Record
This record represents the Server-Sent Events (SSE) configuration for an MCP (Model Context Protocol) server.

It contains properties such as the message endpoint, endpoint, base URL, and port.

Author:
codeboyzhou
See Also:
  • Constructor Details

    • McpServerSSE

      public McpServerSSE(String messageEndpoint, String endpoint, String baseUrl, Integer port)
      Creates an instance of a McpServerSSE record class.
      Parameters:
      messageEndpoint - the value for the messageEndpoint record component
      endpoint - the value for the endpoint record component
      baseUrl - the value for the baseUrl record component
      port - the value for the port record component
  • Method Details

    • builder

      public static McpServerSSE.Builder builder()
      Creates a new instance of Builder to build McpServerSSE.
      Returns:
      A new instance of Builder.
    • getDefault

      public static McpServerSSE getDefault()
      Returns the default SSE configuration of the MCP server.

      By default, the message endpoint is "/mcp/message", the endpoint is "/sse", the base URL is StringHelper.EMPTY, and the port is 8080.

      Returns:
      The default SSE configuration of the MCP server.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • messageEndpoint

      public String messageEndpoint()
      Returns the value of the messageEndpoint record component.
      Returns:
      the value of the messageEndpoint record component
    • endpoint

      public String endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • baseUrl

      public String baseUrl()
      Returns the value of the baseUrl record component.
      Returns:
      the value of the baseUrl record component
    • port

      public Integer port()
      Returns the value of the port record component.
      Returns:
      the value of the port record component