local-repo-mcp
Provides tools for interacting with local Git repositories, enabling operations like reading files, searching code, preparing and applying patches, and running tests in a sandboxed environment.
Click on "Install 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., "@local-repo-mcpstart a write session for the repository"
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.
Local Repo MCP
Why this project?
Local Repo MCP solves one narrow problem:
Give ChatGPT, Claude, Cursor, and other MCP clients enough access to work with one local Git repository, while keeping the permission boundary small and understandable.
It is deliberately not an enterprise agent platform, policy engine, RBAC service, or terminal agent.
Related MCP server: codex-web-bridge
Highlights
One configured Git repository only
Read-only by default
No general-purpose shell
No unrestricted
write_fileValidated text-patch writes
Filtered Git status and diff
No Git push, pull, checkout, reset, rebase, merge, stash, or clean
Optional predefined tests for trusted repositories
STDIO and Streamable HTTP transports
Optional OpenAI Secure MCP Tunnel
Simplified Chinese and English GUI
Architecture
Local client with STDIO
Local MCP client
│
│ starts a subprocess
▼
Local Repo MCP (STDIO)
│
▼
One local Git repositoryURL-based client with Streamable HTTP
MCP client
│
│ http://127.0.0.1:8000/mcp
▼
Local Repo MCP (Streamable HTTP)
│
▼
One local Git repositoryChatGPT with Secure MCP Tunnel
ChatGPT
│
OpenAI Secure MCP Tunnel
│
tunnel-client
│
Local Repo MCP (STDIO or HTTP)
│
Local Git repositoryTools
Tool | Minimum mode | Description |
|
| List allowed repository files |
|
| Read one UTF-8 text file |
|
| Fixed-string source-code search |
|
| Filtered Git working-tree status |
|
| Filtered staged or unstaged diff |
|
| Apply one validated unified text patch |
|
| Run one predefined test command |
Access modes
Mode | Meaning |
| Read, search, Git status, and Git diff |
| Read tools plus validated patch application |
| Write tools plus predefined test commands |
Start with read.
Transports
STDIO
Use STDIO when the MCP client runs on the same machine and can launch a subprocess. STDIO has no host, port, or endpoint URL.
Streamable HTTP
Use Streamable HTTP for clients that connect to an MCP URL or run in another process/device.
Default endpoint:
http://127.0.0.1:8000/mcpSecurity defaults:
binds to
127.0.0.1;built-in Host/Origin validation;
optional Bearer Token;
non-local binds require Bearer authentication and an explicit allowed-host list.
Do not bind to 0.0.0.0 without understanding the network exposure. Use HTTPS through a trusted reverse proxy for non-local deployments.
Requirements
Python 3.11+
Git 2.39+
ripgrep (
rg)optional: OpenAI
tunnel-client
Docker is not required.
Install
git clone https://github.com/cloud-Xolt/local-repo-mcp.git
cd local-repo-mcp
python -m venv .venvWindows PowerShell:
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python run_gui.pyLinux / macOS:
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python run_gui.pyGUI
The GUI has five focused pages:
Home — repository, access mode, transport, and common settings
MCP Server — process status, real MCP handshake test, and client configuration
ChatGPT Connection — Secure MCP Tunnel setup and diagnostics
Logs — MCP, Tunnel, and audit logs
About — scope, version, documentation, and project links
Common settings stay visible. Limits, dirty-worktree behavior, audit logging, and HTTP allowlists are collapsed under Advanced Settings.
The GUI stores normal configuration under the current user's config directory. The OpenAI runtime API key is memory-only and is never written to disk. An HTTP Bearer token, when enabled, is stored separately with restrictive file permissions.
Run without the GUI
STDIO
Linux / macOS:
export REPO_ROOT="/absolute/path/to/repository"
export MCP_MODE="read"
export MCP_TRANSPORT="stdio"
python server.pyWindows PowerShell:
$env:REPO_ROOT = "C:\absolute\path\to\repository"
$env:MCP_MODE = "read"
$env:MCP_TRANSPORT = "stdio"
python server.pyExample local-client configuration:
{
"mcpServers": {
"local-repo": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/local-repo-mcp/server.py"],
"env": {
"REPO_ROOT": "/absolute/path/to/repository",
"MCP_MODE": "read",
"MCP_TRANSPORT": "stdio"
}
}
}
}Streamable HTTP
export REPO_ROOT="/absolute/path/to/repository"
export MCP_MODE="read"
export MCP_TRANSPORT="streamable-http"
export HTTP_HOST="127.0.0.1"
export HTTP_PORT="8000"
export HTTP_PATH="/mcp"
python server.pyConnect to:
http://127.0.0.1:8000/mcpBearer authentication:
export HTTP_AUTH_MODE="bearer"
export HTTP_AUTH_TOKEN="replace-with-a-random-token"Real connection test
The GUI connection test does not merely check that a directory exists. It:
creates an MCP client session;
performs protocol initialization;
lists the tools;
verifies the expected read tools;
calls
repo_git_status;closes the session cleanly.
For STDIO it launches a temporary child process. For HTTP it connects to the running endpoint.
ChatGPT and Secure MCP Tunnel
Install tunnel-client from an official OpenAI source. This project does not download or update it automatically.
STDIO profile example:
export CONTROL_PLANE_API_KEY="sk-..."
tunnel-client init \
--sample sample_mcp_stdio_local \
--profile local-repo \
--tunnel-id tunnel_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
--mcp-command "/absolute/path/to/.venv/bin/python /absolute/path/to/local-repo-mcp/launch_mcp.py"
tunnel-client doctor --profile local-repo --explain
tunnel-client run --profile local-repoThe GUI can detect the executable, initialize a profile, run Doctor, and start/stop the Tunnel. The runtime API key remains in memory only.
For HTTP Tunnel mode, start the HTTP MCP server first. Automatic HTTP Tunnel setup currently supports an unauthenticated localhost endpoint; for custom Bearer-authenticated HTTP Tunnel setups, configure tunnel-client manually or use STDIO Tunnel.
Configuration
Core
Variable | Default | Description |
|
| The single repository root |
|
|
|
|
|
|
|
| Maximum readable file size |
|
| Maximum patch size |
|
| Search result limit |
|
| Diff/test output limit |
|
| Allow patching a dirty worktree |
| empty | Optional audit JSONL path |
|
| Maximum test timeout |
HTTP
Variable | Default | Description |
|
| Bind address |
|
| Listen port |
|
| MCP endpoint path |
|
|
|
| empty | Bearer token |
| localhost values | Host allowlist |
| localhost values | Origin allowlist |
|
| JSON response mode |
|
| Stateless HTTP mode |
|
| Maximum request body |
Security model
The project is designed for one local user and one configured Git repository.
Controls include:
relative paths only;
parent traversal rejected;
symbolic links rejected;
common sensitive files blocked;
binary/non-UTF-8 reads rejected;
fixed-string
ripgrepinvocation withshell=False;blocked paths filtered from Git status and diff;
text-patch-only writes;
binary, rename, copy, submodule, symlink, and mode-change patches rejected;
common credential patterns blocked in added patch lines;
bounded inputs and outputs;
no general-purpose shell;
no automatic branch, commit, or push operations.
Limitations:
common credential detection is not a complete secret scanner;
write mode modifies the current worktree;
test mode executes repository code and must be used only with trusted repositories;
the MCP client controls user-facing confirmations;
users should inspect
git diff, commit, and push manually.
See SECURITY.md.
Predefined tests
Key | Command |
|
|
|
|
|
|
|
|
|
|
|
|
Users cannot provide arbitrary commands or additional command arguments.
Development
python -m pytest tests/ -v
python -m compileall server.py launch_mcp.py run_gui.py src guiProject scope
In scope:
one local Git repository;
safe reading and search;
filtered Git inspection;
validated text patches;
optional predefined tests;
STDIO and Streamable HTTP;
optional GUI and Secure MCP Tunnel.
Out of scope:
arbitrary shell access;
general filesystem access;
RBAC and multi-user hosting;
enterprise policy engines or risk scoring;
automatic branch management;
automatic commit, merge, or push;
cloud execution and untrusted-code sandboxing;
automatic
tunnel-clientinstallation.
License
MIT License. See LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceRuntime safety guardrails for AI coding agents. Checks file access, validates shell commands, and scores your repo's AI safety — all via MCP.Last updated38MIT
- Alicense-qualityCmaintenanceLocal MCP server bridging ChatGPT Web to local tools for file, shell, git, test, and process management with secure policy controls.Last updatedMIT
- Flicense-qualityCmaintenanceA local MCP server that provides controlled repository access with policy-based file filtering, secret redaction, and audit logging for AI coding agents.Last updated
- AlicenseBqualityCmaintenanceAgent-native SSH control plane with a local Web Terminal, human-in-the-loop secret input, keychain-backed profiles, and user-confirmed uploads for Codex, Claude Code, and MCP-compatible coding agents.Last updated181Apache 2.0
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Zero-install security baseline for AI coding agents — OWASP/CWE-cited rules over MCP.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cloud-Xolt/local-repo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server