Skip to content

Remote tools manage connections to remote repositories and synchronize content between local and remote.

git_list_remotes ​

Lists all configured remotes with their fetch and push URLs.

ParameterTypeRequiredDefaultDescription
repo_pathstring*—Absolute path to the repository
response_format"markdown" | "json""markdown"Output format

Example:

json
{ "tool": "git_list_remotes", "params": { "repo_path": "/home/user/myproject" } }

git_remote ​

Adds, removes, or updates a remote.

ParameterTypeRequiredDefaultDescription
repo_pathstring*—Absolute path to the repository
action"add" | "remove" | "set-url"*—Operation to perform
namestring*—Remote name (e.g. origin)
urlstring—Required for add and set-url. Remote URL (HTTPS or SSH)
response_format"markdown" | "json""markdown"Output format

Example — add a remote:

json
{
  "tool": "git_remote",
  "params": {
    "repo_path": "/home/user/myproject",
    "action": "add",
    "name": "upstream",
    "url": "https://github.com/original/repo.git"
  }
}

git_fetch ​

Downloads objects and refs from a remote without modifying the working tree.

ParameterTypeRequiredDefaultDescription
repo_pathstring*—Absolute path to the repository
remotestring"origin"Remote to fetch from
branchstring—Specific branch to fetch. Omit to fetch all branches
prunebooleantrueRemove remote-tracking refs that no longer exist on the remote
response_format"markdown" | "json""markdown"Output format

Example:

json
{ "tool": "git_fetch", "params": { "repo_path": "/home/user/myproject" } }

git_pull ​

Fetches and integrates changes from a remote branch into the current branch.

ParameterTypeRequiredDefaultDescription
repo_pathstring*—Absolute path to the repository
remotestring"origin"Remote to pull from
branchstring—Remote branch to pull. Defaults to the current branch's upstream
rebasebooleanfalseRebase local commits on top of the fetched branch instead of merging
response_format"markdown" | "json""markdown"Output format

Example:

json
{ "tool": "git_pull", "params": { "repo_path": "/home/user/myproject", "rebase": true } }

git_push ​

Uploads local commits to a remote repository.

Force push

force: true requires GIT_ALLOW_FORCE_PUSH=true. Prefer force_with_lease: true, which aborts if the remote has received new commits since your last fetch.

ParameterTypeRequiredDefaultDescription
repo_pathstring*—Absolute path to the repository
remotestring"origin"Remote to push to
branchstring—Local branch to push. Defaults to the current branch
set_upstreambooleanfalseSet the upstream tracking ref (-u)
force_with_leasebooleanfalseForce push only if the remote ref matches your last-fetched state
forcebooleanfalseForce push unconditionally. Requires GIT_ALLOW_FORCE_PUSH=true
no_verifybooleanfalseSkip pre-push hooks. Requires GIT_ALLOW_NO_VERIFY=true
tagsbooleanfalseAlso push all local tags
response_format"markdown" | "json""markdown"Output format

Example — first push of a new branch:

json
{
  "tool": "git_push",
  "params": {
    "repo_path": "/home/user/myproject",
    "set_upstream": true
  }
}

Example — safe force push after a rebase:

json
{
  "tool": "git_push",
  "params": {
    "repo_path": "/home/user/myproject",
    "force_with_lease": true
  }
}

Released under the MIT License.