Skip to main content
Glama
GitHub MCP Server

GitHub MCP Server

by jungchihoon

GitHub MCP Server

πŸ”— View on MCP Market πŸ”— View on MCP Registry

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.

🎯 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

Related MCP server: GitHub MCP Server

πŸš€ 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

The fastest way to use GitHub MCP Server is with npx - no installation required!

# Basic Git operations
npx github-mcp-server gstatus
npx github-mcp-server gadd
npx github-mcp-server gcommit "your commit message"
npx github-mcp-server gpush

# Advanced workflows
npx github-mcp-server gflow "implement new feature"
npx github-mcp-server gsync
npx github-mcp-server gbackup

# Or use the short alias
npx gms gstatus
npx gms gflow "quick fix"

πŸ“¦ Global Installation

For frequent use, install globally:

# Using npm
npm install -g github-mcp-server

# Using pnpm (recommended)
pnpm add -g github-mcp-server

# Then use directly
gstatus
gflow "your message"
gsync

πŸ”§ Local Development Installation

See markdown/INSTALLATION.md for detailed installation guide for Windows, macOS, WSL, and all platforms.

πŸ€– MCP Server Integration (Cursor, Claude, etc.)

🎯 Cursor IDEμ—μ„œ MCP μ„œλ²„ μ‚¬μš©ν•˜κΈ°

Cursorμ—μ„œ GitHub MCP Serverλ₯Ό μ‚¬μš©ν•˜λ €λ©΄ λ‹€μŒ 섀정을 μΆ”κ°€ν•˜μ„Έμš”:

File: ~/.cursor/mcp_config.json

πŸ”‘ GitHub 토큰 μ„€μ • (ꢌμž₯)

GitHub 토큰을 μ„€μ •ν•˜λ©΄ 인증 였λ₯˜ 없이 Git μž‘μ—…μ„ μˆ˜ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

  1. GitHub Personal Access Token 생성:

    • GitHub.com β†’ Settings β†’ Developer settings β†’ Personal access tokens β†’ Tokens (classic)

    • "Generate new token" β†’ "Generate new token (classic)"

    • κΆŒν•œ μ„€μ •: repo, workflow, write:packages λ“± ν•„μš”ν•œ κΆŒν•œ 선택

    • 토큰 생성 ν›„ μ•ˆμ „ν•œ 곳에 μ €μž₯

  2. ν™˜κ²½λ³€μˆ˜ μ„€μ •:

    • GITHUB_TOKEN: GitHub Personal Access Token

    • GITHUB_USERNAME: GitHub μ‚¬μš©μžλͺ… (선택사항, κΈ°λ³Έκ°’: 'git')

{
  "mcpServers": {
    "github-mcp-server": {
      "command": "npx",
      "args": ["github-mcp-server-mcp"],
      "env": {
        "GITHUB_TOKEN": "your_github_personal_access_token",
        "GITHUB_USERNAME": "your_github_username"
      },
      "capabilities": ["tools", "resources", "prompts"]
    }
  }
}

πŸ”§ λ‹€λ₯Έ MCP ν΄λΌμ΄μ–ΈνŠΈ μ„€μ •

Claude Desktop

File: ~/.config/claude/claude_desktop_config.json

{
  "mcpServers": {
    "github-mcp-server": {
      "command": "npx",
      "args": ["github-mcp-server", "mcp"],
      "env": {}
    }
  }
}

Continue (VS Code Extension)

File: ~/.continue/config.json

{
  "models": [
    {
      "title": "GitHub MCP Assistant",
      "provider": "anthropic",
      "model": "claude-3-5-sonnet-20241022",
      "contextLength": 200000,
      "mcpServers": [
        {
          "name": "github-mcp-server",
          "command": "npx",
          "args": ["github-mcp-server", "mcp"],
          "env": {}
        }
      ]
    }
  ]
}

πŸš€ MCP μ„œλ²„ 직접 μ‹€ν–‰

npm νŒ¨ν‚€μ§€λ‘œ μ„€μΉ˜λœ MCP μ„œλ²„λ₯Ό 직접 μ‹€ν–‰ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€:

# κΈ€λ‘œλ²Œ μ„€μΉ˜ ν›„
npm install -g github-mcp-server
github-mcp-server mcp

# λ˜λŠ” npx둜 직접 μ‹€ν–‰
npx github-mcp-server mcp

πŸ“‹ μ‚¬μš© κ°€λŠ₯ν•œ MCP 도ꡬ듀

MCP μ„œλ²„λ₯Ό 톡해 μ‚¬μš©ν•  수 μžˆλŠ” 29개 Git μž‘μ—…:

  • κΈ°λ³Έ μž‘μ—…: git-status, git-add, git-commit, git-push, git-pull

  • 브랜치 관리: git-branch, git-checkout, git-merge, git-rebase

  • κ³ κΈ‰ μž‘μ—…: git-tag, git-cherry-pick, git-blame, git-bisect

  • μ›Œν¬ν”Œλ‘œμš°: git-flow, git-sync, git-backup, git-clean

**μžμ„Έν•œ 섀정은 markdown/MCP_UNIVERSAL_CONFIG.md**λ₯Ό μ°Έμ‘°ν•˜μ„Έμš”.

πŸš€ Quick Usage Guide

πŸ“ Basic Git Operations

# Check repository status
npx github-mcp-server gstatus

# Add all files and commit
npx github-mcp-server gadd
npx github-mcp-server gcommit "your commit message"

# Push to remote
npx github-mcp-server gpush

# Pull from remote
npx github-mcp-server gpull

# Branch operations
npx github-mcp-server gbranch feature-auth
npx github-mcp-server gcheckout feature-auth

# View history and differences
npx github-mcp-server glog 5
npx github-mcp-server gdiff main

πŸš€ Advanced Workflows

# Complete workflow (add β†’ commit β†’ push)
npx github-mcp-server gflow "implement new feature"

# Quick commit without push
npx github-mcp-server gquick "fix typo"

# Sync with remote (pull β†’ push)
npx github-mcp-server gsync

# Development session management
npx github-mcp-server gdev feature-auth

# Backup and safety
npx github-mcp-server gbackup --emergency

# Repository cleanup
npx github-mcp-server gclean --optimize

πŸ”§ Specialized Git Operations

# Tag management
npx github-mcp-server gtag create v1.0.0 "Release version"

# Merge operations
npx github-mcp-server gmerge feature-branch

# Rebase operations
npx github-mcp-server grebase main

# Cherry-pick specific commit
npx github-mcp-server gcherry abc1234

# Line-by-line authorship
npx github-mcp-server gblame src/app.js

πŸ“š Help and Discovery

# List all available operations
npx github-mcp-server list

# Get help for specific operation
npx github-mcp-server help

# Show basic operations
npx github-mcp-server glist basic

# Show advanced workflows
npx github-mcp-server glist advanced

πŸ—οΈ 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

πŸ”§ 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 glist command 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

License

ISC License

Author

Created for use with AI assistants that support the Model Context Protocol.

Available Tools

30 tools
git-addB

Adds a specific file to the staging area

Inputs: files (required), directory.

git-add-allA

Adds all files to the staging area

Inputs: directory.

git-bisectB

Binary search through commit history to find bugs

Inputs: action (required), directory, commit.

git-blameB

Show line-by-line authorship information for a file

Inputs: filePath (required), directory, lineRange.

git-branchB

Lists all branches or creates a new branch

Inputs: branchName, directory.

git-checkoutB

Switches to a branch or creates and switches to a new branch

Inputs: branchName (required), createNew, directory.

git-cherry-pickB

Apply changes from a specific commit to the current branch

Inputs: commitHash (required), directory.

git-cloneC

Clones a repository

Inputs: url (required), targetDir, directory.

git-commitC

Commits staged files

Inputs: message (required), directory.

git-diffB

Shows differences between commits, branches, or working directory

Inputs: target, directory.

git-flowA

Complete Git workflow: add all changes, commit with message, and push to remote

Inputs: message (required), directory.

git-initB

Initializes a new Git repository

Inputs: directory.

git-logB

Shows commit history

Inputs: maxCount, directory.

git-mergeB

Merge a branch into the current branch with conflict detection

Inputs: branch (required), directory, strategy.

git-pullC

Pulls changes from the remote repository

Inputs: directory.

git-pushC

Pushes committed files to the remote repository

Inputs: directory.

git-quick-commitB

Quick commit with automatic message generation based on changes

Inputs: message (required), directory.

git-rebaseC

Rebase current branch onto another branch or commit

Inputs: directory, target, interactive.

git-remote-addC

Adds a remote repository

Inputs: name (required), url (required), directory.

git-remote-listB

Lists all remote repositories

Inputs: directory.

git-remote-removeB

Removes a remote repository

Inputs: name (required), directory.

git-remote-set-urlB

Changes the URL of an existing remote repository

Inputs: name (required), url (required), directory.

git-removeA

Removes a specific file from the staging area

Inputs: file (required), directory.

git-remove-allB

Removes all files from the staging area

Inputs: directory.

git-resetC

Resets repository to a specific commit or state

Inputs: mode, target, directory.

git-stashB

Stashes current changes

Inputs: message, directory.

git-stash-popC

Applies the most recent stash

Inputs: directory.

git-statusB

Displays the status of the git repository

Inputs: directory.

git-syncB

Synchronize repository: pull from remote, then push local changes

Inputs: directory.

git-tagB

Manage Git tags: create, list, delete, or show tag details

Inputs: directory, action, tagName, message.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 30 tools

    Disambiguation2/5

    Many tools have overlapping purposes, such as multiple ways to add files (git-add, git-add-all, git-flow, git-quick-commit) and commit (git-commit, git-quick-commit, git-flow). The presence of git-sync and git-pull also creates ambiguity. An agent would struggle to choose the correct tool without detailed knowledge.

    Naming Consistency4/5

    All tools start with 'git-' and use lowercase hyphenated names, which is consistent. However, the pattern varies: some are simple verbs (git-clone), others are verb-object (git-add-all), and a few are phrases (git-quick-commit). Minor deviations from a strict verb_noun pattern.

    Tool Count2/5

    With 30 tools, the server exceeds the recommended range for a focused server. Many tools are redundant (e.g., git-add vs git-add-all, git-commit vs git-quick-commit) and could be consolidated. The high count adds complexity without proportional benefit.

    Completeness5/5

    The tool set covers nearly all common Git operations, including init, clone, add, commit, push, pull, branch, merge, rebase, stash, diff, log, blame, bisect, cherry-pick, reset, tag, and remote management. No major gaps for typical Git workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A Model Context Protocol server that enables Large Language Models to interact with Git repositories through a robust API, supporting operations like repository initialization, cloning, file staging, committing, and branch management.
      28
      4,204 npm
      245
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants to perform GitHub operations including repository management, file operations, issue tracking, and pull request creation.
      2
      -
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs to interact with Git repositories, providing tools to read, search, and manipulate Git repositories through commands like status, diff, commit, and branch management.
      12
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      A Model Context Protocol server that enables LLMs to interact with Git repositories, providing tools to read, search, and manipulate Git repositories through commands like status, diff, commit, and branch operations.
      22
      4
      MIT