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
Secure Agent Coding Runtime for local Git repos: policy, RBAC, sessions, approval workflow, and sandboxed writes. Run as a standalone MCP Server for Cursor / Claude Desktop, etc. Optionally connect ChatGPT via OpenAI Secure MCP Tunnel and tunnel-client — no public MCP endpoint required.
Two modes:
Mode | Description |
MCP only (default) | Start MCP Server only; tunnel-client not required |
ChatGPT (optional) | Enable Tunnel in Settings, configure ID/Key, then start Tunnel + MCP |
# MCP only
MCP client → Local Repo MCP → local repo
# ChatGPT (optional)
ChatGPT → Custom MCP App → Secure MCP Tunnel → tunnel-client → Local Repo MCP → local repoFeatures
Policy Engine — read/write/execute rules via
config/policy.yamlEnterprise RBAC — user/role permissions in policy file
Risk Scoring — high-risk operations blocked and scored in audit logs
Session model — write and test operations require an active session
Approval workflow — prepare → approve → apply for patches
Git branch sandbox — protected branches auto-switch to
agent/{session_id}Path sandbox — all operations confined to
REPO_ROOTSecret scanning — blocks credentials in patches before apply
Docker test sandbox — isolated containers (no network, read-only mount)
Prompt injection mitigation — file content wrapped as
UNTRUSTED_DATAAudit logging — structured logs with sensitive data redaction
GUI control panel — full configuration, one-click start and monitoring
Related MCP server: codex-web-bridge
Project Structure
local-repo-mcp/
├── server.py # entry shim
├── config/policy.yaml # policy, RBAC, risk thresholds
├── src/
│ ├── mcp_app/server.py # MCP registration
│ ├── tools/ # read, patch, test, session tools
│ ├── security/ # policy_engine, rbac, risk, scanner
│ ├── session/
│ ├── repo/
│ ├── sandbox/
│ └── audit/
├── tests/ # security acceptance tests
├── gui/
├── run_gui.py
├── start_gui.bat
├── requirements.txt
├── .env.example
└── systemd/Requirements
Dependency | Purpose |
Python 3.11+ | MCP Server runtime |
Git 2.39+ | Repository operations |
ripgrep ( | Code search |
Docker | Test sandbox execution |
Optional — only for ChatGPT integration |
Quick Start
1. Install
git clone git@github.com:cloud-Xolt/local-repo-mcp.git
cd local-repo-mcp
python -m venv .venv
# Windows
.venv\Scripts\activate
.venv\Scripts\pip install -r requirements.txt
# Linux / macOS
source .venv/bin/activate
pip install -r requirements.txt2. GUI (Recommended — all operations in-app)
Windows: double-click start_gui.bat (auto-creates venv, installs deps, opens the panel)
python run_gui.pyFour tabs:
Tab | Purpose |
Overview | One-click MCP / Tunnel+MCP start, env check, quick folder open |
Settings | Repo, mode, RBAC, policy, Tunnel, sandbox — full configuration |
Operations | Git status, session management, Tunnel doctor/init, security tests |
Logs | Live MCP / Tunnel / audit stream |
Save Config writes config.json, .env, and config/policy.yaml.
3. CLI
export REPO_ROOT=/path/to/your/repo
export MCP_MODE=read
export POLICY_RULES=./config/policy.yaml
export AUDIT_LOG=./audit.log
python server.pyChatGPT Integration (Optional)
Prerequisites
ChatGPT workspace with Developer Mode enabled
Tunnel created on OpenAI Platform and linked to your workspace
tunnel-clientinstalled
Initialize Tunnel
export CONTROL_PLANE_API_KEY="sk-..."
tunnel-client init \
--sample sample_mcp_stdio_local \
--profile local-repo \
--tunnel-id tunnel_xxxxxxxx \
--mcp-command "bash -lc 'cd /opt/local-repo-mcp && source .venv/bin/activate && REPO_ROOT=/opt/repos/project-a MCP_MODE=read python server.py'"
tunnel-client doctor --profile local-repo --explain
tunnel-client run --profile local-repoCreate Custom MCP App
In ChatGPT: Apps → Create developer-mode app → Connection: Tunnel → Scan Tools → Create
Recommended Workflow
repo_session_start(user, permission="write")
→ repo_prepare_patch(patch, session_id)
→ repo_approve_patch(patch, session_id)
→ repo_apply_patch(patch, session_id)
→ repo_run_test(command_key, session_id)
→ repo_session_end(session_id)MCP Tools
Tool | Mode | Description |
| write | Create session and agent branch |
| write | End session |
| read | List repository files |
| read | Read file (UNTRUSTED wrapper) |
| read | Search with ripgrep |
| read | git status |
| read | git diff |
| write | Validate patch without applying |
| write | Approve patch for apply |
| write | Apply approved patch |
| test | Run test in Docker sandbox |
Configuration
Variable | Default | Description |
|
| Repository root |
|
|
|
|
| Max file read size (bytes) |
|
| Max patch size (bytes) |
|
| Allow patch on dirty worktree |
|
| Audit log path |
|
| Policy rules file |
|
| Session storage path |
|
| Docker sandbox memory |
|
| Docker sandbox CPUs |
|
| Sandbox tmpfs size (MB) |
|
| Max test timeout (seconds) |
See .env.example for a full template.
Rollout Phases
Phase | Mode | Capabilities |
1 |
| List, read, search, git status/diff |
2 |
| + patch prepare/apply |
3 |
| + Docker sandbox tests |
Never enable: arbitrary shell, git push, git reset, git rebase, etc.
Tests
python -m pytest tests/ -vSecurity Notes
Do not commit
config.json,.env, or API keys to GitStart with
readmode; expand permissions after validationPerform
git pushmanually, not via ChatGPT
Linux Deployment
See systemd/ for service unit examples. Run as a low-privilege user (e.g. repo-mcp).
References
License
MIT
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.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
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