Skip to content

Commit c345e9b

Browse files
ipapapaJoannaaKLradar07akennethCopilot
authored
docs: Add Google Gemini CLI installation guide and integration (#757)
* docs: Add Google Gemini CLI installation guide and integration - Add comprehensive installation guide for Google Gemini CLI - Include Docker and binary configuration options - Add authentication setup for Gemini API and Vertex AI - Update main README.md to include Gemini CLI in installation guides - Update installation guides index with Gemini CLI entry and support matrix - Follow established documentation patterns and security best practices * Fix Gemini CLI command syntax and add remote server method - Replace all 'gemini-cli' commands with correct 'gemini' syntax - Fix verification commands to use '/mcp list' and '/tools' prompts - Add httpUrl remote server method as primary configuration option - Update config file paths from settings.json to config.json - Correct npx installation command syntax - Add link to official Gemini CLI documentation Addresses feedback from soisyourface in PR review. * Emphasize official Gemini CLI documentation link Reduce detailed installation steps and direct users to official docs for up-to-date instructions, addressing reviewer feedback about maintainability. * Fix Gemini CLI configuration file name: config.json -> settings.json The correct configuration file for Gemini CLI is settings.json, not config.json. This applies to both global (~/.gemini/settings.json) and project-specific (.gemini/settings.json) configurations as confirmed by official documentation. * Remove Gemini CLI installation and authentication sections Removed lines 11-41 containing Gemini CLI installation commands and authentication setup instructions. * Add Podman as Docker alternative in prerequisites Added Podman as container engine option alongside Docker. * Remove references to deprecated npm package * Add comprehensive ~/.gemini/.env file example * Fix authorization header to use literal token placeholder Environment variable substitution in headers is not yet supported by Gemini CLI (see google-gemini/gemini-cli#5282). * Add issue types (#869) * feat: add type to issues * test: add `type` test for create and update issues * Generate docs and toolsnaps * Update pkg/github/issues.go Co-authored-by: Copilot <[email protected]> * Use github ptr --------- Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Alon Kenneth <[email protected]> Co-authored-by: Copilot <[email protected]> * Enable Dependabot (#654) * Create/Update dependabot.yaml * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * Bump SDK version to 0.36.0 (#863) * Use server.ServerResourceTemplate and server.ServerPrompt wrappers (#886) * Update "Close inactive issues" workflow to close issues after 180 days of inactivity (#909) * update PR_DAYS_BEFORE_STALE * update to mark as stale after 60 days * Update Claude MCP install guide after testing (#706) * Revise Claude installation guide - Verified Claude Code installation steps - Identified and documented issues with Claude Desktop setup - Updated installation documentation based on testing * Revise instructions for opening Claude Code Updated recommendations for opening Claude Code. * Update docs/installation-guides/install-claude.md Co-authored-by: Copilot <[email protected]> * Update docs/installation-guides/install-claude.md Co-authored-by: Copilot <[email protected]> * Update installation guide for Claude setup Added installation option for using Claude Code using a release binary. * Change section title for Go Binary installation Updated section title for clarity regarding installation without Docker. * Close double quote in bash command --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: LuluBeatson <[email protected]> Co-authored-by: Matt Holloway <[email protected]> Co-authored-by: Tommaso Moro <[email protected]> * Add actions job log buffer and profiler (#866) * add sliding window for actions logs * refactor: fix sliding * remove trim content * only use up to 1mb of memory for logs * update to tail lines in second pass * add better memory usage calculation * increase window size to 5MB * update test * update vers * undo vers change * add incremental memory tracking * use ring buffer * remove unused ctx param * remove manual GC clear * fix cca feedback * extract ring buffer logic to new package * handle log content processing errors and use correct param for maxjobloglines * fix tailing * account for if tailLines exceeds window size * add profiling thats reusable * remove profiler testing * refactor profiler: introduce safeMemoryDelta for accurate memory delta calculations * linter fixes * Update pkg/buffer/buffer.go Co-authored-by: Copilot <[email protected]> * use flag for maxJobLogLines * add param passing for context window size * refactor: rename contextWindowSize to contentWindowSize for consistency * fix: use tailLines if bigger but only if <= 5000 * fix: limit tailLines to a maximum of 500 for log content download * Update cmd/github-mcp-server/main.go Co-authored-by: Adam Holt <[email protected]> * Update cmd/github-mcp-server/main.go Co-authored-by: Adam Holt <[email protected]> * move profiler to internal/ * update actions test with new profiler location * fix: adjust buffer size limits * make line buffer 1028kb * fix mod path * change test to use same buffer size as normal use * improve test for non-sliding window implementation to not count empty lines * make test memory measurement more accurate * remove impossible conditional --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Adam Holt <[email protected]> * Add get_release_by_tag tool (#938) * add get_release_by_tag tool * add tool * add tests * autogen * remove comment * docs(readme): Update readme to point to correct installation guides index (#892) * docs(readme): Update readme to point to correct installation guides index * feat(contributors): add list_repository_contributors tool * Revert "feat(contributors): add list_repository_contributors tool" This reverts commit ece480e. --------- Co-authored-by: Tommaso Moro <[email protected]> * Add Global Security Advisories Toolset (#919) * Repository security advisories (#925) * Add support for listing repo level security advisories * Add support for listing repo security advisories at the org level * Update Cursor installation link (#940) * use new link * update local install link * Change role from "system" to "user" in prompt messages for `AssignCodingAgentPrompt` and `IssueToFixWorkflowPrompt`. Role "system" is not allowed by Claude Code in MCP provided prompt (allowed only role "user" and "assistant") (#941) Co-authored-by: 0xGosu <[email protected]> * Local MCP is supported * Refactor Gemini CLI install guide * Remove Bearer from Authorization header * Add reference to main README for latest config * Bearer needed for headers, add references * Add minimal response to CRUD tools, `repositories` and `search` toolsets (#988) * add comprehensive minimal response where appropriate * remove unneeded comments * remove incorrect diff param * update docs * rm comment * Update pkg/github/repositories.go Co-authored-by: Lulu <[email protected]> * update toolsnaps and docs * change minimal_output to use new OptionalBoolParamWithDefault * Update pkg/github/repositories.go Co-authored-by: Lulu <[email protected]> * refactor minimal conversion funcs to minimal_types.go * consolidate response structs and remove unneeded message field * consolidate response further * remove CloneURL field * Update pkg/github/repositories.go Co-authored-by: Copilot <[email protected]> * Update pkg/github/server.go Co-authored-by: Copilot <[email protected]> * fix undefined * change incorrect comment * remove old err var declaration * Update pkg/github/repositories.go Co-authored-by: Copilot <[email protected]> * fix syntax issue * update toolsnaps --------- Co-authored-by: Lulu <[email protected]> Co-authored-by: Copilot <[email protected]> * initial org repo create support (#1023) --------- Co-authored-by: JoannaaKL <[email protected]> Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Alon Kenneth <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Zack Koppert <[email protected]> Co-authored-by: Ksenia Bobrova <[email protected]> Co-authored-by: Tommaso Moro <[email protected]> Co-authored-by: Dimitrios Philliou <[email protected]> Co-authored-by: LuluBeatson <[email protected]> Co-authored-by: Matt Holloway <[email protected]> Co-authored-by: Adam Holt <[email protected]> Co-authored-by: Rebecca Biju <[email protected]> Co-authored-by: Jurre <[email protected]> Co-authored-by: 0xGosu <[email protected]> Co-authored-by: Lulu <[email protected]>
1 parent a8c0293 commit c345e9b

File tree

3 files changed

+159
-0
lines changed

3 files changed

+159
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ For other MCP host applications, please refer to our installation guides:
242242
- **[GitHub Copilot in other IDEs](/docs/installation-guides/install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
243243
- **[Claude Code & Claude Desktop](docs/installation-guides/install-claude.md)** - Installation guide for Claude Code and Claude Desktop
244244
- **[Cursor](docs/installation-guides/install-cursor.md)** - Installation guide for Cursor IDE
245+
- **[Google Gemini CLI](docs/installation-guides/install-gemini-cli.md)** - Installation guide for Google Gemini CLI
245246
- **[Windsurf](docs/installation-guides/install-windsurf.md)** - Installation guide for Windsurf IDE
246247

247248
For a complete overview of all installation options, see our **[Installation Guides Index](docs/installation-guides)**.

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)