Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
edbdf4b
docs: Add Google Gemini CLI installation guide and integration
ipapapa Jul 26, 2025
89ec9f5
Fix Gemini CLI command syntax and add remote server method
ipapapa Aug 2, 2025
526a6c1
Merge branch 'main' into add-gemini-cli-docs
ipapapa Aug 3, 2025
0127628
Emphasize official Gemini CLI documentation link
ipapapa Aug 5, 2025
a6e2426
Fix Gemini CLI configuration file name: config.json -> settings.json
ipapapa Aug 8, 2025
bc96391
Remove Gemini CLI installation and authentication sections
ipapapa Aug 8, 2025
79e0782
Add Podman as Docker alternative in prerequisites
ipapapa Aug 8, 2025
6bfae0d
Remove references to deprecated npm package
ipapapa Aug 8, 2025
c52a1de
Add comprehensive ~/.gemini/.env file example
ipapapa Aug 8, 2025
e5e7bfd
Fix authorization header to use literal token placeholder
ipapapa Aug 8, 2025
d6696f6
Merge branch 'main' into add-gemini-cli-docs
ipapapa Aug 14, 2025
7e73679
Add issue types (#869)
JoannaaKL Aug 14, 2025
8f794ab
Enable Dependabot (#654)
zkoppert Aug 14, 2025
660967c
Bump SDK version to 0.36.0 (#863)
almaleksia Aug 14, 2025
83c67d1
Use server.ServerResourceTemplate and server.ServerPrompt wrappers (#…
almaleksia Aug 14, 2025
0d4dca9
Update "Close inactive issues" workflow to close issues after 180 day…
tommaso-moro Aug 18, 2025
34434aa
Update Claude MCP install guide after testing (#706)
D1M1TR10S Aug 18, 2025
fc381f8
Add actions job log buffer and profiler (#866)
mattdholloway Aug 19, 2025
615cc60
Add get_release_by_tag tool (#938)
tommaso-moro Aug 21, 2025
72a7214
docs(readme): Update readme to point to correct installation guides i…
beccccaboo Aug 21, 2025
cd4454e
Add Global Security Advisories Toolset (#919)
jurre Aug 21, 2025
ad3bf32
Repository security advisories (#925)
jurre Aug 21, 2025
6d4e070
Update Cursor installation link (#940)
tommaso-moro Aug 21, 2025
b33df25
Change role from "system" to "user" in prompt messages for `AssignCod…
tommaso-moro Aug 21, 2025
7acaad0
Resolve merge conflict with latest upstream main
ipapapa Aug 28, 2025
60fa301
Merge branch 'main' into add-gemini-cli-docs
LuluBeatson Aug 29, 2025
39db9e7
Local MCP is supported
LuluBeatson Aug 29, 2025
ff86293
Refactor Gemini CLI install guide
LuluBeatson Aug 29, 2025
f2e5ad7
Remove Bearer from Authorization header
ipapapa Aug 29, 2025
26d9139
Add reference to main README for latest config
ipapapa Aug 31, 2025
f86124e
Bearer needed for headers, add references
LuluBeatson Sep 2, 2025
12040db
Add minimal response to CRUD tools, `repositories` and `search` tools…
mattdholloway Sep 1, 2025
f898f17
initial org repo create support (#1023)
mattdholloway Sep 2, 2025
f6718c7
Merge branch 'main' into add-gemini-cli-docs
LuluBeatson Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ For other MCP host applications, please refer to our installation guides:

- **[GitHub Copilot in other IDEs](/docs/installation-guides/install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
- **[Claude Code & Claude Desktop](docs/installation-guides/install-claude.md)** - Installation guide for Claude Code and Claude Desktop
- **[Cursor](docs/installation-guides/install-cursor.md)** - Installation guide for Cursor IDE
- **[Cursor](docs/installation-guides/install-cursor.md)** - Installation guide for Cursor IDE
- **[Google Gemini CLI](docs/installation-guides/install-gemini-cli.md)** - Installation guide for Google Gemini CLI
- **[Windsurf](docs/installation-guides/install-windsurf.md)** - Installation guide for Windsurf IDE

For a complete overview of all installation options, see our **[Installation Guides Index](docs/installation-guides/installation-guides.md)**.
Expand Down
2 changes: 2 additions & 0 deletions docs/installation-guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This directory contains detailed installation instructions for the GitHub MCP Se
- **[GitHub Copilot in other IDEs](install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
- **[Claude Applications](install-claude.md)** - Installation guide for Claude Web, Claude Desktop and Claude Code CLI
- **[Cursor](install-cursor.md)** - Installation guide for Cursor IDE
- **[Google Gemini CLI](install-gemini-cli.md)** - Installation guide for Google Gemini CLI
- **[Windsurf](install-windsurf.md)** - Installation guide for Windsurf IDE

## Support by Host Application
Expand All @@ -19,6 +20,7 @@ This directory contains detailed installation instructions for the GitHub MCP Se
| Claude Code | ✅ | ✅ PAT + ❌ No OAuth| GitHub MCP Server binary or remote URL, GitHub PAT | Easy |
| Claude Desktop | ✅ | ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Moderate |
| Cursor | ✅ | ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
| Google Gemini CLI | ✅ | ❌ Not yet supported | Docker or Go build, GitHub PAT, Gemini API key | Easy |
| Windsurf | ✅ | ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
| Copilot in Xcode | ✅ | ✅ PAT + ❌ No OAuth | Local: Docker or Go build, GitHub PAT<br>Remote: Copilot for Xcode latest version | Easy |
| Copilot in Eclipse | ✅ | ✅ PAT + ❌ No OAuth | Local: Docker or Go build, GitHub PAT<br>Remote: TBD | Easy |
Expand Down
333 changes: 333 additions & 0 deletions docs/installation-guides/install-gemini-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,333 @@
# Install GitHub MCP Server in Google Gemini CLI

## Prerequisites
1. Google Gemini CLI installed (see [Installation Options](#installation-options))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: should a guide on installing gemini-cli be in here? or just a link to the gemini-cli github page for instructions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! I've kept a brief installation section for user convenience (just the basic commands for npm, npx, and Homebrew) but added a link to the https://github.com/google-gemini/gemini-cli for more detailed installation options. This way users get the essentials quickly but can dive deeper if needed. What do you think of this approach?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly just worried that this information falls behind and perhaps a link to gemini-cli's installation is more robust.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I have made a few changes to emphasize the official documentation link first - making it clear users should go there for up-to-date instructions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the information for how to install Gemini CLI belongs here. AFAIK the analogous information is not in the README files for other tools. Eg for Windsurf, the install guide talks about how to install github-mcp-server for Windsurf, not how to install windsurf.

2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes
3. For local installation: [Docker](https://www.docker.com/) installed and running

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or Podman. (https://podman.io)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not used Podman but based on my quick check it has Docker command compatibility, so I have added it: 79e0782

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case there is any doubt.... I use podman with this server and with gemini-cli, and it works great - no surprise here.


## Installation Options

### Option 1: npm (Global Installation)
```bash
npm install -g @google/gemini-cli
```

### Option 2: npx (No Installation Required)
```bash
npx @google/gemini-cli
```

### Option 3: Homebrew
```bash
brew install gemini-cli
```

For more detailed installation instructions, see the [official Gemini CLI documentation](https://github.com/google-gemini/gemini-cli).

## Authentication Setup

Before using Gemini CLI, you need to authenticate with Google:

### Using Gemini API Key (Recommended)
1. Get your API key from [Google AI Studio](https://makersuite.google.com/app/apikey)
2. Set it as an environment variable:
```bash
export GEMINI_API_KEY=your_api_key_here
```

### Using Vertex AI
1. Configure Google Cloud credentials for Vertex AI
2. Set the project ID:
```bash
export GOOGLE_CLOUD_PROJECT=your_project_id
```

## GitHub MCP Server Configuration

### Method 1: Remote Server (Recommended)

The simplest way is to use GitHub's hosted MCP server:

```json
{
"mcpServers": {
"github": {
"httpUrl": "https://api.githubcopilot.com/mcp/",
"trust": true,
"headers": {
"Authorization": "Bearer ${GITHUB_PAT}"
}
}
}
}
```

Store your GitHub token in `~/.gemini/.env`:
```bash
GITHUB_PAT=your_github_token_here
```

### Method 2: Local Docker Setup (Alternative)

**Important**: The npm package `@modelcontextprotocol/server-github` is no longer supported as of April 2025. Use the official Docker image `ghcr.io/github/github-mcp-server` instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omit "Important: The npm package @modelcontextprotocol/server-github is no longer supported as of April 2025."

This doc page is being added in August 2025. No need to reference old stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: 6bfae0d


### Docker Configuration

```json
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"
}
}
}
}
```

### Binary Configuration (Alternative)

If you prefer not to use Docker, you can build from source:

```bash
# Clone and build the server
git clone https://github.com/github/github-mcp-server.git
cd github-mcp-server
go build -o github-mcp-server ./cmd/github-mcp-server
```

Then configure:

```json
{
"mcpServers": {
"github": {
"command": "/path/to/github-mcp-server",
"args": ["stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"
}
}
}
}
```

## Installation Steps

### Configuration File Location

Gemini CLI uses a settings JSON file to configure MCP servers:

- **Global configuration**: `~/.gemini/config.json`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it not settings.json ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups my mistake, I have fixed it: a6e2426

- **Project-specific**: `.gemini/config.json` in your project directory

### Setup Steps

1. Create or edit your settings file with your chosen configuration from above
2. Replace `YOUR_GITHUB_PAT` with your actual [GitHub Personal Access Token](https://github.com/settings/tokens)
3. Save the file
4. Restart Gemini CLI if it was running

### Using Environment Variables (Recommended)

For better security, use environment variables:

```json
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT"
}
}
}
}
```

Then set the environment variable:
```bash
export GITHUB_PAT=your_github_pat
```

## Configuration Options

### Toolset Configuration

Enable specific GitHub API capabilities:

```json
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"-e",
"GITHUB_TOOLSETS",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT",
"GITHUB_TOOLSETS": "repos,issues,pull_requests,actions"
}
}
}
}
```

### Read-Only Mode

For security, run the server in read-only mode:

```json
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"-e",
"GITHUB_READ_ONLY",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT",
"GITHUB_READ_ONLY": "1"
}
}
}
}
```

### GitHub Enterprise Support

For GitHub Enterprise Server or Enterprise Cloud with data residency:

```json
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"-e",
"GITHUB_HOST",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT",
"GITHUB_HOST": "https://your-github-enterprise.com"
}
}
}
}
```

## Verification

After configuration, verify the installation:

1. **Check MCP server status**:
```bash
gemini --prompt "/mcp list"
```

2. **List available tools**:
```bash
gemini --prompt "/tools"
```

3. **Test with a simple command**:
```bash
gemini "List my GitHub repositories"
```

## Usage Examples

Once configured, use natural language commands:

```bash
# Repository operations
gemini "Show me the latest commits in microsoft/vscode"

# Issue management
gemini "Create an issue titled 'Bug report' in my-org/my-repo"

# Pull request operations
gemini "Review the latest pull request in my repository"

# Code analysis
gemini "Analyze the security alerts in my repositories"
```

## Troubleshooting

### Local Server Issues
- **Docker errors**: Ensure Docker Desktop is running
```bash
docker --version
```
- **Image pull failures**: Try `docker logout ghcr.io` then retry
- **Docker not found**: Install Docker Desktop and ensure it's running

### Authentication Issues
- **Invalid PAT**: Verify your GitHub PAT has correct scopes:
- `repo` - Repository operations
- `read:packages` - Docker image access (if using Docker)
- **Token expired**: Generate a new GitHub PAT

### Configuration Issues
- **Invalid JSON**: Validate your configuration:
```bash
cat ~/.gemini/config.json | jq .
```
- **MCP connection issues**: Check logs for connection errors:
```bash
gemini --debug "test command"
```

### Debug Mode

Enable debug mode for detailed logging:

```bash
gemini --debug "Your command here"
```

## Important Notes

- **Official repository**: [github/github-mcp-server](https://github.com/github/github-mcp-server)
- **Docker image**: `ghcr.io/github/github-mcp-server` (official and supported)
- **npm package**: `@modelcontextprotocol/server-github` (deprecated as of April 2025 - no longer functional)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omit

Copy link
Contributor Author

@ipapapa ipapapa Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I have removed the deprecated npm package in this commit 6bfae0d

- **Gemini CLI specifics**: Uses `mcpServers` key, supports both global and project configurations
- **Remote server method**: Preferred approach using GitHub's hosted MCP server at `https://api.githubcopilot.com/mcp/`