GitHub MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add github-mcp-f0e5 -- uv run version-control-helper-mcp
README.md

A Model Context Protocol server providing Git version control operations

VersionControlHelperMCP

A Model Context Protocol (MCP) server providing version control operations as tools for AI coding agents. Built specifically for integration with LangChain deepagents and other MCP-compatible LLM workflows.

What is This?

This MCP server exposes Git version control operations as structured tools that Large Language Models (LLMs) and AI agents can invoke programmatically. Instead of executing raw git commands, an AI coding agent can call typed, validated tools like commit_all_changes, rollback_to_commit, or compare_commits through the standardized MCP protocol.

Why Use This?

Problem Solution
AI agents generate code without version history Every code change can be committed automatically
Bad AI-generated code breaks the project Rollback to any previous commit instantly
No visibility into what the agent changed Compare any two commits to see exact diffs
Risk of losing work during agent iterations Branching allows safe experimentation

Installation

Prerequisites

  • Python 3.11+
  • uv package manager
  • Git installed on system

Setup

# Clone the repository
git clone https://github.com/your-repo/VersionControlHelperMCP.git
cd VersionControlHelperMCP

# Install dependencies with uv
uv sync

Running the Server

STDIO Mode (Default)

For local usage with LangChain or other MCP clients:

uv run version-control-helper-mcp

With Default Repository Path

Set REPO_PATH to avoid passing repo_path in every tool call:

REPO_PATH=/path/to/your/project uv run version-control-helper-mcp

Development/Debugging

Use the MCP inspector for testing:

uv run mcp dev src/version_control_helper_mcp/server.py

Available Tools

This server provides 10 tools for complete version control workflows.

1. `initialize_repo`

Purpose: Initialize a new git repository or verify an existing one.

Parameter Type Required Default Description
repo_path string - Absolute path to repository directory
initial_commit boolean true Create initial commit with README

Returns: Status message (e.g., "Initialized repository with initial commit: abc1234")

When to Use:

  • Starting a new project from scratch
  • Before any other git operations on a fresh directory
  • Safe to call on already-initialized repos (will return "Already initialized")

Example:

{
  "tool": "initialize_repo",
  "arguments": {
    "repo_path": "/Users/dev/my-project",
    "initial_commit": true
  }
}

2. `get_repo_status`

Purpose: Check the current state of the repository.

Parameter Type Required Description
repo_path string Absolute path to repository

Returns: JSON object with:

  • is_initialized: Whether git is set up
  • current_branch: Active branch name
  • has_changes: Whether there are uncommitted changes
  • staged_files: Files ready to commit
  • modified_files: Changed but unstaged files
  • untracked_files: New files not yet tracked

When to Use:

  • Before committing, to see what will be included
  • After making changes, to verify modifications
  • To check which branch you're on

3. `commit_all_changes`

Purpose: Stage ALL changes and create a commit in one action.

Parameter Type Required Description
repo_path string Absolute path to repository
message string Commit message describing changes

Returns: Commit SHA (40-character hash) or "No changes to commit"

Behavior:

  • Automatically runs git add -A (stages everything)
  • Creates commit with provided message
  • Lazy initialization: If repo isn't initialized, initializes it first

When to Use:

  • After generating/modifying code, to save a checkpoint
  • Before risky operations, to have a rollback point
  • At logical milestones during development

Best Practices for Commit Messages:

  • Use conventional format: feat:, fix:, docs:, refactor:, test:
  • Be descriptive: "feat: add user authentication with JWT tokens"
  • Reference the change: "fix: resolve null pointer in login handler"

4. `list_commits`

Purpose: Retrieve commit history with details.

Parameter Type Required Default Description
repo_path string - Absolute path to repository
branch string "HEAD" Branch name or "HEAD" for current
limit integer 50 Maximum commits to return

Returns: JSON with array of commits, each containing:

  • sha: Full 40-char commit hash
  • short_sha: 7-char abbreviated hash
  • message: Commit message
  • author: Author name
  • `author_email

Tools (4)

initialize_repoInitialize a new git repository or verify an existing one.
get_repo_statusCheck the current state of the repository.
commit_all_changesStage ALL changes and create a commit in one action.
list_commitsRetrieve commit history with details.

Environment Variables

REPO_PATHAbsolute path to the repository directory to avoid passing it in every tool call

Configuration

claude_desktop_config.json
{"mcpServers": {"version-control-helper": {"command": "uv", "args": ["run", "version-control-helper-mcp"], "env": {"REPO_PATH": "/path/to/your/project"}}}}

Try it

Check the current status of my repository to see what files have been modified.
Commit all my current changes with the message 'feat: add user authentication with JWT tokens'.
List the last 10 commits on the current branch to review recent history.
Initialize the git repository in my current project folder.

Frequently Asked Questions

What are the key features of GitHub MCP Server?

Programmatically manage git repositories via AI agents. Automated staging and committing of all changes. Retrieve detailed commit history and repository status. Support for lazy initialization of git repositories.

What can I use GitHub MCP Server for?

Automatically committing code changes after AI agent generation. Creating rollback points before performing risky code refactoring. Reviewing project history and file status during agent-led development. Standardizing version control workflows for AI-driven coding tasks.

How do I install GitHub MCP Server?

Install GitHub MCP Server by running: git clone https://github.com/your-repo/VersionControlHelperMCP.git && cd VersionControlHelperMCP && uv sync

What MCP clients work with GitHub MCP Server?

GitHub MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep GitHub MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare