-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMcpServerConfig.java.html
More file actions
89 lines (79 loc) · 4.6 KB
/
Copy pathMcpServerConfig.java.html
File metadata and controls
89 lines (79 loc) · 4.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang=""><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>McpServerConfig.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GitHub Copilot SDK :: Java</a> > <a href="index.source.html" class="el_package">com.github.copilot.rpc</a> > <span class="el_source">McpServerConfig.java</span></div><h1>McpServerConfig.java</h1><pre class="source lang-java linenums">/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.rpc;
import java.util.Collections;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
/**
* Abstract base class for MCP (Model Context Protocol) server configurations.
* <p>
* Use one of the concrete subclasses to configure MCP servers:
* <ul>
* <li>{@link McpStdioServerConfig} — for local/stdio-based MCP servers</li>
* <li>{@link McpHttpServerConfig} — for remote HTTP/SSE-based MCP servers</li>
* </ul>
*
* @see McpStdioServerConfig
* @see McpHttpServerConfig
* @see SessionConfig#setMcpServers(java.util.Map)
* @since 1.3.0
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = McpStdioServerConfig.class)
@JsonSubTypes({@JsonSubTypes.Type(value = McpStdioServerConfig.class, name = "stdio"),
@JsonSubTypes.Type(value = McpStdioServerConfig.class, name = "local"),
@JsonSubTypes.Type(value = McpHttpServerConfig.class, name = "http"),
@JsonSubTypes.Type(value = McpHttpServerConfig.class, name = "sse")})
<span class="fc" id="L35">public abstract class McpServerConfig {</span>
@JsonProperty("tools")
private List<String> tools;
@JsonProperty("timeout")
private Integer timeout;
/**
* Gets the list of tools to include from this server.
* <p>
* An empty list means none; use {@code "*"} to include all tools.
*
* @return the list of tool names, or {@code null} if not set
*/
public List<String> getTools() {
<span class="pc bpc" id="L51" title="1 of 2 branches missed."> return tools == null ? null : Collections.unmodifiableList(tools);</span>
}
/**
* Sets the list of tools to include from this server.
* <p>
* An empty list means none; use {@code "*"} to include all tools.
*
* @param tools
* the list of tool names, or {@code null}
* @return this config for method chaining
*/
public McpServerConfig setTools(List<String> tools) {
<span class="fc" id="L64"> this.tools = tools;</span>
<span class="fc" id="L65"> return this;</span>
}
/**
* Gets the optional timeout in milliseconds for tool calls to this server.
*
* @return the timeout in milliseconds, or {@code null} for the default
*/
public Integer getTimeout() {
<span class="fc" id="L74"> return timeout;</span>
}
/**
* Sets an optional timeout in milliseconds for tool calls to this server.
*
* @param timeout
* the timeout in milliseconds, or {@code null} for the default
* @return this config for method chaining
*/
public McpServerConfig setTimeout(Integer timeout) {
<span class="fc" id="L85"> this.timeout = timeout;</span>
<span class="fc" id="L86"> return this;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.14.202510111229</span></div></body></html>