Git MCP Server

Git MCP Server

Provides comprehensive Git functionality to MCP clients, enabling users to manage repositories through operations like commits, diffs, and branch management via natural language. It automatically detects the current working directory and supports multi-project workflows across different local environments.

Category
Visit Server

README

Git MCP Server

A Model Context Protocol (MCP) server for Git operations that provides comprehensive Git functionality to MCP clients like Claude Desktop.

Features

  • Context-aware: Automatically detects the current project based on working directory
  • Comprehensive Git operations: status, branches, diffs, logs, file contents, commits, and more
  • Multi-project support: Works seamlessly across different project directories
  • Error handling: Proper MCP error responses
  • Branch management: Create, switch, and manage branches
  • Remote operations: Push, pull, and fetch from remote repositories

Installation

Option 1: Global Installation (Recommended)

npm install -g git-mcp-server

Option 2: Local Development Setup

  1. Clone and install:

    git clone https://github.com/yourusername/git-mcp-server.git
    cd git-mcp-server
    npm install
    
  2. Build the project:

    npm run build
    

Configuration

Claude Desktop

Add this server to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "git": {
      "command": "git-mcp-server",
      "args": []
    }
  }
}

Other MCP Clients

For other MCP clients, use the server binary directly:

git-mcp-server

The server will automatically use the current working directory as the Git repository context.

Usage

Once configured, you can use Git operations through your MCP client. The server automatically detects the Git repository in your current working directory.

Example Commands

Ask your MCP client (like Claude) to perform Git operations:

  • "What's the current git status?"
  • "Show me the diff with the main branch"
  • "Create a new branch called feature/new-feature"
  • "Commit these changes with message 'Fix bug in parser'"
  • "Push the current branch to origin"

Testing the Server

You can test the server manually from any Git repository:

cd /path/to/your/git/repo
git-mcp-server

Available Tools

Repository Information

  • git_status - Get current git status
  • git_current_branch - Get current branch name
  • git_staged_changes - Get staged changes
  • git_working_directory - Get current working directory info

File and History Operations

  • git_diff - Show diff between branches/commits
  • git_log - Get commit history
  • git_show_file - Show file contents at specific commit

Branch Operations

  • git_branches - List all branches
  • git_checkout - Switch to different branch or create new branch

Staging and Commit Operations

  • git_add - Add files to staging area
  • git_commit - Create commits with message and files

Remote Operations

  • git_pull - Pull changes from remote repository
  • git_fetch - Fetch changes from remote without merging

Repository Management

  • git_init - Initialize a new git repository

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Git installed on your system

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Project Structure

git-mcp-server/
├── package.json          # Project dependencies and scripts
├── tsconfig.json         # TypeScript configuration
├── src/
│   └── index.ts         # Main server implementation
├── build/
│   └── index.js         # Compiled JavaScript (generated)
└── README.md            # This file

Development

  • npm run build - Build the TypeScript code
  • npm run dev - Watch mode for development
  • npm start - Run the built server

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured