Skip to content

Commit 2231b9e

Browse files
authored
Merge branch 'github:main' into main
2 parents ec1742b + 0c5cfc3 commit 2231b9e

22 files changed

+243
-39
lines changed

.github/workflows/code-scanning.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
runner: '["ubuntu-22.04"]'
3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@v5
3939

4040
- name: Initialize CodeQL
4141
uses: github/codeql-action/init@v3

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: Checkout repository
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@v5
3737

3838
# Install the cosign tool except on PR
3939
# https://github.com/sigstore/cosign-installer
@@ -63,7 +63,7 @@ jobs:
6363
# https://github.com/docker/metadata-action
6464
- name: Extract Docker metadata
6565
id: meta
66-
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
66+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
6767
with:
6868
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6969
tags: |

.github/workflows/docs-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818

1919
- name: Set up Go
2020
uses: actions/setup-go@v5

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Check out code
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919

2020
- name: Set up Go
2121
uses: actions/setup-go@v5

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Check out code
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818

1919
- name: Set up Go
2020
uses: actions/setup-go@v5

.github/workflows/license-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Check out code
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Set up Go
1717
uses: actions/setup-go@v5

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: lint
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- uses: actions/setup-go@v5
1818
with:
1919
go-version: stable

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ Alternatively, to manually configure VS Code, choose the appropriate JSON block
8585

8686
> **Note:** Each MCP host application needs to configure a GitHub App or OAuth App to support remote access via OAuth. Any host application that supports remote MCP servers should support the remote GitHub server with PAT authentication. Configuration details and support levels vary by host. Make sure to refer to the host application's documentation for more info.
8787
88-
> ⚠️ **Public Preview Status:** The **remote** GitHub MCP Server is currently in Public Preview. During preview, access may be gated depending on authentication type and surface:
89-
> - OAuth: Subject to GitHub Copilot Editor Preview Policy until GA
90-
> - PAT: Controlled via your organization's PAT policies
91-
> - MCP Servers in Copilot policy: Enables/disables access to all MCP servers in VS Code, with other Copilot editors migrating to this policy in the coming months.
92-
9388
### Configuration
9489
See [Remote Server Documentation](/docs/remote-server.md) on how to pass additional configuration settings to the remote GitHub MCP Server.
9590

@@ -242,6 +237,7 @@ For other MCP host applications, please refer to our installation guides:
242237
- **[GitHub Copilot in other IDEs](/docs/installation-guides/install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
243238
- **[Claude Code & Claude Desktop](docs/installation-guides/install-claude.md)** - Installation guide for Claude Code and Claude Desktop
244239
- **[Cursor](docs/installation-guides/install-cursor.md)** - Installation guide for Cursor IDE
240+
- **[Google Gemini CLI](docs/installation-guides/install-gemini-cli.md)** - Installation guide for Google Gemini CLI
245241
- **[Windsurf](docs/installation-guides/install-windsurf.md)** - Installation guide for Windsurf IDE
246242

247243
For a complete overview of all installation options, see our **[Installation Guides Index](docs/installation-guides)**.
@@ -705,11 +701,6 @@ The following sets of tools are available (all are on by default):
705701
- `pullNumber`: Pull request number (number, required)
706702
- `repo`: Repository name (string, required)
707703

708-
- **get_pull_request_comments** - Get pull request comments
709-
- `owner`: Repository owner (string, required)
710-
- `pullNumber`: Pull request number (number, required)
711-
- `repo`: Repository name (string, required)
712-
713704
- **get_pull_request_diff** - Get pull request diff
714705
- `owner`: Repository owner (string, required)
715706
- `pullNumber`: Pull request number (number, required)
@@ -722,6 +713,11 @@ The following sets of tools are available (all are on by default):
722713
- `pullNumber`: Pull request number (number, required)
723714
- `repo`: Repository name (string, required)
724715

716+
- **get_pull_request_review_comments** - Get pull request review comments
717+
- `owner`: Repository owner (string, required)
718+
- `pullNumber`: Pull request number (number, required)
719+
- `repo`: Repository name (string, required)
720+
725721
- **get_pull_request_reviews** - Get pull request reviews
726722
- `owner`: Repository owner (string, required)
727723
- `pullNumber`: Pull request number (number, required)
@@ -815,6 +811,7 @@ The following sets of tools are available (all are on by default):
815811
- `autoInit`: Initialize with README (boolean, optional)
816812
- `description`: Repository description (string, optional)
817813
- `name`: Repository name (string, required)
814+
- `organization`: Organization to create the repository in (omit to create in your personal account) (string, optional)
818815
- `private`: Whether repo should be private (boolean, optional)
819816

820817
- **delete_file** - Delete file

docs/installation-guides/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This directory contains detailed installation instructions for the GitHub MCP Se
66
- **[GitHub Copilot in other IDEs](install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
77
- **[Claude Applications](install-claude.md)** - Installation guide for Claude Web, Claude Desktop and Claude Code CLI
88
- **[Cursor](install-cursor.md)** - Installation guide for Cursor IDE
9+
- **[Google Gemini CLI](install-gemini-cli.md)** - Installation guide for Google Gemini CLI
910
- **[Windsurf](install-windsurf.md)** - Installation guide for Windsurf IDE
1011

1112
## Support by Host Application
@@ -19,6 +20,7 @@ This directory contains detailed installation instructions for the GitHub MCP Se
1920
| Claude Code || ✅ PAT + ❌ No OAuth| GitHub MCP Server binary or remote URL, GitHub PAT | Easy |
2021
| Claude Desktop || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Moderate |
2122
| Cursor || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
23+
| Google Gemini CLI || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
2224
| Windsurf || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
2325
| Copilot in Xcode || ✅ PAT + ❌ No OAuth | Local: Docker or Go build, GitHub PAT<br>Remote: Copilot for Xcode latest version | Easy |
2426
| Copilot in Eclipse || ✅ PAT + ❌ No OAuth | Local: Docker or Go build, GitHub PAT<br>Remote: TBD | Easy |
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Install GitHub MCP Server in Google Gemini CLI
2+
3+
## Prerequisites
4+
5+
1. Google Gemini CLI installed (see [official Gemini CLI documentation](https://github.com/google-gemini/gemini-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+
For security, avoid hardcoding your token. Create or update `~/.gemini/.env` (where `~` is your home or project directory) with your PAT:
14+
15+
```bash
16+
# ~/.gemini/.env
17+
GITHUB_PAT=your_token_here
18+
```
19+
20+
</details>
21+
22+
## GitHub MCP Server Configuration
23+
24+
MCP servers for Gemini CLI are configured in its settings JSON under an `mcpServers` key.
25+
26+
- **Global configuration**: `~/.gemini/settings.json` where `~` is your home directory
27+
- **Project-specific**: `.gemini/settings.json` in your project directory
28+
29+
After securely storing your PAT, you can add the GitHub MCP server configuration to your settings file using one of the methods below. You may need to restart the Gemini CLI for changes to take effect.
30+
31+
> **Note:** For the most up-to-date configuration options, see the [main README.md](../../README.md).
32+
33+
### Method 1: Remote Server (Recommended)
34+
35+
The simplest way is to use GitHub's hosted MCP server:
36+
37+
```json
38+
// ~/.gemini/settings.json
39+
{
40+
"mcpServers": {
41+
"github": {
42+
"httpUrl": "https://api.githubcopilot.com/mcp/",
43+
"trust": true,
44+
"headers": {
45+
"Authorization": "Bearer $GITHUB_PAT"
46+
}
47+
}
48+
}
49+
}
50+
```
51+
52+
### Method 2: Local Docker
53+
54+
With docker running, you can run the GitHub MCP server in a container:
55+
56+
```json
57+
// ~/.gemini/settings.json
58+
{
59+
"mcpServers": {
60+
"github": {
61+
"command": "docker",
62+
"args": [
63+
"run",
64+
"-i",
65+
"--rm",
66+
"-e",
67+
"GITHUB_PERSONAL_ACCESS_TOKEN",
68+
"ghcr.io/github/github-mcp-server"
69+
],
70+
"env": {
71+
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT"
72+
}
73+
}
74+
}
75+
}
76+
```
77+
78+
### Method 3: Binary
79+
80+
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`.
81+
82+
Then, replacing `/path/to/binary` with the actual path to your binary, configure Gemini CLI with:
83+
84+
```json
85+
// ~/.gemini/settings.json
86+
{
87+
"mcpServers": {
88+
"github": {
89+
"command": "/path/to/binary",
90+
"args": ["stdio"],
91+
"env": {
92+
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT"
93+
}
94+
}
95+
}
96+
}
97+
```
98+
99+
## Verification
100+
101+
To verify that the GitHub MCP server has been configured, start Gemini CLI in your terminal with `gemini`, then:
102+
103+
1. **Check MCP server status**:
104+
105+
```
106+
/mcp list
107+
```
108+
109+
```
110+
ℹConfigured MCP servers:
111+
112+
🟢 github - Ready (96 tools, 2 prompts)
113+
Tools:
114+
- github__add_comment_to_pending_review
115+
- github__add_issue_comment
116+
- github__add_sub_issue
117+
...
118+
```
119+
120+
2. **Test with a prompt**
121+
```
122+
List my GitHub repositories
123+
```
124+
125+
## Troubleshooting
126+
127+
### Local Server Issues
128+
129+
- **Docker errors**: Ensure Docker Desktop is running
130+
```bash
131+
docker --version
132+
```
133+
- **Image pull failures**: Try `docker logout ghcr.io` then retry
134+
- **Docker not found**: Install Docker Desktop and ensure it's running
135+
136+
### Authentication Issues
137+
138+
- **Invalid PAT**: Verify your GitHub PAT has correct scopes:
139+
- `repo` - Repository operations
140+
- `read:packages` - Docker image access (if using Docker)
141+
- **Token expired**: Generate a new GitHub PAT
142+
143+
### Configuration Issues
144+
145+
- **Invalid JSON**: Validate your configuration:
146+
```bash
147+
cat ~/.gemini/settings.json | jq .
148+
```
149+
- **MCP connection issues**: Check logs for connection errors:
150+
```bash
151+
gemini --debug "test command"
152+
```
153+
154+
## References
155+
156+
- Gemini CLI Docs > [MCP Configuration Structure](https://google-gemini.github.io/gemini-cli/docs/tools/mcp-server.html#configuration-structure)

0 commit comments

Comments
 (0)