git-mcp-server

git-mcp-server

A secure, git-aware MCP server for working with local repositories, enabling file management, shell commands, and full git operations within allowed directories.

Category
Visit Server

README

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

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 build

After 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 (../) is blocked.
Shell blocklist rm -rf, sudo, mkfs, dd of=, curl | sh, eval, and similar patterns are rejected before execution.
No root directories You must explicitly list allowed dirs — there is no "allow everything" mode.
Delete is file-only delete_file refuses to delete directories; use run_command for that explicitly.
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_file Read a single file
read_multiple_files Read several files in one call
list_directory List entries in a directory
directory_tree Recursive tree view (depth-limited)
write_file Write / overwrite a file
edit_file Targeted search-and-replace (returns diff)
create_directory Create directory with parents
delete_file Delete a file (not directories)
move_file Move or rename within allowed dirs
search_files Regex search across a directory

Shell

Tool Description
run_command Run a shell command in an allowed directory

Git

Tool Description
git_status Working tree status
git_diff Diff working tree, index, or refs
git_log Commit history
git_branch List, create, delete, rename branches
git_checkout Switch branches / create new ones
git_add Stage files
git_commit Commit staged changes
git_push Push to remote
git_pull Pull from remote (merge or rebase)
git_stash 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 fetchUser across 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured