git-remote-mcp
It is an MCP server for working with local git repositories, with custom GitHub API fetch/pull and HTTP API push flows.
Run allowed local git subcommands via the generic
gittool (fetch/pull use GitHub API; push uses diff upload).Inspect repository state:
git_status,git_log,git_diff,git_show,git_branch,git_blame,git_grep,git_ls_files.Modify the working tree and index:
git_add,git_restore,git_reset,git_rm,git_mv,git_clean.Manage history:
git_commit,git_merge,git_rebase,git_cherry_pick,git_revert.Switch branches and manage refs/config:
git_checkout,git_switch,git_tag,git_stash,git_config.Fetch and pull from GitHub without local git network transport, using the GitHub API to resolve refs, download objects, and update refs.
Push commits and create new remote branches by sending patch files or branch metadata to a configured HTTP API endpoint.
Configure remote URL, JWT auth, GitHub token, GitHub API base URL, request timeout, and optional remote URL file via environment variables.
Block unsafe/remote network git commands and options, restricting git operations to local workflows.
Provides tools for interacting with local Git repositories, including status, log, diff, show, branch, blame, grep, ls-files, add, restore, reset, rm, mv, clean, commit, merge, rebase, cherry-pick, revert, checkout, switch, tag, stash, config, and custom push workflows via an HTTP API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@git-remote-mcp commit my changes with message 'update docs'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
git-remote-mcp
Node MCP server that exposes local git commands, uses the GitHub API for fetch/pull object transfer, and uses an HTTP API for custom push workflows.
Install
npm installRelated MCP server: mcp-git
Run
npm startTest
npm testReal GitHub integration tests are opt-in and run a destructive end-to-end workflow against the target branch:
scripts/test-integration.sh \
--repo-url "https://github.com/owner/repo.git" \
--auth-token "github-token" \
--branch "main" \
--pushThe workflow pulls the real repo, edits README.md, commits through the MCP server's local git tools, then pushes the commit back to GitHub with the provided token.
The same values can be passed through environment variables:
GIT_MCP_INTEGRATION_REPO_URL="https://github.com/owner/repo.git" \
GIT_MCP_INTEGRATION_AUTH_TOKEN="github-token" \
GIT_MCP_INTEGRATION_BRANCH="main" \
GIT_MCP_INTEGRATION_PUSH="1" \
npm run test:integrationDo not commit real tokens. Use a disposable test repository or branch because the integration test intentionally writes and pushes a README commit.
HTTP API requests for git_push and git_push_new_branch:
remote_url="https://example.com/git/execute" git_jwt_auth="JWT_TOKEN" npm startRead the remote URL from a local file instead of remote_url:
use_remote_url_file=true remote_url_file="/path/to/remote-url.txt" npm startThe file should contain the URL as plain text. remote_url is only required when using HTTP-backed push tools.
MCP client command:
{
"command": "node",
"args": ["/absolute/path/to/git-remote-mcp/src/index.js"],
"env": {
"remote_url": "https://example.com/git/execute"
}
}Supported environment variables:
remote_urlorREMOTE_URL: HTTP API endpoint for push workflows.use_remote_url_fileorUSE_REMOTE_URL_FILE: set totrue,1,yes, oronto read the URL from a file.remote_url_fileorREMOTE_URL_FILE: local file containing the HTTP API endpoint.git_jwt_authorGIT_JWT_AUTH: JWT token sent asAuthorization: Bearer <token>.github_token,GITHUB_TOKEN,GITHUB_PAT, orGH_TOKEN: optional GitHub token for fetch/pull workflows.github_api_urlorGITHUB_API_URL: optional GitHub API base URL, defaulthttps://api.github.com.REQUEST_TIMEOUT_MS: request timeout, default30000.
Tools
git: generic allowed git command runner.git fetchandgit pulluse the GitHub API flow below;git pushis handled as the custom diff upload flow below.Read/inspect:
git_status,git_log,git_diff,git_show,git_branch,git_blame,git_grep,git_ls_files.Working tree/index:
git_add,git_restore,git_reset,git_rm,git_mv,git_clean.History:
git_commit,git_merge,git_rebase,git_cherry_pick,git_revert.Refs/config:
git_checkout,git_switch,git_tag,git_stash,git_config.Download:
git_fetch,git_pull.Upload:
git_push,git_push_new_branch.
Remote/network git actions are disabled before any local git network transport can run. Blocked commands include:
git clonegit remotegit request-pullgit send-packgit receive-packgit upload-packgit upload-archivegit ls-remotegit submodule
Remote-related options such as --upload-pack, --receive-pack, --exec, --remote, and --recurse-submodules are also blocked in the generic git tool.
Fetch/pull GitHub API flow
git_fetch, git_pull, and generic git with command: "fetch" or command: "pull" do not run local git fetch or git pull.
Instead, the MCP server:
Ensures
cwdis a git repository, runninggit initfirst when needed andrepoUrlis supplied.Reads the configured GitHub
remote.<name>.url, or runsgit remote add <name> <repoUrl>whenrepoUrlis supplied and the remote is missing.Uses
GitApiClient.fetchRef()to resolve the remote branch.Uses
fetchCommitGraph()to find commits missing locally.Uses
fetchTree()andfetchBlob()to download tree entries and blobs.Writes local objects with
git hash-object,git mktree, andgit commit-tree.Updates
refs/remotes/<remote>/<branch>withgit update-ref.For pull only, runs local
git merge refs/remotes/<remote>/<branch>.
The remote URL must be a GitHub HTTPS or SSH URL. git_fetch and git_pull accept optional repoUrl and authToken parameters; generic git fetch and git pull accept --repo-url=<url> or a third positional URL after remote and branch, plus --auth-token=<token>. The branch defaults to the current upstream branch, then the configured refs/remotes/<remote>/HEAD branch. Signed commits may not be reproducible through commit-tree; in that case the fetch fails rather than updating refs to a mismatched commit.
Push upload flow
git_push and generic git with command: "push" do not run git push.
Instead, the MCP server:
Runs local
git diff <base> --binary.Writes the returned diff to a local temporary
.patchfile.Calls
remote_urlagain with a JSON payload containing the patch path.
The upload request looks like:
{
"action": "push",
"command": "push",
"diffPath": "/tmp/git-remote-mcp-xYz/123.patch",
"cwd": "/repo/path",
"base": "HEAD",
"args": [],
"message": "optional message"
}The API should read diffPath and handle the upload/apply operation. Any args are forwarded as metadata only; they are not executed as git push by this MCP server.
New branch push flow
git_push_new_branch asks the API to publish a branch to a remote. If createLocal is true, the MCP server first runs local git switch -c <branch> [startPoint], then sends:
{
"action": "push_new_branch",
"command": "push",
"cwd": "/repo/path",
"branch": "feature/example",
"remote": "origin",
"startPoint": "main",
"setUpstream": true,
"args": ["origin", "feature/example"]
}The API should perform the actual remote branch publish, for example equivalent to git push -u origin feature/example when setUpstream is true.
Local git contract
All non-push tools run local git with:
git <command> ...argsThe optional cwd parameter controls the local repository path.
HTTP contract
The server sends POST requests to remote_url only for push workflows. Diff upload requests look like:
{
"action": "push",
"command": "push",
"diffPath": "/tmp/git-remote-mcp-xYz/123.patch",
"cwd": "/repo/path",
"base": "HEAD",
"args": [],
"message": "optional message"
}and return JSON:
{
"stdout": "main\n",
"stderr": "",
"exitCode": 0
}Any non-2xx HTTP response is treated as an MCP tool error. A JSON response with ok: false or non-zero exitCode is returned to the MCP client as an error result.
REQUEST_TIMEOUT_MS can be set to change the default 30 second remote call timeout.
Available Tools
27 toolsgitC
Run an allowed local git subcommand.
Inputs: command (required), cwd, env, args.
git_addC
Add file contents to the index.
Inputs: paths (required), all, cwd.
git_blameB
Show revision and author information for a file.
Inputs: path (required), cwd.
git_branchC
List or inspect branches in the local repository.
Inputs: all, cwd.
git_checkoutC
Switch branches or restore working tree files.
Inputs: ref (required), cwd, create.
git_cherry_pickC
Apply changes introduced by existing commits.
Inputs: revs (required), cwd, noCommit.
git_cleanC
Remove untracked files from the working tree.
Inputs: cwd, dryRun, directories.
git_commitC
Create a commit from staged changes.
Inputs: message (required), all, cwd.
git_configC
Read or write repository git configuration.
Inputs: name (required), cwd, unset, value.
git_diffC
Read a git diff from the local repository.
Inputs: cwd, ref, staged.
git_grepC
Search tracked files.
Inputs: pattern (required), cwd, pathspec.
git_logB
Read recent commits from the local repository.
Inputs: cwd, oneline, maxCount.
git_ls_filesC
List tracked files and other index information.
Inputs: cwd, others, modified.
git_mergeB
Merge a commit or branch into the current branch.
Inputs: ref (required), cwd, noCommit.
git_mvC
Move or rename a file, directory, or symlink.
Inputs: source (required), destination (required), cwd.
git_pushA
Create a diff file and upload its path to the configured HTTP API instead of running git push.
Inputs: cwd, args, base, message.
git_push_new_branchC
Ask the configured HTTP API to push a new branch to a git remote.
Inputs: branch (required), cwd, remote, startPoint, +2 more.
git_rebaseC
Reapply commits on top of another base.
Inputs: cwd, ref, action.
git_resetC
Reset current HEAD or paths.
Inputs: cwd, mode, target.
git_restoreC
Restore working tree files.
Inputs: paths (required), cwd, staged.
git_revertC
Revert existing commits.
Inputs: revs (required), cwd, noCommit.
git_rmC
Remove files from the working tree and index.
Inputs: paths (required), cwd, cached.
git_showC
Show an object from the local repository.
Inputs: cwd, rev.
git_stashC
Manage git stashes.
Inputs: cwd, ref, action, message.
git_statusB
Run git status on the local repository.
Inputs: cwd, short.
git_switchC
Switch branches.
Inputs: branch (required), cwd, create.
git_tagC
List, create, or delete tags.
Inputs: cwd, name, delete, message.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
The generic `git` tool overlaps with nearly every specific git_* tool, so agents must guess whether to use the catch-all or a dedicated command. `git_checkout`, `git_switch`, and `git_restore` also have overlapping semantics, and `git_push` vs `git_push_new_branch` require careful reading to distinguish.
All tools use a consistent git_ prefix and snake_case naming, making the set highly predictable. The lone exception is the generic `git` tool, which lacks a subcommand suffix and slightly breaks the pattern.
27 tools is heavy for this domain, and many duplicate functionality already exposed by the generic `git` tool. The set feels bloated rather than well-scoped, with several niche subcommands included while other essential ones are missing.
For a server named git-remote-mcp, critical remote operations like fetch, pull, clone, and remote management are absent. Local coverage is broad, but the remote lifecycle is severely incomplete and will cause agent failures for common workflows.
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Manage Nife.io cloud apps, sites, secrets and Git integrations from MCP clients.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
MCP server for siGit (sigit.si): browse repos, search code, manage PRs/issues, web search.
Related MCP Servers
- AlicenseAqualityDmaintenanceA local MCP server that provides a safe, explicit set of Git operations for version control tasks like status, diff, branching, staging, committing, fetching, merging, and pushing.138 npmMIT
- AlicenseNot gradedqualityAmaintenanceA local git MCP server. It exposes 12 git operations to an MCP client over stdio, allowing the client to inspect and work with a git repository on your machine, including status, diffs, log, branches, staging, and commits.MIT
- FlicenseBqualityCmaintenanceEnables secure, policy-controlled operations on local git repositories through MCP, including bounded reads, context-checked patches, allowlisted tasks, and guarded git operations.10-
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to manage files in an isolated workspace and perform lightweight Git operations through a protected Streamable HTTP endpoint, including listing, reading, writing, searching, replacing, and deleting files plus checking status and diffs.1-