The mcp-server-git is a Git Model Context Protocol (MCP) server designed for seamless interaction and automation of Git repositories via artificial intelligence agents and Large Language Models (LLMs). It provides tools for displaying status, diffing changes, committing, staging files, managing branches, and initializing repositories. This server is ideal for developers, project managers, and teams looking to streamline coding workflows, interact programmatically directly with Git, and use AI-assisted automation tools to improve productivity and collaboration.
Tools:
git_status
Shows the working tree status.
Input:
repo_path (string): Path to Git repository.
Output:
Current status of working directory as text output.
git_diff_unstaged
Shows changes in working directory not yet staged.
Input:
repo_path (string): Path to Git repository.
Output:
Diff output of unstaged changes.
git_diff_staged
Shows changes that are staged for commit.
Input:
repo_path (string): Path to Git repository.
Output:
Diff output of staged changes.
git_diff
Shows differences between branches or commits.
Input:
repo_path (string): Path to Git repository, target (string): Target branch or commit to compare with.
Output:
Diff output comparing current state with target.
git_commit
Records changes to the repository.
Input:
repo_path (string): Path to Git repository, message (string): Commit message.
Output:
Confirmation with new commit hash.
git_add
Adds file contents to the staging area.
Input:
repo_path (string): Path to Git repository, files (string[]): Array of file paths to stage.
Output:
Confirmation of staged files.
git_reset
Unstages all staged changes.
Input:
repo_path (string): Path to Git repository.
Output:
Confirmation of reset operation.
git_log
Shows the commit logs.
Input:
repo_path (string): Path to Git repository, max_count (number, optional): Maximum number of commits to show (default: 10).
Output:
Array of commit entries with hash, author, date, and message.
git_create_branch
Creates a new branch.
Input:
repo_path (string): Path to Git repository, branch_name (string): Name of the new branch, start_point (string, optional): Starting point for the new branch.
Output:
Confirmation of branch creation.
git_checkout
Switches branches.
Input:
repo_path (string): Path to Git repository, branch_name (string): Name of branch to checkout.
Output:
Confirmation of branch switch.
git_show
Shows the contents of a commit.
Input:
repo_path (string): Path to Git repository, revision (string): The revision (commit hash, branch name, tag) to show.
Output:
Contents of the specified commit.
git_init
Initializes a Git repository.
Input:
repo_path (string): Path to directory to initialize git repo.
Output:
Confirmation of repository initialization.
Quick Links