Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c73e88

Browse files
tommaso-moroCopilottonytrg
authored
Tommy/server-config-docs (#1495)
* small doc update to add x-mcp-tools header* update* add server configuration guide* update* Update docs/server-configuration.mdCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>* Update docs/remote-server.mdCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>* Update docs/server-configuration.mdCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>* Update README.mdCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>* Update docs/server-configuration.mdCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>* Update docs/server-configuration.mdCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>* Update docs/server-configuration.mdCo-authored-by: Tony Truong <tonytrg@github.com>* use relative paths* use relative path---------Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>Co-authored-by: Tony Truong <tonytrg@github.com>
1 parent4d6d64e commit9c73e88

File tree

3 files changed

+359
-2
lines changed

3 files changed

+359
-2
lines changed

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ _Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also
328328

329329
When no toolsets are specified,[default toolsets](#default-toolset) are used.
330330

331+
>**Looking for examples?** See the[Server Configuration Guide](./docs/server-configuration.md) for common recipes like minimal setups, read-only mode, and combining tools with toolsets.
332+
331333
####Specifying Toolsets
332334

333335
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:

‎docs/remote-server.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,23 @@ These toolsets are only available in the remote GitHub MCP Server and are not in
5353

5454
###Optional Headers
5555

56-
The Remote GitHub MCP server has optional headers equivalent to the Local server env vars:
56+
The Remote GitHub MCP server has optional headers equivalent to the Local server env vars or flags:
5757

5858
-`X-MCP-Toolsets`: Comma-separated list of toolsets to enable. E.g. "repos,issues".
59-
- Equivalent to`GITHUB_TOOLSETS` env var for Local server.
59+
- Equivalent to`GITHUB_TOOLSETS` env varor`--toolsets` flagfor Local server.
6060
- If the list is empty, default toolsets will be used. Invalid or unknown toolsets are silently ignored without error and will not prevent the server from starting. Whitespace is ignored.
61+
-`X-MCP-Tools`: Comma-separated list of tools to enable. E.g. "get_file_contents,issue_read,pull_request_read".
62+
- Equivalent to`GITHUB_TOOLS` env var or`--tools` flag for Local server.
63+
- Invalid tools will throw an error and prevent the server from starting. Whitespace is ignored.
6164
-`X-MCP-Readonly`: Enables only "read" tools.
6265
- Equivalent to`GITHUB_READ_ONLY` env var for Local server.
6366
- If this header is empty, "false", "f", "no", "n", "0", or "off" (ignoring whitespace and case), it will be interpreted as false. All other values are interpreted as true.
6467
-`X-MCP-Lockdown`: Enables lockdown mode, hiding public issue details created by users without push access.
6568
- Equivalent to`GITHUB_LOCKDOWN_MODE` env var for Local server.
6669
- If this header is empty, "false", "f", "no", "n", "0", or "off" (ignoring whitespace and case), it will be interpreted as false. All other values are interpreted as true.
6770

71+
>**Looking for examples?** See the[Server Configuration Guide](./server-configuration.md) for common recipes like minimal setups, read-only mode, and combining tools with toolsets.
72+
6873
Example:
6974

7075
```json

‎docs/server-configuration.md‎

Lines changed: 350 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,350 @@
1+
#Server Configuration Guide
2+
3+
This guide helps you choose the right configuration for your use case and shows you how to apply it. For the complete reference of available toolsets and tools, see the[README](../README.md#tool-configuration).
4+
5+
##Quick Reference
6+
We currently support the following ways in which the GitHub MCP Server can be configured:
7+
8+
| Configuration| Remote Server| Local Server|
9+
|---------------|---------------|--------------|
10+
| Toolsets|`X-MCP-Toolsets` header or`/x/{toolset}` URL|`--toolsets` flag or`GITHUB_TOOLSETS` env var|
11+
| Individual Tools|`X-MCP-Tools` header|`--tools` flag or`GITHUB_TOOLS` env var|
12+
| Read-Only Mode|`X-MCP-Readonly` header or`/readonly` URL|`--read-only` flag or`GITHUB_READ_ONLY` env var|
13+
| Dynamic Mode| Not available|`--dynamic-toolsets` flag or`GITHUB_DYNAMIC_TOOLSETS` env var|
14+
| Lockdown Mode|`X-MCP-Lockdown` header|`--lockdown-mode` flag or`GITHUB_LOCKDOWN_MODE` env var|
15+
16+
>**Default behavior:** If you don't specify any configuration, the server uses the**default toolsets**:`context`,`issues`,`pull_requests`,`repos`,`users`.
17+
18+
---
19+
20+
##How Configuration Works
21+
22+
All configuration options are**composable**: you can combine toolsets, individual tools, dynamic discovery, read-only mode and lockdown mode in any way that suits your workflow.
23+
24+
Note:**read-only** mode acts as a strict security filter that takes precedence over any other configuration, by disabling write tools even when explicitly requested.
25+
26+
---
27+
28+
##Configuration Examples
29+
30+
The examples below use VS Code configuration format to illustrate the concepts. If you're using a different MCP host (Cursor, Claude Desktop, JetBrains, etc.), your configuration might need to look slightly different. See[installation guides](./installation-guides) for host-specific setup.
31+
32+
###Enabling Specific Tools
33+
34+
**Best for:** users who know exactly what they need and want to optimize context usage by loading only the tools they will use.
35+
36+
**Example:**
37+
38+
<table>
39+
<tr><th>Remote Server</th><th>Local Server</th></tr>
40+
<trvalign="top">
41+
<td>
42+
43+
```json
44+
{
45+
"type":"http",
46+
"url":"https://api.githubcopilot.com/mcp/",
47+
"headers": {
48+
"X-MCP-Tools":"get_file_contents,get_me,pull_request_read"
49+
}
50+
}
51+
```
52+
53+
</td>
54+
<td>
55+
56+
```json
57+
{
58+
"type":"stdio",
59+
"command":"go",
60+
"args": [
61+
"run",
62+
"./cmd/github-mcp-server",
63+
"stdio",
64+
"--tools=get_file_contents,get_me,pull_request_read"
65+
],
66+
"env": {
67+
"GITHUB_PERSONAL_ACCESS_TOKEN":"${input:github_token}"
68+
}
69+
}
70+
```
71+
72+
</td>
73+
</tr>
74+
</table>
75+
76+
---
77+
78+
###Enabling Specific Toolsets
79+
80+
**Best for:** Users who want to enable multiple related toolsets.
81+
82+
<table>
83+
<tr><th>Remote Server</th><th>Local Server</th></tr>
84+
<trvalign="top">
85+
<td>
86+
87+
```json
88+
{
89+
"type":"http",
90+
"url":"https://api.githubcopilot.com/mcp/",
91+
"headers": {
92+
"X-MCP-Toolsets":"issues,pull_requests"
93+
}
94+
}
95+
```
96+
97+
</td>
98+
<td>
99+
100+
```json
101+
{
102+
"type":"stdio",
103+
"command":"go",
104+
"args": [
105+
"run",
106+
"./cmd/github-mcp-server",
107+
"stdio",
108+
"--toolsets=issues,pull_requests"
109+
],
110+
"env": {
111+
"GITHUB_PERSONAL_ACCESS_TOKEN":"${input:github_token}"
112+
}
113+
}
114+
```
115+
116+
</td>
117+
</tr>
118+
</table>
119+
120+
---
121+
122+
###Enabling Toolsets + Tools
123+
124+
**Best for:** Users who want broad functionality from some areas, plus specific tools from others.
125+
126+
Enable entire toolsets, then add individual tools from toolsets you don't want fully enabled.
127+
128+
<table>
129+
<tr><th>Remote Server</th><th>Local Server</th></tr>
130+
<trvalign="top">
131+
<td>
132+
133+
```json
134+
{
135+
"type":"http",
136+
"url":"https://api.githubcopilot.com/mcp/",
137+
"headers": {
138+
"X-MCP-Toolsets":"repos,issues",
139+
"X-MCP-Tools":"get_gist,pull_request_read"
140+
}
141+
}
142+
```
143+
144+
</td>
145+
<td>
146+
147+
```json
148+
{
149+
"type":"stdio",
150+
"command":"go",
151+
"args": [
152+
"run",
153+
"./cmd/github-mcp-server",
154+
"stdio",
155+
"--toolsets=repos,issues",
156+
"--tools=get_gist,pull_request_read"
157+
],
158+
"env": {
159+
"GITHUB_PERSONAL_ACCESS_TOKEN":"${input:github_token}"
160+
}
161+
}
162+
```
163+
164+
</td>
165+
</tr>
166+
</table>
167+
168+
**Result:** All repository and issue tools, plus just the gist tools you need.
169+
170+
---
171+
172+
###Read-Only Mode
173+
174+
**Best for:** Security conscious users who want to ensure the server won't allow operations that modify issues, pull requests, repositories etc.
175+
176+
When active, this mode will disable all tools that are not read-only even if they were requested.
177+
178+
**Example:**
179+
<table>
180+
<tr><th>Remote Server</th><th>Local Server</th></tr>
181+
<trvalign="top">
182+
<td>
183+
184+
**Option A: Header**
185+
```json
186+
{
187+
"type":"http",
188+
"url":"https://api.githubcopilot.com/mcp/",
189+
"headers": {
190+
"X-MCP-Toolsets":"issues,repos,pull_requests",
191+
"X-MCP-Readonly":"true"
192+
}
193+
}
194+
```
195+
196+
**Option B: URL path**
197+
```json
198+
{
199+
"type":"http",
200+
"url":"https://api.githubcopilot.com/mcp/x/all/readonly"
201+
}
202+
```
203+
204+
</td>
205+
<td>
206+
207+
208+
```json
209+
{
210+
"type":"stdio",
211+
"command":"go",
212+
"args": [
213+
"run",
214+
"./cmd/github-mcp-server",
215+
"stdio",
216+
"--toolsets=issues,repos,pull_requests",
217+
"--read-only"
218+
],
219+
"env": {
220+
"GITHUB_PERSONAL_ACCESS_TOKEN":"${input:github_token}"
221+
}
222+
}
223+
```
224+
225+
</td>
226+
</tr>
227+
</table>
228+
229+
>Even if`issues` toolset contains`create_issue`, it will be excluded in read-only mode.
230+
231+
---
232+
233+
###Dynamic Discovery (Local Only)
234+
235+
**Best for:** Letting the LLM discover and enable toolsets as needed.
236+
237+
Starts with only discovery tools (`enable_toolset`,`list_available_toolsets`,`get_toolset_tools`), then expands on demand.
238+
239+
<table>
240+
<tr><th>Local Server Only</th></tr>
241+
<trvalign="top">
242+
<td>
243+
244+
```json
245+
{
246+
"type":"stdio",
247+
"command":"go",
248+
"args": [
249+
"run",
250+
"./cmd/github-mcp-server",
251+
"stdio",
252+
"--dynamic-toolsets"
253+
],
254+
"env": {
255+
"GITHUB_PERSONAL_ACCESS_TOKEN":"${input:github_token}"
256+
}
257+
}
258+
```
259+
260+
**With some tools pre-enabled:**
261+
```json
262+
{
263+
"type":"stdio",
264+
"command":"go",
265+
"args": [
266+
"run",
267+
"./cmd/github-mcp-server",
268+
"stdio",
269+
"--dynamic-toolsets",
270+
"--tools=get_me,search_code"
271+
],
272+
"env": {
273+
"GITHUB_PERSONAL_ACCESS_TOKEN":"${input:github_token}"
274+
}
275+
}
276+
```
277+
278+
</td>
279+
</tr>
280+
</table>
281+
282+
When both dynamic mode and specific tools are enabled in the server configuration, the server will start with the 3 dynamic tools + the specified tools.
283+
284+
---
285+
286+
###Lockdown Mode
287+
288+
**Best for:** Public repositories where you want to limit content from users without push access.
289+
290+
Lockdown mode ensures the server only surfaces content in public repositories from users with push access to that repository. Private repositories are unaffected, and collaborators retain full access to their own content.
291+
292+
**Example:**
293+
<table>
294+
<tr><th>Remote Server</th><th>Local Server</th></tr>
295+
<trvalign="top">
296+
<td>
297+
298+
```json
299+
{
300+
"type":"http",
301+
"url":"https://api.githubcopilot.com/mcp/",
302+
"headers": {
303+
"X-MCP-Lockdown":"true"
304+
}
305+
}
306+
```
307+
308+
</td>
309+
<td>
310+
311+
```json
312+
{
313+
"type":"stdio",
314+
"command":"go",
315+
"args": [
316+
"run",
317+
"./cmd/github-mcp-server",
318+
"stdio",
319+
"--lockdown-mode"
320+
],
321+
"env": {
322+
"GITHUB_PERSONAL_ACCESS_TOKEN":"${input:github_token}"
323+
}
324+
}
325+
```
326+
327+
</td>
328+
</tr>
329+
</table>
330+
331+
---
332+
333+
##Troubleshooting
334+
335+
| Problem| Cause| Solution|
336+
|---------|-------|----------|
337+
| Server fails to start| Invalid tool name in`--tools` or`X-MCP-Tools`| Check tool name spelling; use exact names from[Tools list](../README.md#tools)|
338+
| Write tools not working| Read-only mode enabled| Remove`--read-only` flag or`X-MCP-Readonly` header|
339+
| Tools missing| Toolset not enabled| Add the required toolset or specific tool|
340+
| Dynamic tools not available| Using remote server| Dynamic mode is available in the local MCP server only|
341+
342+
---
343+
344+
##Useful links
345+
346+
-[README: Tool Configuration](../README.md#tool-configuration)
347+
-[README: Available Toolsets](../README.md#available-toolsets) — Complete list of toolsets
348+
-[README: Tools](../README.md#tools) — Complete list of individual tools
349+
-[Remote Server Documentation](./remote-server.md) — Remote-specific options and headers
350+
-[Installation Guides](./installation-guides) — Host-specific setup instructions

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp