Run safe Git operations from your AI assistant
Model Context Protocol server giving AI assistants 29 safe Git operations plus workflow combinations for managing repositories.
2.3.0Add to Favorites
Why it matters
Let an AI assistant run real Git repository operations safely through a single MCP interface.
Outcomes
What it gets done
Run everyday Git operations - status, add, commit, push, pull, branch - from an AI assistant.
Execute advanced version control: tag, merge, rebase, cherry-pick, blame, and bisect.
Chain multi-step workflow combinations like add-commit-push in one call.
Use the bundled CLI wrapper for terminal access and automation.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-github | bash Capabilities
Tools your agent gets
Add files to staging area (git add)
Create commits (git commit)
Push changes (git push)
Pull changes (git pull)
Repository status (git status)
Manage branches (git branch)
Switch branches (git checkout)
Commit history (git log)
Overview
GitHub MCP Server
What it does
GitHub MCP Server is a Model Context Protocol server that exposes 29 Git operations plus a set of workflow combinations to AI assistants and developers. It bridges AI models with real Git repositories through a standardized MCP interface, so an assistant can manage complex version-control workflows safely rather than shelling out to raw commands.
When to use - and when NOT to
Use it when you want an AI assistant (for example GitHub Copilot in VS Code) to perform Git work directly - staging, committing, branching, and advanced operations - with validation that helps prevent common mistakes. It suits developers automating repetitive Git flows and teams standardizing on MCP tooling. It is a client-side Git operations layer, not a hosted GitHub API service, so it acts on repositories you already have checked out locally.
Capabilities
Basic operations (17) cover the daily commands: file staging, status and history, commits, push and pull, branch and remote management, stash, and reset. Advanced operations (12) add tags, merging, rebasing, cherry-pick, blame, and bisect, along with workflow combinations that complete full flows - add to commit to push, quick commits, and sync - plus maintenance tools for cleanup and backup.
How to install
Add it to .vscode/mcp.json with npx -y @0xshariq/github-mcp-server@latest, install globally with pnpm i -g @0xshariq/github-mcp-server@latest, or clone and set up symbolic links when you prefer no package manager. After install, terminal shortcuts like gstatus, gadd, glog, and gpush are available.
Who it's for
Developers and AI-assistant users who want safe, structured Git control from inside their editor or agent, and teams building automation on top of a consistent MCP interface instead of brittle shell scripts.
Source README
Github MCP Server
π View on MCP Market
π View on MCP Registry
π¦ Available on npm
A Model Context Protocol (MCP) server that provides 29 Git operations + 11 workflow combinations for AI assistants and developers. This server exposes comprehensive Git repository management through a standardized interface, enabling AI models and developers to safely manage complex version control workflows.
π Quick Installation
Option 1: .vscode/mcp.json (Recommended)
{
"mcpServers": {
"github-mcp-server": {
"command": "npx",
"args": ["-y", "@0xshariq/github-mcp-server@latest"]
}
}
}
Option 2: For CLI
pnpm i -g @0xshariq/github-mcp-server@latest
# Test Commands After Installation
gstatus
gadd
glog 10
gpush
Option 3: Symbolic Links (Alternative - No Package Manager)
# Clone and setup
git clone https://github.com/0xshariq/github-mcp-server.git
cd github-mcp-server
npm install && npm run build
# Create symbolic links (cross-platform)
./setup-symbolic.sh --user # User installation
# OR
sudo ./setup-symbolic.sh # System-wide (Linux/macOS)
# Test the installation
gstatus
glist
π οΈ Having Issues? If commands aren't working after installation, see our Complete Troubleshooting Guide for solutions to all common problems including "command not found" errors, path conflicts, PNPM issues, and the symbolic links alternative.
π― About
GitHub MCP Server bridges AI assistants with Git repositories and provides powerful developer productivity tools. It provides:
- Safe Git operations through a standardized MCP interface (29 operations)
- Complete version control capabilities including advanced operations (tag, merge, rebase, cherry-pick, blame, bisect)
- 31 workflow combinations for enhanced developer productivity
- Advanced developer tools (backup, cleanup, workflow automation)
- Error handling and validation to prevent common Git mistakes
- Direct integration with VS Code and AI assistants like GitHub Copilot
- CLI wrapper for terminal access and automation
π Features Overview
This server provides comprehensive Git repository management through two main categories:
π Basic Git Operations (17 operations)
Essential daily Git commands organized in bin/basic/ - see Basic Operations Guide for detailed documentation.
- File Management: Add, remove files from staging area
- Repository Information: Status, history, differences
- Commit Operations: Create commits, push, pull
- Branch Management: Create, switch branches
- Remote Management: Add, remove, configure remotes
- Stash Operations: Temporarily save changes
- Reset Operations: Repository state management
π Advanced Git Operations (12 operations)
Sophisticated workflows and automation in bin/advanced/ - see Advanced Workflows Guide for comprehensive documentation.
- Workflow Combinations: Complete flows (addβcommitβpush), quick commits, sync operations
- Development Tools: Smart development workflows, backup systems
- Advanced Git Features: Tags, merging, rebasing, cherry-picking, blame, bisect
- Maintenance & Safety: Repository cleanup, optimization, backup management
- Professional Workflows: Release management, hotfix procedures, team collaboration
π οΈ Installation
See markdown/INSTALLATION.md for detailed installation guide for Windows, macOS, WSL, and all platforms.
ποΈ Project Structure & Architecture
GitHub MCP Server is organized for clarity and progressive learning:
github-mcp-server/
βββ src/
β βββ index.ts # MCP server (29 tool registrations, schema definitions)
β βββ github.ts # Git operations engine (all 29 implementations)
βββ bin/
β βββ basic/ # π 17 Essential Git Operations
β β βββ README.md # Comprehensive basic operations guide
β β βββ gadd.js # Add files (git add)
β β βββ gcommit.js # Create commits (git commit)
β β βββ gpush.js # Push changes (git push)
β β βββ gpull.js # Pull changes (git pull)
β β βββ gstatus.js # Repository status (git status)
β β βββ gbranch.js # Branch management (git branch)
β β βββ gcheckout.js # Branch switching (git checkout)
β β βββ glog.js # Commit history (git log)
β β βββ gdiff.js # Show differences (git diff)
β β βββ gstash.js # Stash operations (git stash)
β β βββ gpop.js # Apply stash (git stash pop)
β β βββ greset.js # Reset operations (git reset)
β β βββ gclone.js # Clone repositories (git clone)
β β βββ gremote.js # Remote management (git remote)
β β βββ ginit.js # Initialize repository (git init)
β βββ advanced/ # π 13 Advanced Workflows & Automation
β βββ README.md # Comprehensive advanced workflows guide
β βββ gflow.js # Complete workflow (addβcommitβpush)
β βββ gquick.js # Quick commit workflow
β βββ gsync.js # Sync workflow (pullβpush)
β βββ gdev.js # Development session management
β βββ gworkflow.js # Professional workflow combinations
β βββ gfix.js # Smart fix and patch workflows
β βββ gfresh.js # Fresh start workflows
β βββ gbackup.js # Backup and safety operations
β βββ gclean.js # Repository cleanup and optimization
β βββ gsave.js # Save and preserve workflows
β βββ glist.js # Tool discovery and help system
β βββ grelease.js # Release management workflows
β βββ common.js # Shared utilities and helpers
βββ markdown/
β βββ INSTALLATION.md # Detailed installation guide
β βββ DEPLOY.md # Production deployment guide
β βββ DOCKER.md # Docker setup and deployment guide
β βββ QUICK_REFERENCES.md # Copy-paste command reference
βββ mcp-cli.js # Enhanced CLI wrapper (organized by structure)
βββ package.json # Project configuration & npm scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # This comprehensive guide
π Documentation Structure
- bin/basic/README.md - Complete guide to 17 essential Git operations
- bin/advanced/README.md - Comprehensive advanced workflows documentation
- markdown/INSTALLATION.md - Step-by-step installation for all platforms
- markdown/TROUBLESHOOTING.md - π οΈ Complete troubleshooting guide - Solutions to all common issues
- markdown/MCP_UNIVERSAL_CONFIG.md - Universal MCP configuration for all LLM clients
- markdown/QUICK_REFERENCES.md - Copy-paste commands for quick reference
- markdown/DOCKER.md - Docker setup, deployment, and containerization
- markdown/DEPLOY.md - Production deployment and hosting strategies
π§ Technical Architecture
π‘ MCP Server Core (src/index.ts)
- 29 Tool Registrations with complete JSON schemas
- Enhanced Metadata with operation tracking and performance monitoring
- Input Validation using Zod schemas for type safety
- Error Handling Pipeline with timeout protection and meaningful messages
- Cross-platform Compatibility with environment normalization
βοΈ Git Operations Engine (src/github.ts)
- Comprehensive Implementation of all 29 Git operations
- Security Features - Command injection prevention and input sanitization
- Enhanced Error Handling with context-aware messaging for common scenarios
- Performance Monitoring - Operation duration tracking and logging
- Safety Checks - Repository validation and file existence verification
π₯οΈ Enhanced CLI System
- Smart Organization - Tools categorized by basic vs advanced operations
- Directory-Aware Help - References to specific README files for detailed guidance
- Progressive Learning - Clear path from basic to advanced operations
- Tool Discovery - Enhanced
glistcommand with category filtering
π‘οΈ Error Handling & Safety
- π Repository Validation: Ensures directory is a valid Git repository
- π File Existence Checks: Validates files exist before Git operations
- β±οΈ Timeout Protection: 30-second timeout for operations
- π« Input Sanitization: Prevents command injection
- π Detailed Error Messages: Clear, actionable error descriptions
π οΈ Troubleshooting
Having issues with installation or commands not working? We've got you covered! Our comprehensive troubleshooting guide covers solutions to all common problems:
π¨ Most Common Issues & Quick Fixes
| Problem | Quick Solution |
|---|---|
π₯ command not found errors |
unset command_not_found_handle |
| π Path conflicts with PNPM | Remove /5/ from global directory |
| π Commands show help instead of executing | Update wrapper scripts to pass command names |
| π« Permission denied | chmod +x ~/.local/share/pnpm/g* |
π For detailed solutions, step-by-step fixes, and diagnostic tools, see our Complete Troubleshooting Guide
π Quick Diagnostic
# Test if commands are working
gstatus # Should show repository status
env gstatus # Alternative if above fails
which gstatus # Should show path to command
# If still having issues, see TROUBLESHOOTING.md for complete solutions
Author
Created for use with AI assistants that support the Model Context Protocol.
FAQ
Common questions
Trust
How it checks out
Discussion
Questions & comments Β· 0
Sign In Sign in to leave a comment.