local-agent-mcp
Provides local Git integration, allowing agents to inspect repository status, view diffs, and create commits for explicitly listed files without pushing.
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-agent-mcpRun the tests in my local project and fix any failures."
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 Agent MCP
English · Permissions · Architecture
Let ChatGPT Pro work directly on your local computer
You assign tasks in ChatGPT, and it can call local MCP tools: read projects, modify files, run tests, check Git Diff, create Commits.
Complex tasks can be handed off to local Codex. ChatGPT continues to handle breaking down steps, checking progress, adding requirements, and final review.
ChatGPT Pro
→ Local Agent MCP
→ 本地文件 / 测试 / Git / CodexNo need to repeatedly copy code, and no need to route every task through Codex.
This is an unofficial community project. It is not an OpenAI product and does not represent OpenAI.
Related MCP server: chatgpt-codex-tools-mcp
Quick Start
Prerequisites
Prepare the following:
macOS or Linux
Python 3.11 or later
Git
OpenAI official
tunnel-clientA ChatGPT environment that supports custom MCP Apps
A Tunnel ID
A corresponding Tunnel Runtime Key
On macOS, you can install the basic tools first:
brew install uv tmux
brew install openai/tools/tunnel-clientOne sentence to hand it to AI
Send this sentence to an AI that can operate a local terminal:
Install https://github.com/ezra-y/local-agent-mcp on my computer, and follow the README to complete configuration, startup, and verification.
Manual installation: see Install to ChatGPT.
Highlights
Highlight | Description |
ChatGPT directly operates local projects | Common file, test, and Git operations are done by ChatGPT calling local tools directly. |
ChatGPT acts as the overall director | Simple tasks are completed directly; complex tasks can be handed off to local Codex. |
Agents can be extended further | Codex is the first Adapter; future Agents go into the same control layer. |
Task status is queryable | Workflow, Step, and Job are saved to local SQLite and remain viewable after restart. |
Prevents duplicate execution | The same |
Clear Git process | Check status and Diff first, then commit explicitly listed files; no automatic Push. |
Transparent permissions | Both Tools and Resources can return current permission information. |
28 Tools
Category | Tools | Purpose |
Permissions |
| View the current root directory, hard limits, and high-permission entry points. |
Files |
| List, read, create, overwrite, or partially modify text files. |
Commands & Tests |
| Run commands or tests, and view or stop background Jobs. |
Git |
| View status, view Diff, commit explicitly listed files; safe Commit disables Hooks and signing, and rejects Git Filters. |
Workflows |
| Create a Workflow, create a Step, start a Job, query overall status. |
One-shot read-only Codex |
| Have local Codex do a one-time read-only check. |
Codex Threads / Turns |
| Read old Threads, start, resume, supplement, stop, and check Codex Turns. |
Health check |
| View service status, active Job count, and Artifact capacity warnings. |
A direct delete_file Tool is not exposed. apply_patch also refuses to delete entire files.
git_commit disables repository Hooks and commit signing by default. When a clean / process Git Filter is detected, it refuses to commit to avoid structured Commits implicitly running repository programs. git_diff also disables external Diff and textconv.
Permissions Resource
In addition to the get_permissions Tool, the service also provides:
local-agent://permissionsThe content includes:
当前允许访问哪里
哪些目录和文件被禁止
读写是否开启
有没有直接删除工具
高权限入口有哪些get_permissions will continue to be kept for clients that do not yet display MCP Resources.
Permissions and Privilege Reduction
Default Scope
Structured file and Git tools can access the current user's Home by default:
$HOMEThis usually includes Desktop, Downloads, Documents, and other projects in personal directories.
Things Forbidden by Code
Structured file tools will refuse:
.ssh
.aws
.azure
.codex
.docker
.gnupg
.kube
.Trash
Library
.env 和 .env.*
常见凭据文件
.pem / .key / .p12 / .pfx 私钥文件
符号链接路径Additionally:
There is no direct file deletion Tool.
apply_patchcannot delete entire files.There is no Git Push Tool.
git_commitonly commits explicitly listed paths.
Narrowing the Structured Scope
Set before startup:
export LOCAL_AGENT_MCP_ROOT="$HOME/Projects"The old config name CODEX_MCP_ROOT remains compatible.
After that, these tools can only access $HOME/Projects:
list_files
read_file
write_file
apply_patch
git_status
git_diff
git_commitForeground startup example:
export LOCAL_AGENT_MCP_ROOT="$HOME/Projects"
./scripts/run_tunnel.shHigh-Permission Entry Points
Capability | Actual Scope |
| Will execute project code. Test code can create, modify, or delete files. |
| The invoked local program may access locations outside the structured root directory. |
Full Codex Turn | Can read/write, run commands, and access the network, and may also access locations outside the structured root directory. |
LOCAL_AGENT_MCP_ROOT is the hard boundary for structured file and Git tools, not a system sandbox for the entire process.
When repository Hooks, Git LFS, or other Filters are needed, commit manually, or use the high-permission run_command after explicitly checking the repository configuration.
v0.5.1 does not yet have per-Tool hide or disable configuration. For stronger isolation, use a separate system user, virtual machine, container, or maintain a version with trimmed Tools.
Full details: docs/permissions.md.
Install to ChatGPT
1. Download and test
git clone https://github.com/ezra-y/local-agent-mcp.git
cd local-agent-mcp
uv sync --locked --all-groups
uv run pytest -qLocal Codex lookup order:
The path specified by
CODEX_BIN.codexinPATH.The Codex built into the macOS ChatGPT App.
2. Save the Runtime Key
macOS:
./scripts/save_tunnel_key.shLinux:
export CONTROL_PLANE_API_KEY="<你的 Runtime Key>"3. Generate Tunnel configuration
export CONTROL_PLANE_TUNNEL_ID="tunnel_<32位小写十六进制>"
./scripts/configure_tunnel.shLocal configuration is saved at:
.runtime/profiles/4. Start the Tunnel
Foreground:
./scripts/run_tunnel.shBackground:
tmux new-session -d \
-s local-agent-mcp-tunnel \
-c "$PWD" \
./scripts/run_tunnel.shWait for the service to be ready:
for i in {1..30}; do
curl -fsS http://127.0.0.1:8741/readyz && break
sleep 1
doneOn success it returns:
readyLocal status page:
http://127.0.0.1:8741/ui5. Connect in ChatGPT
Open Settings → Apps.
Enable Developer Mode.
Create or connect the corresponding custom MCP App.
After the Tunnel starts, click Refresh / Scan tools.
Start a new chat and select
@Local Agent.
6. Verify
Send in a new chat:
@Local Agent
调用 get_permissions。
报告当前工具总数、版本和 allowed_root。Expected result for v0.5.1:
工具总数:28
版本:0.5.1
allowed_root:你的 Home,或你设置的 LOCAL_AGENT_MCP_ROOTIf the client supports Resources, try reading:
local-agent://permissionsRun Local stdio MCP Only
When not using the ChatGPT Tunnel:
./scripts/run_mcp.shYou can also install it as a global command:
uv tool install .
local-agent-mcpThe old command local-codex-mcp still works.
Daily Use
The project parameter in tools is usually a path relative to $HOME:
Documents/Codex/local-agent-mcp
Downloads/my-project
Desktop/example-projectAbsolute paths inside Home are also supported. project="." represents the entire structured root directory; with default settings, that is the entire Home.
A Common Task
@Local Agent
在 Downloads/my-project 修复登录失败问题。
检查相关代码和 Git 状态,完成修改、测试、Diff 和 Commit。Common flow:
get_permissions
→ git_status / list_files / read_file
→ write_file / apply_patch
→ run_tests
→ git_diff
→ git_commitFor complex tasks, you can add an explicit Workflow or local Codex.
How Workflows Run
Five Concepts
Concept | Meaning |
Workflow | The whole thing the user asks for. |
Step | A stable, explicit action within a Workflow. |
Job | One actual execution of a Step. |
Codex Thread | The chat and work context saved by Codex. |
Codex Turn | One round of work within a Thread. |
Execution Order
create_workflow
→ create_step
→ start_step
→ get_job / get_workflowcreate_step currently supports four execution types:
| Purpose |
| Run tests. |
| Run a local command in argument-array form. |
| Have Codex do a one-time read-only check. |
| Start a Codex Turn that keeps working. |
File reading and modification are still done directly by read_file, write_file, and apply_patch.
Example: Creating a Test Step
create_workflow(
project="Downloads/my-project",
title="验证登录修复"
)
→ workflow_idcreate_step(
workflow_id=workflow_id,
position=1,
name="运行测试",
executor_kind="tests",
spec={
"argv": ["uv", "run", "pytest", "-q"],
"cwd": ".",
"timeout_seconds": 900
},
write_scope="worktree"
)
→ step_idstart_step(
workflow_id=workflow_id,
step_id=step_id,
attempt=1
)
→ job_idget_job(job_id)
get_workflow(workflow_id)The execution identity is:
workflow_id + step_id + attemptStarting again with the same number returns the original Job and does not execute again. For an explicit rerun, use a new attempt, e.g. attempt=2.
Parallel Rules
同一个 Codex Thread:同一时间一个活动 Turn
同一个 Worktree:同一时间一个写入者
同一个仓库:不同 Worktree 可以并行Use steer_codex_turn to add requirements to an active Turn, and interrupt_codex_turn to stop it.
Local State and Logs
When running from source:
.runtime/state.sqlite3
.runtime/artifacts/<job_id>/The installed command uses by default:
$HOME/.local/state/local-agent-mcp/state.sqlite3Custom location:
export LOCAL_AGENT_MCP_STATE_PATH="/自定义位置/state.sqlite3"The old config name CODEX_WORKFLOW_STATE_PATH remains compatible. Existing old state databases will continue to be read.
Long logs are stored in Artifact files. SQLite saves the path, size, and SHA-256.
Artifacts are not deleted automatically. When the total recorded amount exceeds 1 GiB, ping returns a warning.
Updates
git pull
uv sync --locked --all-groups
uv run pytest -qThen restart the Tunnel and click Refresh / Scan tools in ChatGPT.
Project Structure
src/local_agent_mcp/
├── server.py MCP 入口与公共 Tool / Resource
├── adapters/ 本地 Agent Adapter;当前包含 Codex
├── workflow_*.py Workflow、Step、Job、锁和 SQLite
├── command_jobs.py 后台命令与测试
├── workspace_tools.py 文件读写与 Patch
└── git_tools.py Git 状态、Diff 和 Commit
tests/ 单元测试与集成测试
docs/ 权限和架构说明
scripts/ MCP 与 Tunnel 启动脚本Test files are kept in the repository. They are used to verify permission boundaries, cross-platform operation, packaging, and compatibility; the installed wheel only contains runtime code.
Development Checks
uv run pytest -q
uv run python scripts/check_public_release.py
zsh -n scripts/*.sh
uv buildThe main MCP entry point is src/local_agent_mcp/server.py. src/codex_bridge.py is kept as a compatibility alias for old imports and old startup methods.
Uninstall and Local Data
The uninstaller does not automatically delete SQLite, Artifacts, Tunnel profiles, or the source directory. Please check first and decide which data to keep.
License
MIT, see LICENSE.
⚠️ The default configuration opens fairly broad local permissions: ChatGPT can read and write most projects under the current user's Home, and can run tests, commands, and local Agents; only use this on computers, accounts, and projects you trust.
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
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT to remotely orchestrate local Codex and Claude Code agents for file editing and command execution via a secure Cloudflare tunnel, bridging cloud AI planning with local execution.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables ChatGPT to inspect and edit local projects through a secure MCP interface, offering workspace management, file operations, git integration, and safe command execution.4MIT
- AlicenseNot gradedqualityAmaintenanceBridges ChatGPT with local computer for controlled file and project management, featuring session-based collaboration and diff tracking.4Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to securely control a local workstation via an MCP tunnel, exposing 44 tools for file/project editing, git, process supervision, browser automation, and Office document handling across macOS, Linux, and Windows.MIT
Related MCP Connectors
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Git-backed platform for skills, tools, and context for AI agents
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/ezra-y/local-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server