Package com.github.copilot.sdk.json
Class McpHttpServerConfig
java.lang.Object
com.github.copilot.sdk.json.McpServerConfig
com.github.copilot.sdk.json.McpHttpServerConfig
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the optional HTTP headers to include in requests.getType()Gets the server type discriminator.getUrl()Gets the URL of the remote server.setHeaders(Map<String, String> headers) Sets optional HTTP headers to include in requests to this server.setTimeout(Integer timeout) Sets an optional timeout in milliseconds for tool calls to this server.Sets the list of tools to include from this server.Sets the URL of the remote server.Methods inherited from class com.github.copilot.sdk.json.McpServerConfig
getTimeout, getTools
-
Constructor Details
-
McpHttpServerConfig
public McpHttpServerConfig()
-
-
Method Details
-
getType
Gets the server type discriminator.- Returns:
- always
"http"
-
getUrl
Gets the URL of the remote server.- Returns:
- the server URL
-
setUrl
Sets the URL of the remote server.- Parameters:
url- the server URL- Returns:
- this config for method chaining
-
getHeaders
Gets the optional HTTP headers to include in requests.- Returns:
- the headers map, or
null
-
setHeaders
Sets optional HTTP headers to include in requests to this server.- Parameters:
headers- the headers map- Returns:
- this config for method chaining
-
setTools
Description copied from class:McpServerConfigSets the list of tools to include from this server.An empty list means none; use
"*"to include all tools.- Overrides:
setToolsin classMcpServerConfig- Parameters:
tools- the list of tool names, ornull- Returns:
- this config for method chaining
-
setTimeout
Description copied from class:McpServerConfigSets an optional timeout in milliseconds for tool calls to this server.- Overrides:
setTimeoutin classMcpServerConfig- Parameters:
timeout- the timeout in milliseconds, ornullfor the default- Returns:
- this config for method chaining
-