Gemini CLI GitHub

v1.0.0Version Controlstable

To fully automate documentation updates using Gemini CLI with the GitHub MCP server when a branch is pushed to main, you need to combine Gemini's MCP integration with a CI/CD workflow (such as GitHub Actions).

ci-cdgemini-cligithubgithub-actionsmcp
Share:
8
Stars
0
Downloads
0
Weekly
0/5

What is Gemini CLI GitHub?

Gemini CLI GitHub is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to to fully automate documentation updates using gemini cli with the github mcp server when a branch is pushed to main, you need to combine gemini's mcp integration with a ci/cd workflow (such as github ...

To fully automate documentation updates using Gemini CLI with the GitHub MCP server when a branch is pushed to main, you need to combine Gemini's MCP integration with a CI/CD workflow (such as GitHub Actions).

This server falls under the Version Control category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • To fully automate documentation updates using Gemini CLI wit

Use Cases

Automate documentation updates when code is pushed to main.
LicenseMIT
Languagejavascript
Versionv1.0.0
UpdatedFeb 25, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx gemini-cli-github-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Gemini CLI GitHub

Gemini CLI GitHub MCP automates documentation updates by combining Google's Gemini CLI with the GitHub MCP server inside a GitHub Actions workflow. When code is pushed to the main branch, Gemini reads your source files via the GitHub MCP integration and generates or updates documentation automatically, then commits and pushes the result back to the repository.

Prerequisites

  • A GitHub repository with Actions enabled
  • A GitHub Personal Access Token with repo read/write permissions stored as the secret PERSONAL_ACCESS_TOKEN
  • Node.js available in the CI runner (the workflow installs it automatically)
  • Gemini CLI installable via npm (included in the workflow steps)
  • Basic familiarity with GitHub Actions YAML syntax
1

Create repository secrets

In your GitHub repository, navigate to Settings > Secrets and variables > Actions. Add a secret named PERSONAL_ACCESS_TOKEN containing a GitHub token with repo read and write permissions. The GITHUB_TOKEN secret is provided automatically by GitHub Actions.

2

Set optional repository variables

Optionally configure repository variables to customise directory paths and behaviour. Navigate to Settings > Secrets and variables > Actions > Variables and add any of the following: INPUT_DIR (default: src/), OUTPUT_DIR (default: docs/), COMMIT_MESSAGE, ENABLE_AUTO_PUSH (default: true), or CLEAN_CACHE (default: true).

3

Create the GitHub Actions workflow file

Add a workflow file at .github/workflows/docs-update.yml. The workflow installs Node.js, installs Gemini CLI, writes the MCP configuration pointing at the GitHub MCP server, then runs Gemini CLI against your source directory to produce updated documentation.

name: Auto Update Docs with Gemini CLI + MCP
on:
  push:
    branches: [main]
    paths:
      - 'src/**'
  workflow_dispatch:
    inputs:
      input_dir:
        description: 'Source directory'
        default: 'src/'
      output_dir:
        description: 'Output directory'
        default: 'docs/'
jobs:
  update-docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Install Gemini CLI
        run: npm install -g @google/gemini-cli
      - name: Write MCP config
        run: |
          mkdir -p .gemini
          cat > .gemini/settings.json <<'EOF'
          {
            "mcpServers": {
              "github": {
                "command": "npx",
                "args": ["-y", "@modelcontextprotocol/server-github"],
                "env": {
                  "GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
                }
              }
            }
          }
          EOF
      - name: Generate docs
        run: gemini -p "Read all files in ${{ vars.INPUT_DIR || 'src/' }} and generate documentation to ${{ vars.OUTPUT_DIR || 'docs/' }}"
      - name: Commit and push
        run: |
          git config user.email "[email protected]"
          git config user.name "GitHub Actions"
          git add docs/
          git diff --staged --quiet || git commit -m "${{ vars.COMMIT_MESSAGE || 'docs: auto-update via Gemini CLI + MCP' }}"
          git push
4

Trigger the workflow manually

Go to the Actions tab of your repository, select the 'Auto Update Docs with Gemini CLI + MCP' workflow, and click 'Run workflow'. You can override the input and output directories at trigger time without editing the YAML file.

5

Verify documentation output

After the workflow completes, inspect the output directory (default: docs/) for newly generated or updated Markdown files. Check the Actions run log for any Gemini CLI errors and confirm the commit appears in the repository history.

Gemini CLI GitHub Examples

Client configuration

MCP settings file for Gemini CLI pointing at the GitHub MCP server with a personal access token.

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_yourTokenHere"
      }
    }
  }
}

Prompts to try

Example Gemini CLI prompts that leverage the GitHub MCP server to automate documentation tasks.

- "Read all TypeScript files in src/ and generate API reference documentation in docs/api/"
- "Summarise the open pull requests in this repository and write a CHANGELOG entry"
- "Compare the source files changed in the last commit and update the relevant documentation pages"

Troubleshooting Gemini CLI GitHub

Workflow fails with 'Permission denied' when pushing the documentation commit

Ensure PERSONAL_ACCESS_TOKEN has 'Contents: Read and write' permission. If using a fine-grained token, also enable 'Actions: Read' so the workflow can check out the repository.

Gemini CLI cannot find or connect to the GitHub MCP server

Verify that .gemini/settings.json is created before the Gemini CLI step runs and that the GITHUB_PERSONAL_ACCESS_TOKEN environment variable is correctly interpolated. Run 'cat .gemini/settings.json' in a debug step to inspect the written file.

No documentation files are committed because git diff reports no changes

The workflow already guards against empty commits with 'git diff --staged --quiet || git commit'. If docs are not updated, check that the Gemini prompt explicitly writes files to the output directory and that the output path is correct.

Frequently Asked Questions about Gemini CLI GitHub

What is Gemini CLI GitHub?

Gemini CLI GitHub is a Model Context Protocol (MCP) server that to fully automate documentation updates using gemini cli with the github mcp server when a branch is pushed to main, you need to combine gemini's mcp integration with a ci/cd workflow (such as github actions). It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Gemini CLI GitHub?

Follow the installation instructions on the Gemini CLI GitHub GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Gemini CLI GitHub?

Gemini CLI GitHub works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Gemini CLI GitHub free to use?

Yes, Gemini CLI GitHub is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Version Control MCP Servers

Explore all version control servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "gemini-cli-github-mcp": { "command": "npx", "args": ["-y", "gemini-cli-github-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Gemini CLI GitHub?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides