Skip to content

Commit 23e1260

Browse files
authored
Merge branch 'main' into main
2 parents eba3968 + 1820a0f commit 23e1260

File tree

23 files changed

+617
-223
lines changed

23 files changed

+617
-223
lines changed

.github/workflows/go.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515

1616
steps:
17+
- name: Force git to use LF
18+
# This step is required on Windows to work around go mod tidy -diff issues caused by CRLF line endings.
19+
# TODO: replace with a checkout option when https://github.com/actions/checkout/issues/226 is implemented
20+
if: runner.os == 'Windows'
21+
run: |
22+
git config --global core.autocrlf false
23+
git config --global core.eol lf
24+
1725
- name: Check out code
1826
uses: actions/checkout@v6
1927

@@ -22,8 +30,8 @@ jobs:
2230
with:
2331
go-version-file: "go.mod"
2432

25-
- name: Download dependencies
26-
run: go mod download
33+
- name: Tidy dependencies
34+
run: go mod tidy -diff
2735

2836
- name: Run unit tests
2937
run: script/test

.github/workflows/mcp-diff.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fetch-depth: 0
2121

2222
- name: Run MCP Server Diff
23-
uses: SamMorrowDrums/mcp-server-diff@v2
23+
uses: SamMorrowDrums/mcp-server-diff@v2.3.5
2424
with:
2525
setup_go: "true"
2626
install_command: go mod download
@@ -35,8 +35,10 @@ jobs:
3535
{"name": "read-only+dynamic", "args": "--read-only --dynamic-toolsets"},
3636
{"name": "toolsets-repos", "args": "--toolsets=repos"},
3737
{"name": "toolsets-issues", "args": "--toolsets=issues"},
38+
{"name": "toolsets-context", "args": "--toolsets=context"},
3839
{"name": "toolsets-pull_requests", "args": "--toolsets=pull_requests"},
3940
{"name": "toolsets-repos,issues", "args": "--toolsets=repos,issues"},
41+
{"name": "toolsets-issues,context", "args": "--toolsets=issues,context"},
4042
{"name": "toolsets-all", "args": "--toolsets=all"},
4143
{"name": "tools-get_me", "args": "--tools=get_me"},
4244
{"name": "tools-get_me,list_issues", "args": "--tools=get_me,list_issues"},

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25.4-alpine AS build
1+
FROM golang:1.25.6-alpine AS build
22
ARG VERSION="dev"
33

44
# Set the working directory

README.md

Lines changed: 61 additions & 155 deletions
Large diffs are not rendered by default.

cmd/github-mcp-server/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var (
8383
LogFilePath: viper.GetString("log-file"),
8484
ContentWindowSize: viper.GetInt("content-window-size"),
8585
LockdownMode: viper.GetBool("lockdown-mode"),
86-
InsiderMode: viper.GetBool("insider-mode"),
86+
InsidersMode: viper.GetBool("insiders"),
8787
RepoAccessCacheTTL: &ttl,
8888
}
8989
return ghmcp.RunStdioServer(stdioServerConfig)
@@ -158,7 +158,7 @@ func init() {
158158
rootCmd.PersistentFlags().String("gh-host", "", "Specify the GitHub hostname (for GitHub Enterprise etc.)")
159159
rootCmd.PersistentFlags().Int("content-window-size", 5000, "Specify the content window size")
160160
rootCmd.PersistentFlags().Bool("lockdown-mode", false, "Enable lockdown mode")
161-
rootCmd.PersistentFlags().Bool("insider-mode", false, "Enable insider features")
161+
rootCmd.PersistentFlags().Bool("insiders", false, "Enable insiders features")
162162
rootCmd.PersistentFlags().Duration("repo-access-cache-ttl", 5*time.Minute, "Override the repo access cache TTL (e.g. 1m, 0s to disable)")
163163

164164
// Bind flag to viper
@@ -173,7 +173,7 @@ func init() {
173173
_ = viper.BindPFlag("host", rootCmd.PersistentFlags().Lookup("gh-host"))
174174
_ = viper.BindPFlag("content-window-size", rootCmd.PersistentFlags().Lookup("content-window-size"))
175175
_ = viper.BindPFlag("lockdown-mode", rootCmd.PersistentFlags().Lookup("lockdown-mode"))
176-
_ = viper.BindPFlag("insider-mode", rootCmd.PersistentFlags().Lookup("insider-mode"))
176+
_ = viper.BindPFlag("insiders", rootCmd.PersistentFlags().Lookup("insiders"))
177177
_ = viper.BindPFlag("repo-access-cache-ttl", rootCmd.PersistentFlags().Lookup("repo-access-cache-ttl"))
178178

179179
// Add HTTP-specific flags

cmd/mcpcurl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ be executed against the configured MCP server.
1616
## Installation
1717

1818
### Prerequisites
19-
- Go 1.21 or later
19+
- Go 1.24 or later
2020
- Access to the GitHub MCP Server from either Docker or local build
2121

2222
### Build from Source

docs/installation-guides/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This directory contains detailed installation instructions for the GitHub MCP Server across different host applications and IDEs. Choose the guide that matches your development environment.
44

55
## Installation Guides by Host Application
6+
- **[Copilot CLI](install-copilot-cli.md)** - Installation guide for GitHub Copilot CLI
67
- **[GitHub Copilot in other IDEs](install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
78
- **[Antigravity](install-antigravity.md)** - Installation for Google Antigravity IDE
89
- **[Claude Applications](install-claude.md)** - Installation guide for Claude Web, Claude Desktop and Claude Code CLI
@@ -15,6 +16,7 @@ This directory contains detailed installation instructions for the GitHub MCP Se
1516

1617
| Host Application | Local GitHub MCP Support | Remote GitHub MCP Support | Prerequisites | Difficulty |
1718
|-----------------|---------------|----------------|---------------|------------|
19+
| Copilot CLI || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
1820
| Copilot in VS Code || ✅ Full (OAuth + PAT) | Local: Docker or Go build, GitHub PAT<br>Remote: VS Code 1.101+ | Easy |
1921
| Copilot Coding Agent || ✅ Full (on by default; no auth needed) | Any _paid_ copilot license | Default on |
2022
| Copilot in Visual Studio || ✅ Full (OAuth + PAT) | Local: Docker or Go build, GitHub PAT<br>Remote: Visual Studio 17.14+ | Easy |

docs/installation-guides/install-claude.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ echo -e ".env\n.mcp.json" >> .gitignore
2929
### Remote Server Setup (Streamable HTTP)
3030

3131
> **Note**: For Claude Code versions **2.1.1 and newer**, use the `add-json` command format below. For older versions, see the [legacy command format](#for-older-versions-of-claude-code).
32+
>
33+
> **Windows / CLI note**: `claude mcp add-json` may return `Invalid input` when adding an HTTP server. If that happens, use the legacy `claude mcp add --transport http ...` command format below.
3234
3335
1. Run the following command in the terminal (not in Claude Code CLI):
3436
```bash
@@ -95,6 +97,15 @@ With an environment variable:
9597
claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer $(grep GITHUB_PAT .env | cut -d '=' -f2)"
9698
```
9799

100+
#### Windows (PowerShell)
101+
102+
If you see `missing required argument 'name'`, put the server name immediately after `claude mcp add`:
103+
104+
```powershell
105+
$pat = "YOUR_GITHUB_PAT"
106+
claude mcp add github --transport http https://api.githubcopilot.com/mcp/ -H "Authorization: Bearer $pat"
107+
```
108+
98109
---
99110

100111
## Claude Desktop
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Install GitHub MCP Server in Copilot CLI
2+
3+
## Prerequisites
4+
5+
1. Copilot CLI installed (see [official Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli))
6+
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes
7+
3. For local installation: [Docker](https://www.docker.com/) installed and running
8+
9+
<details>
10+
<summary><b>Storing Your PAT Securely</b></summary>
11+
<br>
12+
13+
To set your PAT as an environment variable:
14+
15+
```bash
16+
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
17+
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
18+
```
19+
20+
</details>
21+
22+
## GitHub MCP Server Configuration
23+
24+
You can configure the GitHub MCP server in Copilot CLI using either the interactive command or by manually editing the configuration file.
25+
26+
### Method 1: Interactive Setup (Recommended)
27+
28+
Use the Copilot CLI to interactively add the MCP server:
29+
30+
```bash
31+
/mcp add
32+
```
33+
34+
Follow the prompts to configure the GitHub MCP server.
35+
36+
### Method 2: Manual Configuration
37+
38+
Create or edit the configuration file `~/.copilot/mcp-config.json` and add one of the following configurations:
39+
40+
#### Remote Server
41+
42+
Connect to the hosted MCP server:
43+
44+
```json
45+
{
46+
"mcpServers": {
47+
"github": {
48+
"url": "https://api.githubcopilot.com/mcp/",
49+
"headers": {
50+
"Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
51+
}
52+
}
53+
}
54+
}
55+
```
56+
57+
#### Local Docker
58+
59+
With Docker running, you can run the GitHub MCP server in a container:
60+
61+
```json
62+
{
63+
"mcpServers": {
64+
"github": {
65+
"command": "docker",
66+
"args": [
67+
"run",
68+
"-i",
69+
"--rm",
70+
"-e",
71+
"GITHUB_PERSONAL_ACCESS_TOKEN",
72+
"ghcr.io/github/github-mcp-server"
73+
],
74+
"env": {
75+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
76+
}
77+
}
78+
}
79+
}
80+
```
81+
82+
#### Binary
83+
84+
You can download the latest binary release from the [GitHub releases page](https://github.com/github/github-mcp-server/releases) or build it from source by running `go build -o github-mcp-server ./cmd/github-mcp-server`.
85+
86+
Then, replacing `/path/to/binary` with the actual path to your binary, configure Copilot CLI with:
87+
88+
```json
89+
{
90+
"mcpServers": {
91+
"github": {
92+
"command": "/path/to/binary",
93+
"args": ["stdio"],
94+
"env": {
95+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
96+
}
97+
}
98+
}
99+
}
100+
```
101+
102+
## Verification
103+
104+
To verify that the GitHub MCP server has been configured:
105+
106+
1. Start or restart Copilot CLI
107+
2. The GitHub tools should be available for use in your conversations
108+
109+
## Troubleshooting
110+
111+
### Local Server Issues
112+
113+
- **Docker errors**: Ensure Docker Desktop is running
114+
```bash
115+
docker --version
116+
```
117+
- **Image pull failures**: Try `docker logout ghcr.io` then retry
118+
- **Docker not found**: Install Docker Desktop and ensure it's running
119+
120+
### Authentication Issues
121+
122+
- **Invalid PAT**: Verify your GitHub PAT has correct scopes:
123+
- `repo` - Repository operations
124+
- `read:packages` - Docker image access (if using Docker)
125+
- **Token expired**: Generate a new GitHub PAT
126+
127+
### Configuration Issues
128+
129+
- **Invalid JSON**: Validate your configuration:
130+
```bash
131+
cat ~/.copilot/mcp-config.json | jq .
132+
```
133+
134+
## References
135+
136+
- [Copilot CLI Documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli)

docs/remote-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The Remote GitHub MCP server has optional headers equivalent to the Local server
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.
7070
- `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.
71+
- Equivalent to `GITHUB_INSIDERS` env var or `--insiders` flag for Local server.
7272
- 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.
7373

7474
> **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.

0 commit comments

Comments
 (0)