git-mcp-server
Provides tools for complete git workflow including status, diff, log, branch, checkout, add, commit, push, pull, stash, and more, operating on local repositories.
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-mcp-serverShow me the git status of the current repo"
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-mcp-server
A secure, git-aware MCP server for working with local repositories inside LM Studio (or any MCP host).
Features
Full file access — read, write, edit, create, delete, move, search
Shell execution — run commands in allowed directories with blocked dangerous patterns
Complete git workflow — status, diff, log, branch, checkout, add, commit, push, pull, stash
Path sandboxing — every operation is validated against your allowed directories; path traversal is blocked
No network calls — inference stays local, this server never phones home
Related MCP server: mcp-gitea
Prerequisites
Node.js 18+
npm
git
Installation
# 1. Clone or copy this folder somewhere permanent
cd ~/tools
git clone <this-repo> git-mcp-server # or just copy the folder
# 2. Install dependencies
cd git-mcp-server
npm install
# 3. Build
npm run buildAfter build, the server binary is at dist/index.js.
Configure LM Studio
Open Developer tab → Install → Edit mcp.json in LM Studio and add:
{
"mcpServers": {
"git-mcp": {
"command": "node",
"args": [
"/absolute/path/to/git-mcp-server/dist/index.js",
"--allow-dir", "/path/to/your/repo"
]
}
}
}Multiple repos
{
"mcpServers": {
"git-mcp": {
"command": "node",
"args": [
"/absolute/path/to/git-mcp-server/dist/index.js",
"--allow-dir", "/home/user/projects/repo-one",
"--allow-dir", "/home/user/projects/repo-two"
]
}
}
}Using environment variable instead
{
"mcpServers": {
"git-mcp": {
"command": "node",
"args": ["/absolute/path/to/git-mcp-server/dist/index.js"],
"env": {
"ALLOWED_DIRS": "/home/user/projects/repo-one:/home/user/projects/repo-two"
}
}
}
}On Windows use ; as the separator in ALLOWED_DIRS.
Security model
Layer | What it does |
Path sandboxing | Every file/shell operation resolves the absolute path and checks it starts with an allowed dir. Path traversal ( |
Shell blocklist |
|
No root directories | You must explicitly list allowed dirs — there is no "allow everything" mode. |
Delete is file-only |
|
LM Studio confirmation | LM Studio shows a confirmation dialog for every tool call, so you review before anything executes. |
Available tools
File tools
Tool | Description |
| Read a single file |
| Read several files in one call |
| List entries in a directory |
| Recursive tree view (depth-limited) |
| Write / overwrite a file |
| Targeted search-and-replace (returns diff) |
| Create directory with parents |
| Delete a file (not directories) |
| Move or rename within allowed dirs |
| Regex search across a directory |
Shell
Tool | Description |
| Run a shell command in an allowed directory |
Git
Tool | Description |
| Working tree status |
| Diff working tree, index, or refs |
| Commit history |
| List, create, delete, rename branches |
| Switch branches / create new ones |
| Stage files |
| Commit staged changes |
| Push to remote |
| Pull from remote (merge or rebase) |
| Save, pop, list, or drop stashes |
Example prompts
Once connected in LM Studio:
"Show me the status of the repo at ~/projects/myapp"
"List all branches and tell me which has the most recent commit"
"Read src/index.ts and refactor the error handling"
"Stage all modified files and commit with the message 'fix: handle null case'"
"Search for all usages of
fetchUseracross the repo""Create a new branch called feature/auth and switch to it"
Recommended models for code work
Good tool-calling support is required. These work well locally:
Qwen3 8B / 14B — excellent function calling, strong at code
Llama 4 Scout — solid tool use, good multilingual support
Mistral 7B Instruct — fast, reliable for single-tool workflows
Q4_K_M quantization is the recommended starting point.
This server cannot be deployed
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for siGit (sigit.si): browse repos, search code, manage PRs/issues, web search.
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Related MCP Servers
- FlicenseAqualityDmaintenanceMCP server for managing Git operations on local repositories, allowing users to list repositories, get and create tags, list commits, push tags, and refresh repositories through a standardized interface.63-
- AlicenseBqualityDmaintenanceMCP server for interacting with Gitea, enabling issue and PR management, repository browsing, file reading, and safe git command execution.1144 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA full-featured MCP server for local development with filesystem, shell, editor, session persistence, and security features.2MIT
- FlicenseNot gradedqualityDmaintenanceA secure MCP server for local Git operations with path traversal protection, input validation, and 15 supported Git commands.100 npm-