MCP Git Server
Exposes Git operations as MCP tools, enabling repository status checks, initialization, cloning, branch management, file staging and restoring, commits, logs, diffs, rebasing, stashing, cherry-picking, and remote fetch/pull/push workflows.
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., "@MCP Git Server commit my changes with message 'Fix login bug' and push to main"
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.
MCP Git Server
A Model Context Protocol (MCP) server that exposes Git operations as tools for use with GitHub Copilot in VS Code or IntelliJ IDEA.
Features
This MCP server provides comprehensive Git functionality through a standard set of tools:
Repository Management
git_status- Show working tree statusgit_init- Initialize a new repositorygit_clone- Clone a repository
Branch Operations
git_branch_list- List all branchesgit_branch_create- Create a new branchgit_branch_delete- Delete a branchgit_checkout- Switch branches or restore filesgit_merge- Merge branches
File Operations
git_diff- Show changes between commits, working tree, etc.git_add- Stage filesgit_reset- Unstage filesgit_restore- Restore working tree files
Commit Operations
git_commit- Record changes to the repositorygit_log- Show commit logsgit_show- Show commit details
Advanced Operations
git_rebase- Reapply commits on top of another basegit_stash- Stash changesgit_stash_pop- Apply stashed changesgit_stash_list- List stashed changesgit_cherry_pick- Apply a commit to current branch
Remote Operations
git_remote_list- List remotesgit_remote_add- Add a new remotegit_fetch- Download objects and refs from remotegit_pull- Fetch and merge from remotegit_push- Update remote refs
Related MCP server: Gitrama MCP Server
Installation
Option 1: Using a Released Version (Recommended)
Go to the Releases page of this repository
Download the latest
git-mcp_X_Y_Z.zipfileExtract the zip file to a directory of your choice:
# Example: extract to ~/mcp-servers/git mkdir -p ~/mcp-servers/git unzip git-mcp_1_0_0.zip -d ~/mcp-servers/gitNote the path to the extracted
index.jsfile (e.g.,~/mcp-servers/git/index.js)Skip to the Usage section below to configure your IDE
Option 2: Building from Source
If you want to modify the code or contribute to development:
Clone or download this repository
Install dependencies:
npm installBuild the TypeScript code:
npm run buildThe build process uses esbuild to create a single bundled file that includes all dependencies. This means:
No
node_modulesfolder is needed for the built versionThe entire application is contained in
dist/index.js(plus source maps)Easy to distribute and deploy
Usage
With GitHub Copilot
VS Code
Ensure you have the latest version of VS Code with GitHub Copilot extension installed.
Configure the MCP server by creating or updating your MCP settings. The location depends on your setup:
User settings:
~/.config/Code/User/globalStorage/github.copilot-chat/mcp.jsonOr through VS Code settings UI
Add this server to your
mcp.json:For downloaded release:
{ "mcpServers": { "git": { "command": "node", "args": ["/Users/yourusername/mcp-servers/git/index.js"] } } }For source build:
{ "mcpServers": { "git": { "command": "node", "args": ["/absolute/path/to/mcp-git-server/dist/index.js"] } } }Note: Use the absolute path to wherever you extracted the release or built the project.
Restart VS Code or reload the window.
IntelliJ IDEA
Ensure you have the latest version of IntelliJ IDEA with GitHub Copilot plugin installed.
Configure MCP servers in IntelliJ settings:
Go to Settings → Tools → GitHub Copilot → MCP Servers
Add a new server configuration
Add the server with:
Name:
gitCommand:
nodeArguments:
For downloaded release:
/Users/yourusername/mcp-servers/git/index.jsFor source build:
/absolute/path/to/mcp-git-server/dist/index.js
Note: Use the absolute path to wherever you extracted the release or built the project.
Restart IntelliJ IDEA.
Standalone Usage
You can also run the server standalone and communicate with it via stdio:
npm startTool Usage Examples
All tools accept an optional repoPath parameter. If not provided, the current working directory is used.
Check status
{
"name": "git_status",
"arguments": {
"repoPath": "/path/to/repo" // optional
}
}Stage files
{
"name": "git_add",
"arguments": {
"files": ["src/index.ts", "README.md"]
}
}Create and checkout a new branch
{
"name": "git_checkout",
"arguments": {
"ref": "feature/new-feature",
"createBranch": true
}
}Commit changes
{
"name": "git_commit",
"arguments": {
"message": "Add new feature",
"files": ["src/feature.ts"] // optional, will stage these files first
}
}View commit log
{
"name": "git_log",
"arguments": {
"maxCount": 10 // optional
}
}Push to remote
{
"name": "git_push",
"arguments": {
"remote": "origin",
"branch": "main",
"setUpstream": true // optional
}
}Response Format
All tools return a consistent response format:
{
"success": boolean, // true if operation succeeded
"message": string, // human-readable message
"data": any // optional additional data
}Example Success Response
{
"success": true,
"message": "Staged 2 file(s): src/index.ts, README.md"
}Example Error Response
{
"success": false,
"message": "Failed to stage files: pathspec 'nonexistent.txt' did not match any files"
}Development
Build
Build the project using esbuild (bundles all dependencies):
npm run buildThis creates:
dist/index.js- Bundled application with all dependencies includeddist/index.js.map- Source map for debuggingdist/package.json- Minimal package.json for the distribution
The bundled output is self-contained and doesn't require node_modules to run.
Build Type Definitions Only
If you need just TypeScript type definitions:
npm run build:typesWatch Mode
For development with auto-rebuild on changes:
npm run watchNote: This uses TypeScript's watch mode, not esbuild bundling.
Clean
Remove build artifacts and release archives:
npm run cleanThis removes:
dist/directoryAll
git-mcp_*.zipfiles
Release Process
This project includes a release script that automates version bumping, building, and publishing to GitHub releases.
Prerequisites
GitHub Personal Access Token: You need a GitHub personal access token with
reposcope.To create one:
Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
Click "Generate new token (classic)"
Select the
reposcope (full control of private repositories)Generate and copy the token
Set the token as an environment variable:
export GHE_TOKEN="your_github_token_here"For persistence, add it to your
~/.zshrcor~/.bashrc:echo 'export GHE_TOKEN="your_token"' >> ~/.zshrc source ~/.zshrc
Running a Release
Execute the release script from the project root:
./bin/releaseThe script will:
Prompt for version bump type:
Option 1: Major version (breaking changes) - e.g., 1.0.0 → 2.0.0
Option 2: Minor version (new features) - e.g., 1.0.0 → 1.1.0
Option 3: Patch version (bug fixes) - e.g., 1.0.0 → 1.0.1
Update
package.jsonwith the new versionClean previous build artifacts using
npm run cleanBuild the project using
npm run buildCreate a zip archive named
git-mcp_{major}_{minor}_{patch}.zipcontaining thedist/folderCreate a GitHub release with tag
v{version}Upload the zip file as a release asset
After Release
The script will remind you to commit and push the updated package.json:
git add package.json
git commit -m 'Bump version to X.Y.Z'
git push origin masterNotes
The script supports both GitHub.com and GitHub Enterprise
It automatically detects your repository from the git remote
The script will exit with an error if any step fails
Project Structure
mcp-git-server/
├── src/
│ ├── index.ts # Main server entry point
│ ├── git-tools.ts # Git operation implementations
│ └── types.ts # TypeScript type definitions
├── dist/ # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── README.mdRequirements
Node.js 18 or higher
Git installed and available in PATH
GitHub Copilot (for integration with VS Code or IntelliJ)
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Available Tools
25 toolsgit_add
Add file contents to the staging area
Inputs: files (required), repoPath.
git_branch_create
Create a new branch
Inputs: branchName (required), repoPath.
git_branch_delete
Delete a branch
Inputs: branchName (required), force, repoPath.
git_branch_list
List all branches in the repository
Inputs: repoPath.
git_checkout
Switch branches or restore working tree files
Inputs: ref (required), repoPath, createBranch.
git_cherry_pick
Apply the changes introduced by an existing commit
Inputs: commit (required), repoPath.
git_clone
Clone a repository from a URL
Inputs: url (required), repoPath, targetPath.
git_commitC
Record changes to the repository
Inputs: message (required), amend, files, repoPath.
git_diff
Show changes between commits, commit and working tree, etc. Supports commit ranges like HEAD...origin/master
Inputs: files, cached, repoPath, toCommit, +2 more.
git_fetch
Download objects and refs from another repository
Inputs: branch, remote, repoPath.
git_init
Initialize a new git repository
Inputs: repoPath.
git_log
Show commit logs
Inputs: file, maxCount, repoPath.
git_merge
Merge a branch into the current branch
Inputs: branch (required), repoPath, noFastForward.
git_pull
Fetch from and integrate with another repository or local branch
Inputs: branch, rebase, remote, repoPath.
git_push
Update remote refs along with associated objects
Inputs: force, branch, remote, repoPath, +1 more.
git_rebase
Reapply commits on top of another base tip
Inputs: branch (required), repoPath, interactive.
git_remote_add
Add a new remote
Inputs: url (required), name (required), repoPath.
git_remote_list
List all configured remotes
Inputs: repoPath.
git_reset
Unstage files or reset current HEAD to specified state
Inputs: mode, files, commit, repoPath.
git_restore
Restore working tree files
Inputs: files (required), staged, repoPath.
git_showC
Show details of a commit
Inputs: ref, repoPath.
git_stash
Stash the changes in a dirty working directory
Inputs: message, repoPath, includeUntracked.
git_stash_list
List all stashed changes
Inputs: repoPath.
git_stash_pop
Apply stashed changes and remove them from stash list
Inputs: index, repoPath.
git_status
Show the working tree status including modified, staged, and untracked files
Inputs: repoPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
GitHub Copilot MCP: code, repo, PR, workflow tools for AI assistants.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides comprehensive Git functionality to MCP clients, enabling users to manage repositories through operations like commits, diffs, and branch management via natural language. It automatically detects the current working directory and supports multi-project workflows across different local environments.163MIT

Gitrama MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceProvides 15 MCP tools for AI-powered Git intelligence, enabling commit messages, branch creation, PR descriptions, code review, diff analysis, and push operations directly from your AI assistant.MIT- AlicenseNot gradedqualityDmaintenanceA complete Git CLI wrapper for the Model Context Protocol (MCP), enabling AI assistants to perform all git operations through MCP tools.MIT
- AlicenseNot gradedqualityFmaintenanceProvides comprehensive git tooling via MCP, including status, diffs, commits, branches, stashes, and multi-root inventory, enabling AI agents to manage repositories.9 npmMIT