Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

git-mcp-v2

MCP.Pizza Chef: Sheshiyer

git-mcp-v2 is an MCP server that provides a standardized interface for comprehensive Git operations including cloning, committing, branching, tagging, and remote management. It supports bulk Git actions, smart path resolution, and integrates with GitHub via Personal Access Tokens. Designed for efficient repository caching and performance monitoring, it enables AI assistants to interact seamlessly with Git repositories within the MCP ecosystem.

Use This MCP server To

Automate Git repository cloning and initialization Manage branches and tags programmatically Perform bulk Git operations in sequence Integrate GitHub workflows with AI assistants Track repository state with caching for faster access Handle Git errors with detailed custom error types Monitor Git operation performance metrics Manage remote repositories and remotes efficiently Save and apply stashes through AI-driven commands Resolve repository paths smartly with default configurations

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

git-mcp-v2 FAQ

How does git-mcp-v2 handle GitHub authentication?
It uses Personal Access Tokens for secure GitHub integration.
Can git-mcp-v2 execute multiple Git commands in one request?
Yes, it supports bulk actions to run multiple Git operations sequentially.
How does git-mcp-v2 improve performance when accessing repositories?
It uses repository caching to efficiently manage repository state and speed up operations.
What kind of error handling does git-mcp-v2 provide?
It offers comprehensive error handling with custom error types for precise issue identification.
Does git-mcp-v2 support branch and tag management?
Yes, it supports listing, creating, deleting, and checking out branches and tags.
How does path resolution work in git-mcp-v2?
It features smart path handling with optional default path configuration for ease of use.
Is performance monitoring included in git-mcp-v2?
Yes, it includes built-in performance tracking for Git operations.
Can git-mcp-v2 manage Git stash operations?
Yes, it supports listing, saving, and popping stashes.
How do I install git-mcp-v2?
Clone the repository from GitHub and follow the setup instructions provided in the README.
What platforms or environments is git-mcp-v2 compatible with?
It is designed to integrate within the MCP ecosystem and can run wherever MCP servers are supported.