git-mcp-server
v2.15.3Comprehensive Git MCP server enabling native git tools including clone, commit, worktree, & more.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
git_add Git Add
Stage files for commit. Add file contents to the staging area (index) to prepare for the next commit.
| Parameter | Type | Description |
|---|---|---|
all | boolean | Include all items (varies by operation). |
force | boolean | Allow adding otherwise ignored files. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
paths | array | Array of file or directory paths to stage (relative to repository root). Use ["."] to stage all changes. Paths must not start with "-" — use "./-name" for filenames starting with a dash. Can be omit… |
update | boolean | Stage only modified and deleted files (skip untracked files). |
git_blame Git Blame
Show line-by-line authorship information for a file, displaying who last modified each line and when. For large files, use startLine/endLine to limit output.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Path to the file to blame (relative to repository root). Must not start with "-". |
endLine | integer | End line number (1-indexed). |
ignoreWhitespace | boolean | Ignore whitespace changes. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
startLine | integer | Start line number (1-indexed). |
git_branch Git Branch
Manage branches: list all branches, show current branch, create a new branch, delete a branch, or rename a branch.
| Parameter | Type | Description |
|---|---|---|
all | boolean | For list mode: show both local and remote branches. |
branchName | string | Branch name for create/delete/rename operations. |
force | boolean | Force the operation, bypassing safety checks. |
limit | integer | For list mode: cap the number of branches returned (applied at the git command). Use on repos with many branches. |
merged | For list mode: show only branches merged into HEAD (true) or specified commit (string). | |
mode | string | The branch operation to perform. |
newBranchName | string | New branch name for rename operation. |
noMerged | For list mode: show only branches not merged into HEAD (true) or specified commit (string). | |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
remote | boolean | For list mode: show only remote branches. |
startPoint | string | Starting point (commit/branch) for new branch creation. |
git_changelog_analyze Git Changelog Analyze
Gather git history context (commits, tags) and structured review instructions to support LLM-driven changelog analysis. Changelog file should be read separately; this tool provides the supporting git data and analysis framework. Pass one or more review types to control what kind of analysis to perform.
| Parameter | Type | Description |
|---|---|---|
reviewTypes * | array | Types of changelog review to perform. At least one required. Options: security, features, storyline, gaps, breaking_changes, quality. |
branch | string | Branch to analyze (defaults to current branch). |
maxCommits | integer | Maximum recent commits to fetch for cross-referencing (1-1000). |
maxTags | integer | Maximum recent tags to fetch for release context (1-1000). Applied at the git command so large tag catalogs do not bloat the response. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
sinceTag | string | Only include git history since this tag (e.g., "v1.2.0"). Narrows the analysis window. Must not start with "-". |
git_checkout Git Checkout
Switch branches or restore working tree files. Can checkout an existing branch, create a new branch, or restore specific files.
| Parameter | Type | Description |
|---|---|---|
target * | Branch name, commit hash, or tag to checkout. | |
createBranch | boolean | Create a new branch with the specified name. |
force | boolean | Force the operation, bypassing safety checks. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
paths | array | Specific file paths to checkout/restore (relative to repository root). Entries must not start with "-". |
track | boolean | Set up tracking relationship with remote branch when creating new branch. |
git_cherry_pick Git Cherry-Pick
Cherry-pick commits from other branches. Apply specific commits to the current branch without merging entire branches.
| Parameter | Type | Description |
|---|---|---|
commits * | array | Commit hashes to cherry-pick. |
abort | boolean | Abort cherry-pick operation. |
continueOperation | boolean | Continue cherry-pick after resolving conflicts. |
mainline | integer | For merge commits, specify which parent to follow (1 for first parent, 2 for second, etc.). |
noCommit | boolean | Don't create commit (stage changes only). |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
signoff | boolean | Add Signed-off-by line to the commit message. |
strategy | string | Merge strategy to use for cherry-pick. |
git_clean Git Clean
Remove untracked files from the working directory. Requires force flag for safety. Use dry-run to preview files that would be removed.
| Parameter | Type | Description |
|---|---|---|
directories | boolean | Remove untracked directories in addition to files. |
dryRun | boolean | Preview the operation without executing it. |
force | boolean | Force the operation, bypassing safety checks. |
ignored | boolean | Remove ignored files as well. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
git_clear_working_dir Git Clear Working Directory
Clear the session working directory setting. This resets the context without restarting the server. Subsequent git operations will require an explicit path parameter unless git_set_working_dir is called again.
| Parameter | Type | Description |
|---|---|---|
confirm * | string | Explicit confirmation required to clear working directory. Accepted values: 'Y', 'y', 'Yes', or 'yes'. |
git_clone Git Clone
Clone a repository from a remote URL or local path. Accepts HTTP(S), SSH, git://, file://, and bare filesystem paths, with optional shallow cloning.
| Parameter | Type | Description |
|---|---|---|
path * | string | Destination path where the repository should be cloned. Must not start with "-". |
url * | string | Git repository URL: HTTP(S), SSH (ssh://… or user@host:path), git://, file://, or an absolute filesystem path. Must not start with "-" and no segment may start with "-". |
bare | boolean | Create a bare repository (no working directory). |
branch | string | Specific branch to clone (defaults to remote HEAD). Must not start with "-". |
depth | integer | Create a shallow clone with history truncated to N commits. |
mirror | boolean | Create a mirror clone (implies bare). |
git_commit Git Commit
Create a new commit with staged changes in the repository. Records a snapshot of the staging area with a commit message. **Commit Message Format:** Pass commit messages as JSON string parameters. Multi-line messages are supported using standard JSON string escaping. **Examples:** - Single line: { "message": "feat: add user authentication" } - Multi-line: { "message": "feat: add user authentication\n\nImplemented OAuth2 flow with JWT tokens.\nAdded tests for login and logout." } Note: Do not use bash heredoc syntax. Literal escape sequences (\n, \t) in the message string are automatically no…
| Parameter | Type | Description |
|---|---|---|
message * | string | Commit message. |
allowEmpty | boolean | Allow creating a commit with no changes. |
amend | boolean | Amend the previous commit instead of creating a new one. Use with caution. |
author | object | Override commit author (defaults to git config). |
filesToStage | array | File paths to stage before committing (atomic stage+commit operation). Entries must not start with "-". |
noVerify | boolean | Bypass pre-commit and commit-msg hooks. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
git_diff Git Diff
View differences between commits, branches, or working tree. Shows changes in unified diff format.
| Parameter | Type | Description |
|---|---|---|
autoExclude | boolean | Automatically exclude lock files and other generated files (e.g., package-lock.json, yarn.lock, bun.lock, poetry.lock, go.sum) from diff output to reduce context bloat. Set to false if you need to ins… |
contextLines | integer | Number of context lines to show around changes. |
includeUntracked | boolean | Include untracked files in the diff. Useful for reviewing all upcoming changes. |
nameOnly | boolean | Show only names of changed files, not the diff content. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
paths | array | Limit diff to specific file paths (relative to repository root). Entries must not start with "-". |
source | string | Source commit/branch to compare from. If target is specified but not source, compares target against working tree. |
staged | boolean | Show diff of staged changes instead of unstaged. |
stat | boolean | Show diffstat (summary of changes) instead of full diff content. |
target | string | Target commit/branch to compare against. If not specified, shows unstaged changes in working tree. |
git_fetch Git Fetch
Fetch updates from a remote repository. Downloads objects and refs without merging them.
| Parameter | Type | Description |
|---|---|---|
depth | integer | Create a shallow clone with history truncated to N commits. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
prune | boolean | Prune remote-tracking references that no longer exist on remote. |
remote | string | Remote name (default: origin). |
tags | boolean | Fetch all tags from the remote. |
git_init Git Init
Initialize a new Git repository at the specified path. Creates a .git directory and sets up the initial branch.
| Parameter | Type | Description |
|---|---|---|
bare | boolean | Create a bare repository (no working directory). |
initialBranch | string | Name of the initial branch (default: main). |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
git_log Git Log
View commit history with optional filtering by author, date range, file path, or commit message pattern.
| Parameter | Type | Description |
|---|---|---|
author | string | Filter commits by author name or email pattern. |
branch | string | Show commits from a specific branch or ref (defaults to current branch). |
filePath | string | Show commits that affected a specific file path. Must not start with "-". |
grep | string | Filter commits by message pattern (regex supported). |
maxCount | integer | Maximum number of items to return (1-1000). |
oneline | boolean | Abbreviated output: return only hash, shortHash, and subject per commit. Significantly reduces response size. |
patch | boolean | Include the full diff patch for each commit. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
showSignature | boolean | Show GPG signature verification information for each commit. |
since | string | Show commits more recent than a specific date (ISO 8601 format). |
skip | integer | Number of items to skip for pagination. |
stat | boolean | Include file change statistics for each commit. |
until | string | Show commits older than a specific date (ISO 8601 format). |
git_merge Git Merge
Merge branches together. Integrates changes from another branch into the current branch with optional merge strategies.
| Parameter | Type | Description |
|---|---|---|
branch * | string | Branch to merge into current branch. |
abort | boolean | Abort an in-progress merge that has conflicts. |
message | string | Custom merge commit message. |
noFastForward | boolean | Prevent fast-forward merge (create merge commit). |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
squash | boolean | Squash all commits from the branch into a single commit. |
strategy | string | Merge strategy to use (ort, recursive, octopus, ours, subtree). |
git_pull Git Pull
Pull changes from a remote repository. Fetches and integrates changes into the current branch.
| Parameter | Type | Description |
|---|---|---|
branch | string | Branch name (default: current branch). |
fastForwardOnly | boolean | Fail if can't fast-forward (no merge commit). |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
rebase | boolean | Use rebase instead of merge when integrating changes. |
remote | string | Remote name (default: origin). |
git_push Git Push
Push changes to a remote repository. Uploads local commits to the remote branch.
| Parameter | Type | Description |
|---|---|---|
branch | string | Branch name (default: current branch). |
confirmed | boolean | Explicit confirmation required for force push or branch deletion on protected branches (main, master, production, etc.). |
delete | boolean | Delete the specified remote branch. |
dryRun | boolean | Preview the operation without executing it. |
force | boolean | Force push (overwrites remote history). |
forceWithLease | boolean | Safer force push - only succeeds if remote branch is at expected state. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
remote | string | Remote name (default: origin). |
remoteBranch | string | Remote branch name to push to (if different from local branch name). |
setUpstream | boolean | Set upstream tracking relationship for the branch. |
tags | boolean | Push all tags to the remote. |
git_rebase Git Rebase
Rebase commits onto another branch. Reapplies commits on top of another base tip for a cleaner history.
| Parameter | Type | Description |
|---|---|---|
branch | string | Branch to rebase (default: current branch). |
interactive | boolean | Interactive rebase (not supported in all providers). |
mode | string | Rebase operation mode: 'start', 'continue', 'abort', or 'skip'. |
onto | string | Rebase onto different commit than upstream. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
preserve | boolean | Preserve merge commits during rebase. |
upstream | string | Upstream branch to rebase onto (required for start mode). |
git_reflog Git Reflog
View the reference logs (reflog) to track when branch tips and other references were updated. Useful for recovering lost commits.
| Parameter | Type | Description |
|---|---|---|
maxCount | integer | Maximum number of items to return (1-1000). |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
ref | string | Reference whose reflog to show. Defaults to HEAD. Must not start with "-". |
git_remote Git Remote
Manage remote repositories: list remotes, add new remotes, remove remotes, rename remotes, or get/set remote URLs.
| Parameter | Type | Description |
|---|---|---|
mode | string | The remote operation to perform. |
name | string | Remote name for add/remove/rename/get-url/set-url operations. |
newName | string | New remote name for rename operation. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
push | boolean | Set push URL separately (for set-url operation). |
url | string | Remote URL for add/set-url operations. Accepts HTTP(S), SSH (ssh://… or user@host:path), git://, or file:// URLs. Must not start with "-". |
git_reset Git Reset
Reset current HEAD to specified state. Can be used to unstage files (soft), discard commits (mixed), or discard all changes (hard).
| Parameter | Type | Description |
|---|---|---|
confirmed | boolean | Explicit confirmation required for hard, merge, and keep reset modes on protected branches (main, master, production, etc.). |
mode | string | Reset mode: soft (keep changes staged), mixed (unstage changes), hard (discard all changes), merge (reset and merge), keep (reset but keep local changes). |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
paths | array | Specific file paths to reset (leaves HEAD unchanged). Entries must not start with "-". |
target | string | Target commit to reset to. Defaults to HEAD. |
git_set_working_dir Git Set Working Directory
Set the session working directory for all git operations so subsequent calls can omit the path parameter. Always returns a repository snapshot (status, recent commits, recent tags, remotes) to orient the caller.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to the git repository to use as the working directory. |
initializeIfNotPresent | boolean | If not a Git repository, initialize it with 'git init'. |
validateGitRepo | boolean | Validate that the path is a Git repository. |
git_show Git Show
Show details of a git object (commit, tree, blob, or tag). Displays commit information and the diff of changes introduced.
| Parameter | Type | Description |
|---|---|---|
object * | string | Git object to show (commit hash, branch, tag, tree, or blob). |
filePath | string | View specific file at a given commit reference. When provided, shows the file content from the specified object. Must not start with "-". |
format | string | Output format for the git object. Use "raw" for unprocessed git output. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
stat | boolean | Show diffstat instead of full diff. |
git_stash Git Stash
Manage stashes: list stashes, save current changes (push), restore changes (pop/apply), or remove stashes (drop/clear).
| Parameter | Type | Description |
|---|---|---|
includeUntracked | boolean | Include untracked files in the stash (for push operation). |
keepIndex | boolean | Don't revert staged changes (for push operation). |
limit | integer | For list mode: cap the number of stash entries returned (applied at the git command). |
message | string | Stash message description (for push operation). |
mode | string | The stash operation to perform. Defaults to push (save current changes). |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
stashRef | string | Stash reference like stash@{0} (for pop/apply/drop operations). Must not start with "-". |
git_status Git Status
Show the working tree status including staged, unstaged, and untracked files.
| Parameter | Type | Description |
|---|---|---|
includeUntracked | boolean | Include untracked files in the output. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
git_tag Git Tag
Manage tags: list all tags, create a new tag, delete a tag, or verify a signed tag. Tags are used to mark specific points in history (releases, milestones). Verify runs `git tag -v` and returns a structured result distinguishing unsigned tags, missing trust configuration, bad signatures, and valid signatures.
| Parameter | Type | Description |
|---|---|---|
annotated | boolean | Create an annotated tag with a default "Tag <name>" message. Only effective when no message is provided and signing is disabled — otherwise the tag is always annotated. |
commit | string | Commit to tag (default: HEAD for create operation). |
force | boolean | Overwrite an existing tag (create mode only; has no effect on list or delete). |
limit | integer | For list mode: cap the number of tags returned (applied at the git command via `--count=N`). Use on repos with many tags. |
message | string | Tag message. Providing a message always produces an annotated tag (git does not support messages on lightweight tags). For release tags, summarize notable changes. |
mode | string | The tag operation to perform. |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
tagName | string | Tag name for create/delete/verify operations. |
git_worktree Git Worktree
Manage multiple working trees: list worktrees, add new worktrees for parallel work, remove worktrees, or move worktrees to new locations.
| Parameter | Type | Description |
|---|---|---|
branch | string | For add operation: create a NEW branch with this name in the new worktree. Fails if the branch already exists — use `commitish` to check out an existing branch instead. |
commitish | string | For add operation: check out this existing branch/commit/tag in the new worktree (no new branch is created). |
detach | boolean | Create worktree with detached HEAD (for add operation). |
dryRun | boolean | Preview the operation without executing it (for prune operation). |
force | boolean | Force operation (for remove operation with uncommitted changes). |
mode | string | The worktree operation to perform. |
newPath | string | New path for the worktree (for move operation). Must not start with "-". |
path | string | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. |
verbose | boolean | Provide detailed output for worktree operations. |
worktreePath | string | Path for the new worktree (for add/move operations). Must not start with "-". |
git_wrapup_instructions Git Wrap-up Instructions
Returns a Git wrap-up protocol: an acceptance-criteria checklist the agent must satisfy before the session is considered shipped. Uses the operator's custom instructions if configured, otherwise emits a generic goals-strict/mechanism-generic default. Enriches the response with a repository snapshot (status, recent commits, recent tags) so the agent has immediate orientation for the commit and release steps.
| Parameter | Type | Description |
|---|---|---|
acknowledgement * | string | Acknowledgement to initiate the wrap-up workflow. |
createTag | boolean | Controls whether the tag criterion appears in the emitted protocol. Omit or set `true` to include the tag step. Set `false` to omit it entirely — e.g., when tagging is deferred to a separate release… |