Gemini CLI 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).
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
Maintainer
Works with
Installation
Manual Installation
npx gemini-cli-github-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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.
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).
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 pushTrigger 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.
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.
Gemini CLI GitHub Alternatives — Similar Version Control Servers
Looking for alternatives to Gemini CLI GitHub? Here are other popular version control servers you can use with Claude, Cursor, and VS Code.
Ruiyu MA
★ 30.1kConnect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
GitMCP
★ 8.1kTransforms any GitHub repository or GitHub Pages site into a documentation hub for AI assistants using the Model Context Protocol. It allows AI tools to access real-time code and documentation to prevent hallucinations and provide accurate API usage
GitHub Codemunch
★ 1.8kA token-efficient MCP server for exploring GitHub repositories using tree-sitter AST parsing to extract symbol signatures and summaries. It enables users to search and retrieve specific code components while significantly reducing token consumption c
Azure DevOps MCP Server
★ 1.7kThis server provides a convenient API for interacting with Azure DevOps services, enabling AI assistants and other tools to manage work items, code repositories, boards, sprints, and more. Built with the Model Context Protocol, it provides a standard
GitHub Official
★ 1.2kOfficial GitHub integration with comprehensive API coverage
Azure DevOps
★ 367Enables interaction with Azure DevOps through Cursor chat, providing tools to manage builds, pipelines, work items, sprints, and board operations. Supports secure authentication via Personal Access Tokens and allows natural language-driven DevOps tas
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.
Set Up Gemini CLI GitHub in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.