Skip to content

Commit 0a42c0d

Browse files
Merge branch 'main' into copilot/fix-owner-type-abstraction
2 parents 813aa9e + 238b143 commit 0a42c0d

File tree

14 files changed

+599
-29
lines changed

14 files changed

+599
-29
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
1414
--mount=type=cache,target=/root/.cache/go-build \
1515
--mount=type=bind,target=. \
1616
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
17-
-o /bin/github-mcp-server cmd/github-mcp-server/main.go
17+
-o /bin/github-mcp-server ./cmd/github-mcp-server
1818

1919
# Make a stage to run the app
2020
FROM gcr.io/distroless/base-debian12

README.md

Lines changed: 112 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Alternatively, to manually configure VS Code, choose the appropriate JSON block
8080
</table>
8181

8282
### Install in other MCP hosts
83+
8384
- **[GitHub Copilot in other IDEs](/docs/installation-guides/install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
8485
- **[Claude Applications](/docs/installation-guides/install-claude.md)** - Installation guide for Claude Desktop and Claude Code CLI
8586
- **[Codex](/docs/installation-guides/install-codex.md)** - Installation guide for Open AI Codex
@@ -97,13 +98,57 @@ See [Remote Server Documentation](docs/remote-server.md) for full details on rem
9798

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

101+
#### Insiders Mode
102+
103+
> **Try new features early!** The remote server offers an insiders version with early access to new features and experimental tools.
104+
105+
<table>
106+
<tr><th>Using URL Path</th><th>Using Header</th></tr>
107+
<tr valign=top>
108+
<td>
109+
110+
```json
111+
{
112+
"servers": {
113+
"github": {
114+
"type": "http",
115+
"url": "https://api.githubcopilot.com/mcp/insiders"
116+
}
117+
}
118+
}
119+
```
120+
121+
</td>
122+
<td>
123+
124+
```json
125+
{
126+
"servers": {
127+
"github": {
128+
"type": "http",
129+
"url": "https://api.githubcopilot.com/mcp/",
130+
"headers": {
131+
"X-MCP-Insiders": "true"
132+
}
133+
}
134+
}
135+
}
136+
```
137+
138+
</td>
139+
</tr>
140+
</table>
141+
142+
See [Remote Server Documentation](docs/remote-server.md#insiders-mode) for more details and examples.
143+
100144
#### GitHub Enterprise
101145

102146
##### GitHub Enterprise Cloud with data residency (ghe.com)
103147

104148
GitHub Enterprise Cloud can also make use of the remote server.
105149

106150
Example for `https://octocorp.ghe.com` with GitHub PAT token:
151+
107152
```
108153
{
109154
...
@@ -140,24 +185,30 @@ The MCP server can use many of the GitHub APIs, so enable the permissions that y
140185
<details><summary><b>Handling PATs Securely</b></summary>
141186

142187
### Environment Variables (Recommended)
188+
143189
To keep your GitHub PAT secure and reusable across different MCP hosts:
144190

145191
1. **Store your PAT in environment variables**
192+
146193
```bash
147194
export GITHUB_PAT=your_token_here
148195
```
196+
149197
Or create a `.env` file:
198+
150199
```env
151200
GITHUB_PAT=your_token_here
152201
```
153202

154203
2. **Protect your `.env` file**
204+
155205
```bash
156206
# Add to .gitignore to prevent accidental commits
157207
echo ".env" >> .gitignore
158208
```
159209

160210
3. **Reference the token in configurations**
211+
161212
```bash
162213
# CLI usage
163214
claude mcp update github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT
@@ -180,6 +231,7 @@ To keep your GitHub PAT secure and reusable across different MCP hosts:
180231
- **Regular rotation**: Update tokens periodically
181232
- **Never commit**: Keep tokens out of version control
182233
- **File permissions**: Restrict access to config files containing tokens
234+
183235
```bash
184236
chmod 600 ~/.your-app/config.json
185237
```
@@ -193,6 +245,7 @@ the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data r
193245

194246
- For GitHub Enterprise Server, prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://`, which GitHub Enterprise Server does not support.
195247
- For GitHub Enterprise Cloud with data residency, use `https://YOURSUBDOMAIN.ghe.com` as the hostname.
248+
196249
``` json
197250
"github": {
198251
"command": "docker",
@@ -328,6 +381,17 @@ If you don't have Docker, you can use `go build` to build the binary in the
328381
}
329382
```
330383

384+
### CLI utilities
385+
386+
The `github-mcp-server` binary includes a few CLI subcommands that are helpful for debugging and exploring the server.
387+
388+
- `github-mcp-server tool-search "<query>"` searches tools by name, description, and input parameter names. Use `--max-results` to return more matches.
389+
Example (color output requires a TTY; use `docker run -t` (or `-it`) when running in Docker):
390+
```bash
391+
docker run -it --rm ghcr.io/github/github-mcp-server tool-search "issue" --max-results 5
392+
github-mcp-server tool-search "issue" --max-results 5
393+
```
394+
331395
## Tool Configuration
332396

333397
The GitHub MCP Server supports enabling or disabling specific groups of functionalities via the `--toolsets` flag. This allows you to control which GitHub API capabilities are available to your AI tools. Enabling only the toolsets that you need can help the LLM with tool choice and reduce the context size.
@@ -349,6 +413,7 @@ To specify toolsets you want available to the LLM, you can pass an allow-list in
349413
```
350414

351415
2. **Using Environment Variable**:
416+
352417
```bash
353418
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
354419
```
@@ -366,23 +431,29 @@ You can also configure specific tools using the `--tools` flag. Tools can be use
366431
```
367432

368433
2. **Using Environment Variable**:
434+
369435
```bash
370436
GITHUB_TOOLS="get_file_contents,issue_read,create_pull_request" ./github-mcp-server
371437
```
372438

373439
3. **Combining with Toolsets** (additive):
440+
374441
```bash
375442
github-mcp-server --toolsets repos,issues --tools get_gist
376443
```
444+
377445
This registers all tools from `repos` and `issues` toolsets, plus `get_gist`.
378446

379447
4. **Combining with Dynamic Toolsets** (additive):
448+
380449
```bash
381450
github-mcp-server --tools get_file_contents --dynamic-toolsets
382451
```
452+
383453
This registers `get_file_contents` plus the dynamic toolset tools (`enable_toolset`, `list_available_toolsets`, `get_toolset_tools`).
384454

385455
**Important Notes:**
456+
386457
- Tools, toolsets, and dynamic toolsets can all be used together
387458
- Read-only mode takes priority: write tools are skipped if `--read-only` is set, even if explicitly requested via `--tools`
388459
- Tool names must match exactly (e.g., `get_file_contents`, not `getFileContents`). Invalid tool names will cause the server to fail at startup with an error message
@@ -435,9 +506,11 @@ GITHUB_TOOLSETS="all" ./github-mcp-server
435506
```
436507

437508
#### "default" toolset
509+
438510
The default toolset `default` is the configuration that gets passed to the server if no toolsets are specified.
439511

440512
The default configuration is:
513+
441514
- context
442515
- repos
443516
- issues
@@ -450,6 +523,31 @@ To keep the default configuration and add additional toolsets:
450523
GITHUB_TOOLSETS="default,stargazers" ./github-mcp-server
451524
```
452525

526+
### Insiders Mode
527+
528+
The local GitHub MCP Server offers an insiders version with early access to new features and experimental tools.
529+
530+
1. **Using Command Line Argument**:
531+
532+
```bash
533+
./github-mcp-server --insider-mode
534+
```
535+
536+
2. **Using Environment Variable**:
537+
538+
```bash
539+
GITHUB_INSIDER_MODE=true ./github-mcp-server
540+
```
541+
542+
When using Docker:
543+
544+
```bash
545+
docker run -i --rm \
546+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
547+
-e GITHUB_INSIDER_MODE=true \
548+
ghcr.io/github/github-mcp-server
549+
```
550+
453551
### Available Toolsets
454552

455553
The following sets of tools are available:
@@ -1371,32 +1469,34 @@ The following sets of tools are available:
13711469

13721470
<summary>Copilot</summary>
13731471

1374-
- **create_pull_request_with_copilot** - Perform task with GitHub Copilot coding agent
1375-
- `owner`: Repository owner. You can guess the owner, but confirm it with the user before proceeding. (string, required)
1376-
- `repo`: Repository name. You can guess the repository name, but confirm it with the user before proceeding. (string, required)
1377-
- `problem_statement`: Detailed description of the task to be performed (e.g., 'Implement a feature that does X', 'Fix bug Y', etc.) (string, required)
1378-
- `title`: Title for the pull request that will be created (string, required)
1379-
- `base_ref`: Git reference (e.g., branch) that the agent will start its work from. If not specified, defaults to the repository's default branch (string, optional)
1472+
- **create_pull_request_with_copilot** - Perform task with GitHub Copilot coding agent
1473+
- `owner`: Repository owner. You can guess the owner, but confirm it with the user before proceeding. (string, required)
1474+
- `repo`: Repository name. You can guess the repository name, but confirm it with the user before proceeding. (string, required)
1475+
- `problem_statement`: Detailed description of the task to be performed (e.g., 'Implement a feature that does X', 'Fix bug Y', etc.) (string, required)
1476+
- `title`: Title for the pull request that will be created (string, required)
1477+
- `base_ref`: Git reference (e.g., branch) that the agent will start its work from. If not specified, defaults to the repository's default branch (string, optional)
13801478

13811479
</details>
13821480

13831481
<details>
13841482

13851483
<summary>Copilot Spaces</summary>
13861484

1387-
- **get_copilot_space** - Get Copilot Space
1388-
- `owner`: The owner of the space. (string, required)
1389-
- `name`: The name of the space. (string, required)
1485+
- **get_copilot_space** - Get Copilot Space
1486+
- `owner`: The owner of the space. (string, required)
1487+
- `name`: The name of the space. (string, required)
1488+
1489+
- **list_copilot_spaces** - List Copilot Spaces
13901490

1391-
- **list_copilot_spaces** - List Copilot Spaces
13921491
</details>
13931492

13941493
<details>
13951494

13961495
<summary>GitHub Support Docs Search</summary>
13971496

1398-
- **github_support_docs_search** - Retrieve documentation relevant to answer GitHub product and support questions. Support topics include: GitHub Actions Workflows, Authentication, GitHub Support Inquiries, Pull Request Practices, Repository Maintenance, GitHub Pages, GitHub Packages, GitHub Discussions, Copilot Spaces
1399-
- `query`: Input from the user about the question they need answered. This is the latest raw unedited user message. You should ALWAYS leave the user message as it is, you should never modify it. (string, required)
1497+
- **github_support_docs_search** - Retrieve documentation relevant to answer GitHub product and support questions. Support topics include: GitHub Actions Workflows, Authentication, GitHub Support Inquiries, Pull Request Practices, Repository Maintenance, GitHub Pages, GitHub Packages, GitHub Discussions, Copilot Spaces
1498+
- `query`: Input from the user about the question they need answered. This is the latest raw unedited user message. You should ALWAYS leave the user message as it is, you should never modify it. (string, required)
1499+
14001500
</details>
14011501

14021502
## Dynamic Tool Discovery

cmd/github-mcp-server/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ func initConfig() {
136136
viper.SetEnvPrefix("github")
137137
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
138138
viper.AutomaticEnv()
139-
140139
}
141140

142141
func main() {

docs/remote-server.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ The Remote GitHub MCP server has optional headers equivalent to the Local server
6767
- `X-MCP-Lockdown`: Enables lockdown mode, hiding public issue details created by users without push access.
6868
- Equivalent to `GITHUB_LOCKDOWN_MODE` env var for Local server.
6969
- 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.
70+
- `X-MCP-Insiders`: Enables insiders mode for early access to new features.
71+
- Equivalent to `GITHUB_INSIDER_MODE` env var or `--insider-mode` flag for Local server.
72+
- 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.
7073

7174
> **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.
7275
@@ -84,18 +87,49 @@ Example:
8487
}
8588
```
8689

90+
### Insiders Mode
91+
92+
The remote GitHub MCP Server offers an insiders version with early access to new features and experimental tools. You can enable insiders mode in two ways:
93+
94+
1. **Via URL path** - Append `/insiders` to the URL:
95+
96+
```json
97+
{
98+
"type": "http",
99+
"url": "https://api.githubcopilot.com/mcp/insiders"
100+
}
101+
```
102+
103+
2. **Via header** - Set the `X-MCP-Insiders` header to `true`:
104+
105+
```json
106+
{
107+
"type": "http",
108+
"url": "https://api.githubcopilot.com/mcp/",
109+
"headers": {
110+
"X-MCP-Insiders": "true"
111+
}
112+
}
113+
```
114+
115+
Both methods can be combined with other path modifiers (like `/readonly`) and headers.
116+
87117
### URL Path Parameters
88118

89119
The Remote GitHub MCP server supports the following URL path patterns:
90120

91121
- `/` - Default toolset (see ["default" toolset](../README.md#default-toolset))
92122
- `/readonly` - Default toolset in read-only mode
123+
- `/insiders` - Default toolset with insiders mode enabled
124+
- `/insiders/readonly` - Default toolset with insiders mode in read-only mode
93125
- `/x/all` - All available toolsets
94126
- `/x/all/readonly` - All available toolsets in read-only mode
127+
- `/x/all/insiders` - All available toolsets with insiders mode enabled
95128
- `/x/{toolset}` - Single specific toolset
96129
- `/x/{toolset}/readonly` - Single specific toolset in read-only mode
130+
- `/x/{toolset}/insiders` - Single specific toolset with insiders mode enabled
97131

98-
Note: `{toolset}` can only be a single toolset, not a comma-separated list. To combine multiple toolsets, use the `X-MCP-Toolsets` header instead.
132+
Note: `{toolset}` can only be a single toolset, not a comma-separated list. To combine multiple toolsets, use the `X-MCP-Toolsets` header instead. Path modifiers like `/readonly` and `/insiders` can be combined with the `X-MCP-Insiders` or `X-MCP-Readonly` headers.
99133

100134
Example:
101135

go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/github/github-mcp-server
33
go 1.24.0
44

55
require (
6+
github.com/fatih/color v1.18.0
67
github.com/google/go-github/v79 v79.0.0
78
github.com/google/jsonschema-go v0.4.2
89
github.com/josephburnett/jd v1.9.2
@@ -20,6 +21,8 @@ require (
2021
github.com/gorilla/css v1.0.1 // indirect
2122
github.com/josharian/intern v1.0.0 // indirect
2223
github.com/mailru/easyjson v0.7.7 // indirect
24+
github.com/mattn/go-colorable v0.1.13 // indirect
25+
github.com/mattn/go-isatty v0.0.20 // indirect
2326
github.com/stretchr/objx v0.5.2 // indirect
2427
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
2528
go.yaml.in/yaml/v3 v3.0.4 // indirect
@@ -31,9 +34,10 @@ require (
3134
require (
3235
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3336
github.com/fsnotify/fsnotify v1.9.0 // indirect
34-
github.com/go-viper/mapstructure/v2 v2.4.0
37+
github.com/go-viper/mapstructure/v2 v2.5.0
3538
github.com/google/go-querystring v1.1.0 // indirect
3639
github.com/inconshreveable/mousetrap v1.1.0 // indirect
40+
github.com/lithammer/fuzzysearch v1.1.8
3741
github.com/modelcontextprotocol/go-sdk v1.2.0
3842
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
3943
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect

0 commit comments

Comments
 (0)