Git MCP Server

Git MCP Server

The Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.

Sheshiyer

Version Control
Visit Server

Tools

init

Initialize a new Git repository

clone

Clone a repository

status

Get repository status

add

Stage files

commit

Create a commit

push

Push commits to remote

pull

Pull changes from remote

branch_list

List all branches

remote_remove

Remove a remote

stash_list

List stashes

branch_create

Create a new branch

branch_delete

Delete a branch

checkout

Switch branches or restore working tree files

tag_list

List tags

tag_create

Create a tag

tag_delete

Delete a tag

remote_list

List remotes

remote_add

Add a remote

stash_save

Save changes to stash

stash_pop

Apply and remove a stash

bulk_action

Execute multiple Git operations in sequence. This is the preferred way to execute multiple operations.

README

Git MCP Server

A Model Context Protocol (MCP) server that provides enhanced Git operations through a standardized interface. This server integrates with the MCP ecosystem to provide Git functionality to AI assistants.

Features

  • Core Git Operations: init, clone, status, add, commit, push, pull
  • Branch Management: list, create, delete, checkout
  • Tag Operations: list, create, delete
  • Remote Management: list, add, remove
  • Stash Operations: list, save, pop
  • Bulk Actions: Execute multiple Git operations in sequence
  • GitHub Integration: Built-in GitHub support via Personal Access Token
  • Path Resolution: Smart path handling with optional default path configuration
  • Error Handling: Comprehensive error handling with custom error types
  • Repository Caching: Efficient repository state management
  • Performance Monitoring: Built-in performance tracking

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/git-mcp-v2.git
cd git-mcp-v2
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

Add to your MCP settings file:

{
  "mcpServers": {
    "git-v2": {
      "command": "node",
      "args": ["path/to/git-mcp-v2/build/index.js"],
      "env": {
        "GIT_DEFAULT_PATH": "/path/to/default/git/directory",
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-github-pat"
      }
    }
  }
}

Environment Variables

  • GIT_DEFAULT_PATH: (Optional) Default path for Git operations
  • GITHUB_PERSONAL_ACCESS_TOKEN: (Optional) GitHub Personal Access Token for GitHub operations

Available Tools

Basic Operations

  • init: Initialize a new Git repository
  • clone: Clone a repository
  • status: Get repository status
  • add: Stage files
  • commit: Create a commit
  • push: Push commits to remote
  • pull: Pull changes from remote

Branch Operations

  • branch_list: List all branches
  • branch_create: Create a new branch
  • branch_delete: Delete a branch
  • checkout: Switch branches or restore working tree files

Tag Operations

  • tag_list: List tags
  • tag_create: Create a tag
  • tag_delete: Delete a tag

Remote Operations

  • remote_list: List remotes
  • remote_add: Add a remote
  • remote_remove: Remove a remote

Stash Operations

  • stash_list: List stashes
  • stash_save: Save changes to stash
  • stash_pop: Apply and remove a stash

Bulk Operations

  • bulk_action: Execute multiple Git operations in sequence

Development

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Run linter
npm run lint

# Format code
npm run format

License

MIT

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Recommended Servers

Gitingest-MCP

Gitingest-MCP

An MCP server for gitingest. It allows MCP clients like Claude Desktop, Cursor, Cline etc to quickly extract information about Github repositories including repository summaries, project directory structure, file contents, etc

Featured
Local
Python
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
JSON Resume MCP Server

JSON Resume MCP Server

A server that enhances AI assistants with the ability to update your JSON Resume by analyzing your coding projects, automatically extracting skills and generating professional descriptions.

Official
Local
TypeScript
Git Forensics MCP

Git Forensics MCP

A specialized MCP server for in-depth analysis of git repositories, offering tools for branch overview, time period analysis, file changes, and merge recommendations.

Local
JavaScript
AI Development Assistant MCP Server

AI Development Assistant MCP Server

A Cursor-compatible toolkit that provides intelligent coding assistance through custom AI tools for code architecture planning, screenshot analysis, code review, and file reading capabilities.

Local
TypeScript
Textwell MCP Server

Textwell MCP Server

Integrates Textwell with the Model Context Protocol for facilitating text operations such as writing and appending text through a GitHub Pages bridge.

Local
JavaScript
DocuMind MCP Server

DocuMind MCP Server

A Model Context Protocol server that analyzes and evaluates GitHub README documentation quality using advanced neural processing, providing scores and improvement suggestions.

Local
TypeScript
MCP Source Tree Server

MCP Source Tree Server

Generates a JSON file tree from a specified directory's 'src' folder, adhering to '.gitignore' rules, allowing for quick project structure review in Claude.

Local
Python