Record Class McpProperties.ServerProperties

java.lang.Object
java.lang.Record
com.agentforge4j.starter.mcp.McpProperties.ServerProperties
Record Components:
id - unique server id (also the connection key)
providerId - logical provider id (defaults to "mcp:<id>" when blank)
transport - STDIO or STREAMABLE_HTTP; defaults to STDIO
command - executable for stdio transport
args - command-line arguments for stdio transport
url - base URL for streamable HTTP transport
env - environment variables for stdio transport
headers - literal request headers for streamable HTTP transport, sent on every request (for example Authorization for hosted servers); null means none
enabled - whether the server is active; null means enabled
requestTimeout - per-request timeout; defaults to 30s when null
Enclosing class:
McpProperties

public static record McpProperties.ServerProperties(String id, String providerId, String transport, String command, List<String> args, String url, Map<String,String> env, Map<String,String> headers, Boolean enabled, Duration requestTimeout) extends Record
One MCP server.
  • Constructor Details

    • ServerProperties

      public ServerProperties(String id, String providerId, String transport, String command, List<String> args, String url, Map<String,String> env, Map<String,String> headers, Boolean enabled, Duration requestTimeout)
      Creates an instance of a ServerProperties record class.
      Parameters:
      id - the value for the id record component
      providerId - the value for the providerId record component
      transport - the value for the transport record component
      command - the value for the command record component
      args - the value for the args record component
      url - the value for the url record component
      env - the value for the env record component
      headers - the value for the headers record component
      enabled - the value for the enabled record component
      requestTimeout - the value for the requestTimeout record component
  • Method Details

    • 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • providerId

      public String providerId()
      Returns the value of the providerId record component.
      Returns:
      the value of the providerId record component
    • transport

      public String transport()
      Returns the value of the transport record component.
      Returns:
      the value of the transport record component
    • command

      public String command()
      Returns the value of the command record component.
      Returns:
      the value of the command record component
    • args

      public List<String> args()
      Returns the value of the args record component.
      Returns:
      the value of the args record component
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • env

      public Map<String,String> env()
      Returns the value of the env record component.
      Returns:
      the value of the env record component
    • headers

      public Map<String,String> headers()
      Returns the value of the headers record component.
      Returns:
      the value of the headers record component
    • enabled

      public Boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • requestTimeout

      public Duration requestTimeout()
      Returns the value of the requestTimeout record component.
      Returns:
      the value of the requestTimeout record component