From 243c78cac5be709843a09d33774c8c3e0dd4dbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Medrano=20Llamas?= Date: Thu, 24 Jul 2025 22:42:51 +0100 Subject: [PATCH 1/3] docs: add Gemini CLI installation guide --- docs/installation-guides/README.md | 1 + docs/installation-guides/install-gemini.md | 75 ++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 docs/installation-guides/install-gemini.md diff --git a/docs/installation-guides/README.md b/docs/installation-guides/README.md index f55cc6bef..b7f128026 100644 --- a/docs/installation-guides/README.md +++ b/docs/installation-guides/README.md @@ -7,6 +7,7 @@ This directory contains detailed installation instructions for the GitHub MCP Se - **[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 - **[Windsurf](install-windsurf.md)** - Installation guide for Windsurf IDE +- **[Gemini CLI](install-gemini.md)** - Installation guide for Gemini CLI ## Support by Host Application diff --git a/docs/installation-guides/install-gemini.md b/docs/installation-guides/install-gemini.md new file mode 100644 index 000000000..6cf1eb406 --- /dev/null +++ b/docs/installation-guides/install-gemini.md @@ -0,0 +1,75 @@ +# Install GitHub MCP Server in Gemini CLI + +This guide covers installation of the GitHub MCP server for the Gemini CLI. + +## Gemini CLI + +The Gemini CLI provides command-line access to Gemini with MCP server integration. + +### Prerequisites + +1. Gemini CLI installed +2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with `repo`, `read:org`, and `gist` scopes. + +### Installation + +The Gemini CLI can be configured to connect to the remote GitHub MCP server. + +#### Configuration + +1. **Locate your settings file**: The Gemini CLI settings are typically located at `~/.config/google/gemini/settings.json`. +2. **Edit the settings file**: Add the following `mcp_server` configuration to your `settings.json` file. + +```json +{ + "mcp_server": { + "github": { + "display_name": "GitHub", + "url": "https://api.githubcopilot.com/mcp/", + "auth": { + "github_pat": { + "token": "YOUR_GITHUB_PAT" + } + } + } + } +} +``` + +Replace `YOUR_GITHUB_PAT` with your GitHub Personal Access Token. + +#### Using Environment Variables + +For better security, you can reference an environment variable instead of hardcoding the token: + +```json +{ + "mcp_server": { + "github": { + "display_name": "GitHub", + "url": "https://api.githubcopilot.com/mcp/", + "auth": { + "github_pat": { + "token": "$GITHUB_PAT" + } + } + } + } +} +``` + +Then, set the `GITHUB_PAT` environment variable in your shell's configuration file (e.g., `.bashrc`, `.zshrc`): + +```bash +export GITHUB_PAT="your_github_pat" +``` + +### Verification + +Run the following command to verify the installation: + +```bash +gemini status +``` + +You should see the GitHub MCP server listed as a connected tool provider. From c43bc2a5f7c1d9d62fa15bf914f4a4c116800131 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 21:59:06 +0000 Subject: [PATCH 2/3] I am updating the Gemini installation guide to remove the "Bearer" prefix from the documentation. --- docs/installation-guides/install-gemini.md | 104 +++++++++------------ 1 file changed, 46 insertions(+), 58 deletions(-) diff --git a/docs/installation-guides/install-gemini.md b/docs/installation-guides/install-gemini.md index 6cf1eb406..529fcc5e0 100644 --- a/docs/installation-guides/install-gemini.md +++ b/docs/installation-guides/install-gemini.md @@ -2,74 +2,62 @@ This guide covers installation of the GitHub MCP server for the Gemini CLI. -## Gemini CLI - -The Gemini CLI provides command-line access to Gemini with MCP server integration. - -### Prerequisites - -1. Gemini CLI installed -2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with `repo`, `read:org`, and `gist` scopes. - -### Installation - -The Gemini CLI can be configured to connect to the remote GitHub MCP server. - -#### Configuration - -1. **Locate your settings file**: The Gemini CLI settings are typically located at `~/.config/google/gemini/settings.json`. -2. **Edit the settings file**: Add the following `mcp_server` configuration to your `settings.json` file. - +To set up the remote GitHub MCP (Model Context Protocol) on the Gemini CLI, you'll need to configure your Gemini settings to point to the GitHub MCP server and provide a Personal Access Token (PAT) for authentication. + +Here's a step-by-step guide: + +## 1. Prerequisites: +* Node.js and Gemini CLI: Ensure you have Node.js (version 20 or later recommended) and the Gemini CLI installed. If not, you can install the Gemini CLI using npm: + ``` + npm install -g @google/gemini-cli + ``` +* GitHub Personal Access Token (PAT): You need a GitHub PAT with the necessary permissions (at least repo scope for accessing repositories). + * Go to GitHub > Profile > Settings > Developer Settings > Personal Access Tokens. + * Generate a new token, making sure to copy it immediately as you won't be able to see it again. + +## 2. Locate (or Create) your Gemini CLI Configuration File: +The Gemini CLI stores its settings in a settings.json file. This file is typically located in your home directory within a .gemini folder. +* macOS/Linux: + ``` + mkdir -p ~/.gemini + code ~/.gemini/settings.json # or use your preferred editor like nano, vim, etc. + ``` +* Windows: The path will be similar, usually C:\\Users\\\\.gemini\\settings.json. + +## 3. Configure the settings.json file for the Remote GitHub MCP: +Open the settings.json file you located or created and add the following JSON object to configure the GitHub MCP server. If you already have other settings, ensure you add this within the main JSON object. ```json { - "mcp_server": { + "mcpServers": { "github": { - "display_name": "GitHub", - "url": "https://api.githubcopilot.com/mcp/", - "auth": { - "github_pat": { - "token": "YOUR_GITHUB_PAT" - } - } + "httpUrl": "https://api.githubcopilot.com/mcp/", + "headers": { + "Authorization": "YOUR_GITHUB_PAT" + }, + "timeout": 5000 } } } ``` -Replace `YOUR_GITHUB_PAT` with your GitHub Personal Access Token. - -#### Using Environment Variables +**Important:** +* Replace "YOUR_GITHUB_PAT" with the actual Personal Access Token you generated in GitHub. +* The httpUrl for the GitHub MCP server is typically https://api.githubcopilot.com/mcp/. +* The Authorization header should use Bearer followed by your PAT. -For better security, you can reference an environment variable instead of hardcoding the token: - -```json -{ - "mcp_server": { - "github": { - "display_name": "GitHub", - "url": "https://api.githubcopilot.com/mcp/", - "auth": { - "github_pat": { - "token": "$GITHUB_PAT" - } - } - } - } -} +## 4. Save the settings.json file. +## 5. Launch or Restart Gemini CLI: +If your Gemini CLI is already running, you might need to restart it for the new configuration to take effect. Just type gemini at your command prompt. +## 6. Verify MCP Server Installation: +Once Gemini CLI is running, you can verify that the GitHub MCP server is recognized by running the /mcp command at the Gemini CLI prompt: ``` - -Then, set the `GITHUB_PAT` environment variable in your shell's configuration file (e.g., `.bashrc`, `.zshrc`): - -```bash -export GITHUB_PAT="your_github_pat" +/mcp ``` +This should list the configured MCP servers, and you should see "github" among them. -### Verification - -Run the following command to verify the installation: - -```bash -gemini status -``` +### Key Concepts: +* Model Context Protocol (MCP): A standardized way for AI models like Gemini to interact with external tools and data. +* MCP Server: A component that acts as an adapter, exposing a tool's functionality to the AI model. The GitHub MCP server allows Gemini to interact with GitHub repositories. +* Personal Access Token (PAT): A secure alternative to using your GitHub password for authentication, often required for programmatic access. -You should see the GitHub MCP server listed as a connected tool provider. +By following these steps, your Gemini CLI will be set up to leverage the remote GitHub MCP, enabling it to interact with your GitHub repositories for tasks like code analysis, issue tracking, and more. From f1c4e03abd7e92601cc5529c3fe9c84c60bdbbc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Medrano=20Llamas?= <45878745+rmedranollamas@users.noreply.github.com> Date: Fri, 25 Jul 2025 00:02:32 +0200 Subject: [PATCH 3/3] Update install-gemini.md --- docs/installation-guides/install-gemini.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/docs/installation-guides/install-gemini.md b/docs/installation-guides/install-gemini.md index 529fcc5e0..542550aec 100644 --- a/docs/installation-guides/install-gemini.md +++ b/docs/installation-guides/install-gemini.md @@ -43,21 +43,12 @@ Open the settings.json file you located or created and add the following JSON ob **Important:** * Replace "YOUR_GITHUB_PAT" with the actual Personal Access Token you generated in GitHub. * The httpUrl for the GitHub MCP server is typically https://api.githubcopilot.com/mcp/. -* The Authorization header should use Bearer followed by your PAT. -## 4. Save the settings.json file. -## 5. Launch or Restart Gemini CLI: +## 4. Launch or Restart Gemini CLI: If your Gemini CLI is already running, you might need to restart it for the new configuration to take effect. Just type gemini at your command prompt. -## 6. Verify MCP Server Installation: +## 5. Verify MCP Server Installation: Once Gemini CLI is running, you can verify that the GitHub MCP server is recognized by running the /mcp command at the Gemini CLI prompt: ``` /mcp ``` This should list the configured MCP servers, and you should see "github" among them. - -### Key Concepts: -* Model Context Protocol (MCP): A standardized way for AI models like Gemini to interact with external tools and data. -* MCP Server: A component that acts as an adapter, exposing a tool's functionality to the AI model. The GitHub MCP server allows Gemini to interact with GitHub repositories. -* Personal Access Token (PAT): A secure alternative to using your GitHub password for authentication, often required for programmatic access. - -By following these steps, your Gemini CLI will be set up to leverage the remote GitHub MCP, enabling it to interact with your GitHub repositories for tasks like code analysis, issue tracking, and more. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy