git-mcp-server

v2.15.3
io.github.cyanheads/git-mcp-server Checked 8 hours ago Published 3 months ago

Comprehensive 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.

ParameterTypeDescription
allbooleanInclude all items (varies by operation).
forcebooleanAllow adding otherwise ignored files.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
pathsarrayArray 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…
updatebooleanStage 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.

ParameterTypeDescription
filePath *stringPath to the file to blame (relative to repository root). Must not start with "-".
endLineintegerEnd line number (1-indexed).
ignoreWhitespacebooleanIgnore whitespace changes.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
startLineintegerStart 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.

ParameterTypeDescription
allbooleanFor list mode: show both local and remote branches.
branchNamestringBranch name for create/delete/rename operations.
forcebooleanForce the operation, bypassing safety checks.
limitintegerFor list mode: cap the number of branches returned (applied at the git command). Use on repos with many branches.
mergedFor list mode: show only branches merged into HEAD (true) or specified commit (string).
modestringThe branch operation to perform.
newBranchNamestringNew branch name for rename operation.
noMergedFor list mode: show only branches not merged into HEAD (true) or specified commit (string).
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
remotebooleanFor list mode: show only remote branches.
startPointstringStarting 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.

ParameterTypeDescription
reviewTypes *arrayTypes of changelog review to perform. At least one required. Options: security, features, storyline, gaps, breaking_changes, quality.
branchstringBranch to analyze (defaults to current branch).
maxCommitsintegerMaximum recent commits to fetch for cross-referencing (1-1000).
maxTagsintegerMaximum recent tags to fetch for release context (1-1000). Applied at the git command so large tag catalogs do not bloat the response.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
sinceTagstringOnly 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.

ParameterTypeDescription
target *Branch name, commit hash, or tag to checkout.
createBranchbooleanCreate a new branch with the specified name.
forcebooleanForce the operation, bypassing safety checks.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
pathsarraySpecific file paths to checkout/restore (relative to repository root). Entries must not start with "-".
trackbooleanSet 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.

ParameterTypeDescription
commits *arrayCommit hashes to cherry-pick.
abortbooleanAbort cherry-pick operation.
continueOperationbooleanContinue cherry-pick after resolving conflicts.
mainlineintegerFor merge commits, specify which parent to follow (1 for first parent, 2 for second, etc.).
noCommitbooleanDon't create commit (stage changes only).
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
signoffbooleanAdd Signed-off-by line to the commit message.
strategystringMerge 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.

ParameterTypeDescription
directoriesbooleanRemove untracked directories in addition to files.
dryRunbooleanPreview the operation without executing it.
forcebooleanForce the operation, bypassing safety checks.
ignoredbooleanRemove ignored files as well.
pathstringPath 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.

ParameterTypeDescription
confirm *stringExplicit 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.

ParameterTypeDescription
path *stringDestination path where the repository should be cloned. Must not start with "-".
url *stringGit 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 "-".
barebooleanCreate a bare repository (no working directory).
branchstringSpecific branch to clone (defaults to remote HEAD). Must not start with "-".
depthintegerCreate a shallow clone with history truncated to N commits.
mirrorbooleanCreate 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…

ParameterTypeDescription
message *stringCommit message.
allowEmptybooleanAllow creating a commit with no changes.
amendbooleanAmend the previous commit instead of creating a new one. Use with caution.
authorobjectOverride commit author (defaults to git config).
filesToStagearrayFile paths to stage before committing (atomic stage+commit operation). Entries must not start with "-".
noVerifybooleanBypass pre-commit and commit-msg hooks.
pathstringPath 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.

ParameterTypeDescription
autoExcludebooleanAutomatically 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…
contextLinesintegerNumber of context lines to show around changes.
includeUntrackedbooleanInclude untracked files in the diff. Useful for reviewing all upcoming changes.
nameOnlybooleanShow only names of changed files, not the diff content.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
pathsarrayLimit diff to specific file paths (relative to repository root). Entries must not start with "-".
sourcestringSource commit/branch to compare from. If target is specified but not source, compares target against working tree.
stagedbooleanShow diff of staged changes instead of unstaged.
statbooleanShow diffstat (summary of changes) instead of full diff content.
targetstringTarget 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.

ParameterTypeDescription
depthintegerCreate a shallow clone with history truncated to N commits.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
prunebooleanPrune remote-tracking references that no longer exist on remote.
remotestringRemote name (default: origin).
tagsbooleanFetch 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.

ParameterTypeDescription
barebooleanCreate a bare repository (no working directory).
initialBranchstringName of the initial branch (default: main).
pathstringPath 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.

ParameterTypeDescription
authorstringFilter commits by author name or email pattern.
branchstringShow commits from a specific branch or ref (defaults to current branch).
filePathstringShow commits that affected a specific file path. Must not start with "-".
grepstringFilter commits by message pattern (regex supported).
maxCountintegerMaximum number of items to return (1-1000).
onelinebooleanAbbreviated output: return only hash, shortHash, and subject per commit. Significantly reduces response size.
patchbooleanInclude the full diff patch for each commit.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
showSignaturebooleanShow GPG signature verification information for each commit.
sincestringShow commits more recent than a specific date (ISO 8601 format).
skipintegerNumber of items to skip for pagination.
statbooleanInclude file change statistics for each commit.
untilstringShow 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.

ParameterTypeDescription
branch *stringBranch to merge into current branch.
abortbooleanAbort an in-progress merge that has conflicts.
messagestringCustom merge commit message.
noFastForwardbooleanPrevent fast-forward merge (create merge commit).
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
squashbooleanSquash all commits from the branch into a single commit.
strategystringMerge 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.

ParameterTypeDescription
branchstringBranch name (default: current branch).
fastForwardOnlybooleanFail if can't fast-forward (no merge commit).
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
rebasebooleanUse rebase instead of merge when integrating changes.
remotestringRemote name (default: origin).

git_push Git Push

Push changes to a remote repository. Uploads local commits to the remote branch.

ParameterTypeDescription
branchstringBranch name (default: current branch).
confirmedbooleanExplicit confirmation required for force push or branch deletion on protected branches (main, master, production, etc.).
deletebooleanDelete the specified remote branch.
dryRunbooleanPreview the operation without executing it.
forcebooleanForce push (overwrites remote history).
forceWithLeasebooleanSafer force push - only succeeds if remote branch is at expected state.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
remotestringRemote name (default: origin).
remoteBranchstringRemote branch name to push to (if different from local branch name).
setUpstreambooleanSet upstream tracking relationship for the branch.
tagsbooleanPush 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.

ParameterTypeDescription
branchstringBranch to rebase (default: current branch).
interactivebooleanInteractive rebase (not supported in all providers).
modestringRebase operation mode: 'start', 'continue', 'abort', or 'skip'.
ontostringRebase onto different commit than upstream.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
preservebooleanPreserve merge commits during rebase.
upstreamstringUpstream 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.

ParameterTypeDescription
maxCountintegerMaximum number of items to return (1-1000).
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
refstringReference 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.

ParameterTypeDescription
modestringThe remote operation to perform.
namestringRemote name for add/remove/rename/get-url/set-url operations.
newNamestringNew remote name for rename operation.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
pushbooleanSet push URL separately (for set-url operation).
urlstringRemote 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).

ParameterTypeDescription
confirmedbooleanExplicit confirmation required for hard, merge, and keep reset modes on protected branches (main, master, production, etc.).
modestringReset mode: soft (keep changes staged), mixed (unstage changes), hard (discard all changes), merge (reset and merge), keep (reset but keep local changes).
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
pathsarraySpecific file paths to reset (leaves HEAD unchanged). Entries must not start with "-".
targetstringTarget 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.

ParameterTypeDescription
path *stringAbsolute path to the git repository to use as the working directory.
initializeIfNotPresentbooleanIf not a Git repository, initialize it with 'git init'.
validateGitRepobooleanValidate 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.

ParameterTypeDescription
object *stringGit object to show (commit hash, branch, tag, tree, or blob).
filePathstringView specific file at a given commit reference. When provided, shows the file content from the specified object. Must not start with "-".
formatstringOutput format for the git object. Use "raw" for unprocessed git output.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
statbooleanShow 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).

ParameterTypeDescription
includeUntrackedbooleanInclude untracked files in the stash (for push operation).
keepIndexbooleanDon't revert staged changes (for push operation).
limitintegerFor list mode: cap the number of stash entries returned (applied at the git command).
messagestringStash message description (for push operation).
modestringThe stash operation to perform. Defaults to push (save current changes).
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
stashRefstringStash 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.

ParameterTypeDescription
includeUntrackedbooleanInclude untracked files in the output.
pathstringPath 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.

ParameterTypeDescription
annotatedbooleanCreate 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.
commitstringCommit to tag (default: HEAD for create operation).
forcebooleanOverwrite an existing tag (create mode only; has no effect on list or delete).
limitintegerFor list mode: cap the number of tags returned (applied at the git command via `--count=N`). Use on repos with many tags.
messagestringTag message. Providing a message always produces an annotated tag (git does not support messages on lightweight tags). For release tags, summarize notable changes.
modestringThe tag operation to perform.
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
tagNamestringTag 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.

ParameterTypeDescription
branchstringFor 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.
commitishstringFor add operation: check out this existing branch/commit/tag in the new worktree (no new branch is created).
detachbooleanCreate worktree with detached HEAD (for add operation).
dryRunbooleanPreview the operation without executing it (for prune operation).
forcebooleanForce operation (for remove operation with uncommitted changes).
modestringThe worktree operation to perform.
newPathstringNew path for the worktree (for move operation). Must not start with "-".
pathstringPath to the Git repository. Defaults to session working directory set via git_set_working_dir.
verbosebooleanProvide detailed output for worktree operations.
worktreePathstringPath 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.

ParameterTypeDescription
acknowledgement *stringAcknowledgement to initiate the wrap-up workflow.
createTagbooleanControls 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…