Class McpHttpServerConfig
java.lang.Object
com.github.copilot.rpc.McpServerConfig
com.github.copilot.rpc.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.Gets the statically configured OAuth client ID.Gets the configured OAuth grant type.Gets whether the configured OAuth client is public.Gets the configured OAuth scopes.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.setOauthClientId(String oauthClientId) Sets the statically configured OAuth client ID.setOauthGrantType(String oauthGrantType) Sets the OAuth grant type.setOauthPublicClient(Boolean oauthPublicClient) Sets whether the configured OAuth client is public.setOauthScopes(List<String> oauthScopes) Sets the OAuth scopes to request when the server challenge omits scope or provides an empty scope.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 McpServerConfig
getTimeout, getTools
-
Constructor Details
-
McpHttpServerConfig
public McpHttpServerConfig()
-
-
Method Details
-
getType
-
getUrl
-
setUrl
Sets the URL of the remote server.- Parameters:
url- the server URL- Returns:
- this config for method chaining
-
getHeaders
-
setHeaders
Sets optional HTTP headers to include in requests to this server.- Parameters:
headers- the headers map- Returns:
- this config for method chaining
-
getOauthClientId
Gets the statically configured OAuth client ID.- Returns:
- the OAuth client ID, or
null
-
setOauthClientId
Sets the statically configured OAuth client ID.- Parameters:
oauthClientId- the non-empty OAuth client ID- Returns:
- this config for method chaining
-
getOauthScopes
-
setOauthScopes
Sets the OAuth scopes to request when the server challenge omits scope or provides an empty scope.- Parameters:
oauthScopes- the non-empty list of RFC 6749 scope-token strings- Returns:
- this config for method chaining
-
getOauthPublicClient
Gets whether the configured OAuth client is public.- Returns:
- whether the client is public, or
null
-
setOauthPublicClient
Sets whether the configured OAuth client is public.- Parameters:
oauthPublicClient- whether the client is public- Returns:
- this config for method chaining
-
getOauthGrantType
Gets the configured OAuth grant type.- Returns:
- the OAuth grant type, or
null
-
setOauthGrantType
Sets the OAuth grant type.- Parameters:
oauthGrantType- the OAuth grant type- 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
-