Provides comprehensive Git operations for AI assistants, including repository initialization, status checking, file staging, commits, history viewing, branch management, and file comparisons. Enables interaction with Git repositories through structured interfaces.
MCP Git Server
An MCP (Model Context Protocol) server that provides comprehensive Git operations as tools for AI assistants and applications. This server enables AI systems to interact with Git repositories through a structured, validated interface.
Tools
The server provides the following Git operations:
Repository Management
init
- Initialize new Git repositorystatus
- Get repository status with detailed file information
File Operations
add
- Stage files for commitreset
- Reset repository state (soft, mixed, hard)
Commit Operations
commit
- Create commits with comprehensive optionslog
- View commit history with filtering and formatting optionsshow
- Display commit details and changes
Branch Operations
create-branch
- Create new branches from any starting pointcheckout
- Switch branches/commits with advanced options
Comparison Operations
diff
- Show differences between commits, branches, or files
Note
Server intentionally lacks push operations to avoid security risks.
Tool Details
git_status
Shows the working tree status with comprehensive formatting options.
Inputs:
repoPath
(string): Absolute path to Git repositoryshort
(boolean, optional): Give output in short formatbranch
(boolean, optional): Show branch and tracking infoverbose
(boolean/number, optional): Show textual changes staged for commituntrackedFiles
(boolean/string, optional): Show untracked filesignoreSubmodules
(string, optional): Ignore changes to submodulespathspec
(array, optional): Limit output to given paths
Returns: Detailed repository status information
git_add
Adds file contents to the staging area.
Inputs:
repoPath
(string): Absolute path to Git repositoryfiles
(array): List of file paths to stage
Returns: Confirmation of staged files
git_commit
Records changes to the repository with extensive commit options.
Inputs:
repoPath
(string): Absolute path to Git repositorymessage
(string): Commit messageall
(boolean, optional): Automatically stage modified filesauthor
(string, optional): Override authoramend
(boolean, optional): Amend the previous commitgpgSign
(boolean/string, optional): GPG sign committrailers
(array, optional): Add trailers to commit message- Plus many more advanced options...
Returns: Commit confirmation with details
git_log
Shows commit history with advanced filtering and formatting.
Inputs:
repoPath
(string): Absolute path to Git repositorymaxCount
(number, optional): Limit number of commitssince
(string, optional): Show commits after dateauthor
(string, optional): Filter by authorformat
(string, optional): Pretty-print formatgraph
(boolean, optional): Show text-based graphpathspec
(array, optional): Limit to specific paths
Returns: Formatted commit history
git_create_branch
Creates new branches with flexible options.
Inputs:
repoPath
(string): Absolute path to Git repositorybranchName
(string): Name of new branchstartPoint
(string, optional): Starting commit/branch/tagswitchToBranch
(boolean, optional): Switch to new branch (default: true)force
(boolean, optional): Force create, reset if exists
Returns: Branch creation confirmation
git_checkout
Switches branches or commits with advanced options.
Inputs:
repoPath
(string): Absolute path to Git repositorytarget
(string): Branch/commit/tag to checkoutforce
(boolean, optional): Force checkoutcreateBranch
(string, optional): Create and checkout new branchdetach
(boolean, optional): Detached HEAD modepathspec
(array, optional): Limit to specific paths
Returns: Checkout confirmation
git_reset
Resets repository state with different modes.
Inputs:
repoPath
(string): Absolute path to Git repositorytarget
(string, optional): Target commit (default: HEAD)mode
(string, optional): Reset mode - soft/mixed/hard (default: mixed)pathspec
(array, optional): Limit to specific paths
Returns: Reset confirmation
git_diff
Shows differences between commits, branches, or files.
Inputs:
repoPath
(string): Absolute path to Git repositoryfrom
(string, optional): Source commit/branch/tagto
(string, optional): Target commit/branch/tagstaged
(boolean, optional): Show staged changesnameOnly
(boolean, optional): Show only changed file namespathspec
(array, optional): Limit to specific paths
Returns: Diff output
git_show
Displays commit details and changes.
Inputs:
repoPath
(string): Absolute path to Git repositorycommit
(string, optional): Commit to show (default: HEAD)format
(string, optional): Pretty-print formatstat
(boolean, optional): Show diffstatpathspec
(array, optional): Limit to specific paths
Returns: Commit details and changes
git_init
Initializes a new Git repository.
Inputs:
repoPath
(string): Path where to initialize repositorybare
(boolean, optional): Create bare repositoryinitialBranch
(string, optional): Set initial branch nametemplate
(string, optional): Template directory
Returns: Initialization confirmation
Installation
You must be authenticated.
Provides comprehensive Git operations as tools for AI assistants and applications. This server enables AI systems to interact with Git repositories, allowing to initialize, fetch, commit, log, status, etc..
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityThe 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.Last updated -21554TypeScript
- -securityAlicense-qualityA server that allows AI assistants to browse and read files from specified GitHub repositories, providing access to repository contents via the Model Context Protocol.Last updated -3JavaScriptMIT License
- -securityFlicense-qualityA custom server implementation that allows AI assistants to interact with GitLab repositories, providing capabilities for searching, fetching files, creating/updating content, and managing issues and merge requests.Last updated -JavaScript
- -securityAlicense-qualityA server implementation that provides a unified interface for OpenAI services, Git repository analysis, and local filesystem operations through REST API endpoints.Last updated -PythonGPL 3.0