Class McpHttpServerConfig

java.lang.Object
com.github.copilot.sdk.json.McpServerConfig
com.github.copilot.sdk.json.McpHttpServerConfig

public final class McpHttpServerConfig extends McpServerConfig
Configuration for a remote HTTP/SSE MCP (Model Context Protocol) server.

Use this to configure an MCP server that communicates over HTTP or Server-Sent Events (SSE).

Example Usage


 var server = new McpHttpServerConfig().setUrl("https://mcp.example.com/sse").setTools(List.of("*"));

 var config = new SessionConfig().setMcpServers(Map.of("remote-server", server));
 
Since:
1.3.0
See Also:
  • Constructor Details

    • McpHttpServerConfig

      public McpHttpServerConfig()
  • Method Details

    • getType

      public String getType()
      Gets the server type discriminator.
      Returns:
      always "http"
    • getUrl

      public String getUrl()
      Gets the URL of the remote server.
      Returns:
      the server URL
    • setUrl

      public McpHttpServerConfig setUrl(String url)
      Sets the URL of the remote server.
      Parameters:
      url - the server URL
      Returns:
      this config for method chaining
    • getHeaders

      public Map<String,String> getHeaders()
      Gets the optional HTTP headers to include in requests.
      Returns:
      the headers map, or null
    • setHeaders

      public McpHttpServerConfig setHeaders(Map<String,String> headers)
      Sets optional HTTP headers to include in requests to this server.
      Parameters:
      headers - the headers map
      Returns:
      this config for method chaining
    • setTools

      public McpHttpServerConfig setTools(List<String> tools)
      Description copied from class: McpServerConfig
      Sets the list of tools to include from this server.

      An empty list means none; use "*" to include all tools.

      Overrides:
      setTools in class McpServerConfig
      Parameters:
      tools - the list of tool names, or null
      Returns:
      this config for method chaining
    • setTimeout

      public McpHttpServerConfig setTimeout(Integer timeout)
      Description copied from class: McpServerConfig
      Sets an optional timeout in milliseconds for tool calls to this server.
      Overrides:
      setTimeout in class McpServerConfig
      Parameters:
      timeout - the timeout in milliseconds, or null for the default
      Returns:
      this config for method chaining