localmcp
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., "@localmcpsearch for TODO comments, fix the first one, run tests, commit, and push"
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.
localmcp
A local MCP server for AI coding workflows. It gives ChatGPT a constrained view of one project directory plus the tools needed to inspect, edit, test, commit, and push code.
What it can do
localmcp exposes 11 tools:
workspace_info— server, workspace, mode, and tool diagnosticslist_files— list a directorytree— recursively inspect the workspace with depth and entry limitssearch_files— substring or regex search with globs and context linesread_file— read a whole file or a numbered line rangewrite_file— create or replace a fileedit_file— guarded exact-text replacementapply_patch— atomically apply multiple guarded edits to one filedelete_file— delete a filemove_file— move or rename a filerun_command— execute a program directly without a shell
Together these are enough for a coding-agent loop such as:
inspect → search → read → edit → test → diff → commit → pushWorkspace traversal respects the root .gitignore by default, and .git is always excluded.
Related MCP server: Kastor
Security model
All localmcp file tools are confined to LOCALMCP_ROOT. Absolute paths, .. traversal, and symbolic-link escapes are rejected.
Command execution has two modes.
Strict mode
strict is the default. run_command only accepts executables listed in LOCALMCP_ALLOWED_COMMANDS.
LOCALMCP_ROOT="$HOME/src/my-project" \
LOCALMCP_MODE=strict \
LOCALMCP_ALLOWED_COMMANDS="git,node,npm" \
npm startWith an empty allowlist, command execution is effectively disabled.
YOLO mode
For a trusted coding workspace, yolo removes the executable allowlist:
LOCALMCP_ROOT="$HOME/src/my-project" \
LOCALMCP_MODE=yolo \
npm startlocalmcp still requires the command cwd to resolve inside LOCALMCP_ROOT.
YOLO mode is not an OS sandbox. An executed program can still read or modify files outside the workspace, access the network, spawn other processes, or execute code with the permissions of the localmcp process. Use an OS/container sandbox if you need process-level isolation.
Commands use Node.js spawn(..., { shell: false }), so localmcp does not wrap command input in a shell.
Requirements
Node.js 18+
Any command-line tools you want to execute must be installed and available on
PATH
Install
npm installRun
macOS/Linux:
LOCALMCP_ROOT="$HOME/src/my-project" npm startPowerShell:
$env:LOCALMCP_ROOT = "C:\src\my-project"
npm startThe default mode is strict.
Open http://127.0.0.1:8787/ for the read-only status dashboard. It shows the current execution mode, workspace, MCP endpoint, command access, and runtime limits.
The MCP endpoint is:
http://127.0.0.1:8787/mcpServer-side tool logs
Every MCP tool call is logged to stderr with its tool name, status, duration, and summarized input:
[localmcp] 2026-10-01T05:50:55.635Z tool=tree status=ok duration_ms=7.5 input={"path":".","max_depth":1,"max_entries":20,"respect_gitignore":true}Large edit/file contents are summarized instead of being printed verbatim. These logs make it possible to follow the sequence of actions an AI client performs against the workspace.
Configuration
PORT— HTTP port (default8787)LOCALMCP_ROOT— exposed workspace root (default: current directory)LOCALMCP_MODE— execution mode:strict(default) oryoloLOCALMCP_ALLOWED_COMMANDS— comma-separated executable allowlist used by strict mode (default: empty)LOCALMCP_TIMEOUT_MS— command timeout (default120000)LOCALMCP_MAX_OUTPUT— maximum chars captured per stdout/stderr stream (default200000)LOCALMCP_MAX_FILE— maximum file size in bytes (default1000000)
Test
npm testThe test suite covers workspace path confinement, symlink escape rejection, command allowlisting, dashboard rendering, gitignore-aware traversal, search, line slicing, guarded edits, and multi-edit patching.
Test with MCP Inspector
npx @modelcontextprotocol/inspector@latestChoose Streamable HTTP and connect to http://127.0.0.1:8787/mcp.
Connect to ChatGPT
ChatGPT needs a reachable HTTPS /mcp URL. For development, expose port 8787 with a tunnel and use the resulting HTTPS URL ending in /mcp.
A public tunnel creates an entry point to your machine. Keep LOCALMCP_ROOT narrow and use strict mode unless you intentionally want unrestricted executable selection.
This server cannot be deployed
Maintenance
Related MCP Connectors
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Related MCP Servers
- 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.5MIT
- AlicenseNot gradedqualityCmaintenanceLets ChatGPT or MCP clients work with files on your machine, with tools for reading, editing, searching, git operations, and safety checks.MIT
- AlicenseBqualityCmaintenanceEnables ChatGPT to work directly on local projects by reading files, editing code, running tests and commands, inspecting Git state, and managing durable workflows, with optional delegation to local Codex agents for complex tasks.28MIT
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT or any MCP client to operate safely on a designated workspace by listing, reading, searching, writing, and trashing files, inspecting Git status/log/diff, and optionally running allowlisted executables without a shell.Apache 2.0