mcp-server-git: A git MCP server
<!-- mcp-name: io.github.modelcontextprotocol/server-git -->Overview
A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.
Tools
-
git_status- Shows the working tree status
- Input:
repo_path(string): Path to Git repository
- Returns: Current status of working directory as text output
-
git_diff_unstaged- Shows changes in working directory not yet staged
- Inputs:
repo_path(string): Path to Git repositorycontext_lines(number, optional): Number of context lines to show (default: 3)
- Returns: Diff output of unstaged changes
-
git_diff_staged- Shows changes that are staged for commit
- Inputs:
repo_path(string): Path to Git repositorycontext_lines(number, optional): Number of context lines to show (default: 3)
- Returns: Diff output of staged changes
-
git_diff- Shows differences between branches or commits
- Inputs:
repo_path(string): Path to Git repositorytarget(string): Target branch or commit to compare withcontext_lines(number, optional): Number of context lines to show (default: 3)
- Returns: Diff output comparing current state with target
-
git_commit- Records changes to the repository
- Inputs:
repo_path(string): Path to Git repositorymessage(string): Commit message
- Returns: Confirmation with new commit hash
-
git_add- Adds file contents to the staging area
- Inputs:
repo_path(string): Path to Git repositoryfiles(string[]): Array of file paths to stage
- Returns: Confirmation of staged files