
Git
STDIOGit operations server for AI assistants providing comprehensive repository management tools.
Git operations server for AI assistants providing comprehensive repository management tools.
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.
The server provides the following Git operations:
init
- Initialize new Git repositorystatus
- Get repository status with detailed file informationadd
- Stage files for commitreset
- Reset repository state (soft, mixed, hard)commit
- Create commits with comprehensive optionslog
- View commit history with filtering and formatting optionsshow
- Display commit details and changescreate-branch
- Create new branches from any starting pointcheckout
- Switch branches/commits with advanced optionsdiff
- Show differences between commits, branches, or files[!NOTE] Server intentionally lacks push operations to avoid security risks.
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 pathsReturns: Detailed repository status information
Adds file contents to the staging area.
Inputs:
repoPath
(string): Absolute path to Git repositoryfiles
(array): List of file paths to stageReturns: Confirmation of staged files
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 messageReturns: Commit confirmation with details
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 pathsReturns: Formatted commit history
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 existsReturns: Branch creation confirmation
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 pathsReturns: Checkout confirmation
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 pathsReturns: Reset confirmation
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 pathsReturns: Diff output
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 pathsReturns: Commit details and changes
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 directoryReturns: Initialization confirmation
{ "mcpServers": { "git": { "command": "npx", "args": ["-y", "@ver0/mcp-git"] } } }