chatgpt-codex-tools-mcp
Provides tools for inspecting git state, including status and diff, and allows limited git commands through a review workflow.
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., "@chatgpt-codex-tools-mcpshow git diff for my workspace"
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.
简体中文 | English
chatgpt-codex-tools-mcp
A local MCP server that gives ChatGPT a constrained, Codex-style toolbox for working with your own projects.
ChatGPT does the reasoning. This server provides workspace-scoped file reading, search, Git inspection, preview-before-confirm edits, structured process execution without a shell, and optional web and SQLite tools.
Community project; not affiliated with OpenAI or Codex.
The MCP endpoint has no application-layer authentication. Keep it bound to
127.0.0.1and place a trusted ingress in front of it. With Tailscale Funnel, expose only the OAuth gateway on127.0.0.1:3334, never MCP port3333directly.
Highlights
Local HTTP MCP endpoint:
http://127.0.0.1:3333/mcpWorkspace boundary through
CTM_ALLOWED_ROOTSBuilt-in deny rules for common private files and sensitive paths
Preview-then-confirm file and SQLite writes
Structured
command+args[]execution; no shell syntax or shell toolForeground and managed background processes with time/output limits
Best-effort secret redaction on tool output
Optional SearXNG search and public HTTP fetch, disabled by default
Optional allowlisted SQLite reads and bounded structured writes, disabled by default
Windows initializer for OpenAI Secure MCP Tunnel, Tailscale Funnel, or both
Related MCP server: Windows Local MCP
Requirements
Node.js 20 or newer for the core server; Node.js 24 is recommended
npm
ChatGPT access that supports custom MCP apps / connectors in Developer Mode (availability depends on plan and workspace policy)
OpenAI
tunnel-clientfor the OpenAI Secure MCP Tunnel path, or Tailscale for the Funnel pathSQLite tools require a runtime with
node:sqlitesupport (Node.js 22.5+; Node.js 24+ recommended)
On Windows, scripts/start-mcp.ps1 resolves Node from explicit PowerShell parameters first, then environment overrides, then config.json. If none of those select a runtime, it falls back to the Codex bundled runtime under %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node, then node on PATH. Relevant settings are runtime.codexRuntimeRoot / CTM_CODEX_RUNTIME_ROOT and runtime.fallbackNodeBin / OPENCLAW_NODE_BIN.
Windows quick start
1. Get the project
Download the ZIP attached to the latest GitHub Release and extract it, or clone:
git clone https://github.com/Kerberos255/chatgpt-codex-tools-mcp.git
cd chatgpt-codex-tools-mcp2. Initialize once
Run:
init-windows.cmdThe initializer:
asks for narrow allowed workspace roots, such as
D:\Projectsinstalls npm dependencies and builds
dist/server.jslets you choose OpenAI Secure MCP Tunnel, Tailscale Funnel, or Both
creates an ignored local
config.jsonon first setup and preserves an existing one unless explicitly forcedcreates
tunnel\openaiand/ortunnel\tailscalefor tunnel-specific binaries, profiles, and local statereuses an existing tunnel runtime when possible; otherwise downloads the selected runtime from its official distribution source
verifies the downloaded OpenAI
tunnel-clientZIP against the releaseSHA256SUMS.txtgenerates only the selected one-click launcher(s)
Depending on your selection, the project root gains:
start-openai-mcp.cmd
start-tailscale-mcp.cmdYou can run init-windows.cmd again later and configure the other tunnel too; the existing launcher is kept, so both can coexist.
OpenAI-specific local files live under tunnel\openai. The launcher reads CONTROL_PLANE_API_KEY from the environment, then tunnel\openai\control-plane-api-key.txt when present, or asks for it with a hidden prompt.
First-time OpenAI setup also needs the OpenAI Tunnel ID used by ChatGPT and tunnel-client; init-windows.cmd asks for it when no matching local profile exists. The runtime API key should have Tunnels Read + Use permission for that tunnel; do not substitute a tunnel-admin key for the long-running runtime.
Tailscale-specific local files live under tunnel\tailscale. The initializer creates owner-password.txt for the local OAuth approval page and keeps OAuth state in the same directory.
3. Start MCP and your tunnel
For OpenAI Secure MCP Tunnel:
start-openai-mcp.cmdFor Tailscale Funnel:
start-tailscale-mcp.cmdEach launcher starts the MCP server when needed, then starts only its own tunnel path. The Tailscale launcher exposes MCP as HTTPS 443 -> OAuth gateway 3334 -> MCP 3333.
On a normal cold start, the main visible console windows are:
OpenAI mode: Codex MCP Server + OpenAI MCP Tunnel + OpenAI MCP Tunnel Watchdog.
Tailscale mode: Codex MCP Server + Tailscale OAuth Gateway + Tailscale Funnel + Tailscale MCP Watchdog.
The Tailscale Funnel deliberately runs in the foreground. Keep its window open while using the Tailscale connection; closing it or pressing Ctrl+C stops the Funnel mapping on HTTPS 443. The watchdog monitors the MCP server, OAuth gateway, and Funnel route and can relaunch a missing foreground Funnel window. Components that are already healthy are reused instead of duplicated.
4. Configure ChatGPT
Create a custom MCP app in ChatGPT Developer Mode / Apps and provide the endpoint for the tunnel path you selected. Product availability and exact UI labels can vary by plan and workspace policy; see OpenAI's current Developer Mode / MCP apps documentation.
For OpenAI Secure MCP Tunnel, choose Connection: Tunnel in ChatGPT and select the tunnel or paste the same Tunnel ID used during initialization. Because this MCP server itself has no application-layer authentication, choose No Authentication if the UI asks for MCP authentication.
For Tailscale Funnel, use:
https://<your-machine>.<your-tailnet>.ts.net/mcpUse OAuth discovery. When the approval page opens, enter the local Owner Password from tunnel\tailscale\owner-password.txt.
Tailscale Funnel is public internet ingress. First-time Funnel use can require tailnet permission plus MagicDNS/HTTPS enablement; see Tailscale's Funnel requirements.
The MCP server itself remains bound to 127.0.0.1 in both modes.
Manual installation (Windows, macOS, Linux)
git clone https://github.com/Kerberos255/chatgpt-codex-tools-mcp.git
cd chatgpt-codex-tools-mcp
npm ci
npm run buildCreate your local configuration from the public template:
cp config.example.json config.jsonOn Windows PowerShell:
Copy-Item config.example.json config.jsonEdit config.json, then start:
npm startCore server settings are read from config.json and environment variables. Windows launcher-only settings under runtime, proxy, and environment are applied by scripts/start-mcp.ps1. Environment variables and explicit PowerShell parameters take precedence over matching config.json values. Without a config file, conservative defaults are used.
Connection path
OpenAI path:
ChatGPT -> OpenAI Secure MCP Tunnel -> tunnel\openai\tunnel-client.exe
-> http://127.0.0.1:3333/mcp -> allowed local workspacesTailscale path:
ChatGPT -> Tailscale Funnel HTTPS 443 -> OAuth gateway 127.0.0.1:3334
-> MCP 127.0.0.1:3333 -> allowed local workspacesHealth endpoint:
http://127.0.0.1:3333/healthzThe Streamable HTTP endpoint is stateless: each request gets a fresh transport and the server does not rely on an in-memory Mcp-Session-Id registry. This means older ChatGPT windows can resume after the MCP process restarts instead of getting stranded on an unknown server-side session.
mcp.maxSessions / CTM_MAX_SESSIONS are still accepted for backward-compatible configuration parsing, but the stateless HTTP transport does not use that limit.
Tools
Group | Tool | Actions / purpose |
Meta |
| Show version, access mode, roots, limits, and Web/SQLite feature status. |
Workspace |
| Open a directory under |
Files |
|
|
Git |
| Local |
Edit |
|
|
Exec |
|
|
SQLite |
| Optional allowlisted |
Web |
| Optional |
Capture |
| Windows |
The public MCP surface is intentionally kept to these nine tools. Web and SQLite
actions report a clear disabled error when their feature is off; local_status
shows the current configuration.
Recommended workflow
open_workspace
-> files / git
-> edit(action="preview")
-> review the diff
-> edit(action="confirm", actionId=...)For processes, pass an action, a real executable, and an argv array:
{
"action": "run",
"workspaceId": "...",
"command": "npm",
"args": ["run", "build"]
}Pipes, redirects, command chaining, shell expansion, and shell builtins are not supported.
Access modes
CTM_ACCESS_MODE=review # default
CTM_ACCESS_MODE=fullreviewpermits a small inspection/test process allowlist.fullpermits broader structured executables.Both modes still block direct shells (
cmd, PowerShell,sh,bash) and dangerous process patterns.Specialized read, Git, edit, web, and SQLite tools should be preferred over generic process execution.
Configuration
config.example.json is the public template. config.json is local, generated
or copied by the user, and ignored by Git.
{
"mcp": {
"host": "127.0.0.1",
"port": 3333,
"allowedRoots": ["D:\\Projects"],
"accessMode": "review",
"maxReadBytes": 200000,
"maxOutputBytes": 200000,
"maxSessions": 128
},
"runtime": {
"codexRuntimeRoot": "",
"fallbackNodeBin": "",
"npmCache": ""
},
"proxy": {
"url": "",
"noProxy": "127.0.0.1,localhost,::1",
"nodeUseEnvProxy": false
},
"web": {
"enabled": false,
"searchProvider": "none",
"searxngUrl": "",
"maxBytes": 200000,
"timeoutMs": 15000
},
"sqlite": {
"enabled": false,
"allowedDbs": [],
"maxRows": 100
},
"environment": {}
}Common environment overrides:
Setting | Environment variable | Default |
Host / port |
|
|
Allowed roots |
| current project directory |
Access mode |
|
|
Deny rules override |
| built-in deny list |
Read/output caps |
|
|
MCP session cap |
|
|
Web tools |
| disabled |
Search provider |
|
|
Web limits |
|
|
SQLite tools |
| disabled |
SQLite allowlist |
| empty |
SQLite row cap |
|
|
Config path |
|
|
See env.example for advanced runtime and proxy overrides.
mcp.denyGlobs and CTM_DENY_GLOBS replace the built-in deny list; they do not append to it. If you override them, include every default pattern you still want protected plus your additional rules.
Do not put tunnel runtime keys in config.json. For OpenAI Tunnel, keep
CONTROL_PLANE_API_KEY in the current environment or the Git-ignored local
tunnel\openai\control-plane-api-key.txt file.
Optional web tools
Enable in config.json:
{
"web": {
"enabled": true,
"searchProvider": "searxng",
"searxngUrl": "http://127.0.0.1:8888"
}
}webwithaction="search"queries only the configured SearXNG instance.webwithaction="fetch"accepts public HTTP(S) URLs and blocks localhost, private network targets, embedded credentials, and unsafe redirects.No cookies, browser login state, authorization headers, or client certificates are forwarded.
Optional SQLite tools
Enable SQLite and list exact database paths:
{
"sqlite": {
"enabled": true,
"allowedDbs": ["D:\\Data\\app.sqlite"],
"maxRows": 100
}
}sqlitewithaction="schema"reads schema metadata.sqlitewithaction="select"accepts one read-onlySELECT/WITHor safePRAGMA.Writes use
sqlitewithaction="preview", followed byaction="confirm"with the returnedactionId.Insert, bounded update/delete, expected-field revalidation, and
jsonSetdot paths such asjob_json.enabledare supported.Raw write SQL and subqueries are not exposed.
File edit operations
edit with action="preview" accepts multi-file batches with these operation types:
replace_text replace_range insert_before insert_after
append create overwrite rename deleteThe preview returns an action id and per-file diffs. edit with action="confirm"
rechecks workspace and deny boundaries before applying the batch. File batches are not
transactional, so keep related edits small and review the entire preview.
Screenshot tool
screenshot is available on Windows and returns PNG pixels directly as MCP image content. By default it does not write a file.
mode="window"accepts a case-insensitivewindowTitlesubstring or awindowHandle; it uses WindowsPrintWindow, so it can capture a window even when it is obscured.mode="desktop",monitor, andregioncapture the interactive desktop. Windows may deny screen-surface access while the desktop is locked or switched away; the tool reports that condition instead of returning a blank image.Optional
savePathis workspace-relative, requiresworkspaceId, and still passes the normal workspace and deny-path checks.
Security rules
Keep
HOST=127.0.0.1.Use narrow allowed roots; never use an entire system drive or
/.Keep
reviewmode unless broader process execution is required.Do not expose the endpoint directly to the internet.
Tailscale Funnel is public internet ingress; keep Funnel pointed at the OAuth gateway on
127.0.0.1:3334, never directly at MCP port3333.Keep web and SQLite tools disabled unless needed.
Treat redaction as a final safety net, not the primary boundary.
Review every edit and SQLite preview before confirming.
See SECURITY.md for the full policy.
Development
npm ci
npm run typecheck
npm run build
npm test
npm run checkThe test suite covers configuration precedence, stateless MCP transport behavior, glob matching, secret redaction, optional SQLite loading, repository/version consistency, and CI/CD gates.
CI and releases
Pull requests run CI on Node.js 20 and 24, smoke-test the HTTP server, parse all PowerShell scripts on Windows, and perform a release-package dry run.
Pushing a tag that exactly matches package.json, such as v0.6.0, triggers
the Release workflow. It verifies that the tagged commit belongs to main,
runs the full checks, builds a ZIP containing source plus compiled dist,
generates SHA256SUMS.txt, and creates the GitHub Release.
Troubleshooting
Authentication behavior is unexpected
For OpenAI Secure MCP Tunnel, create or recreate the MCP app with No Authentication. For Tailscale Funnel, an OAuth authorization prompt is expected: use OAuth discovery and enter the Owner Password from tunnel\tailscale\owner-password.txt. Old app settings may retain a previous authentication choice.
Path is outside allowed roots
Add the project parent directory to mcp.allowedRoots or
CTM_ALLOWED_ROOTS, then restart the server.
Process command is blocked
Use specialized tools first. In review mode, only the small process allowlist
is accepted. Shell executables and shell syntax are blocked in every mode.
SQLite tools are unavailable
Enable SQLite, add an exact database path, and use a Node runtime with
node:sqlite support. local_status reports whether SQLite is enabled and
which databases are allowlisted.
dist/server.js is missing
npm ci
npm run buildTunnel runtime is missing
Rerun init-windows.cmd and select the affected tunnel. The initializer reuses
an installed runtime when possible. Otherwise it downloads OpenAI
tunnel-client from the official GitHub Release and verifies its SHA256, or
downloads the current stable Tailscale Windows installer from Tailscale.
Repository boundaries
The repository and Release package do not include:
node_moduleslocal
config.jsonthe local
tunnel/directory (binaries, profiles, OAuth state, and runtime keys)generated
start-openai-mcp.cmd/start-tailscale-mcp.cmdlauncherslogs or workspace data
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Browse and manage files in your Moxt AI workspace from any MCP client.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceLets ChatGPT or MCP clients work with files on your machine, with tools for reading, editing, searching, git operations, and safety checks.MIT
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to securely operate a single Windows development workspace via a local MCP server, offering file editing, Git status, static analysis, approved test/build, and limited ADB operations with audit logging.MIT
- AlicenseAqualityBmaintenanceConnects ChatGPT to a local developer workspace through MCP, enabling bounded repository analysis, file and image inspection, direct edits, command verification, and Git-aware review.22MIT
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to read and edit local project files, inspect Git changes, and run approved development scripts through a secure MCP tunnel, with optional Codex Desktop integration.177 npm1Apache 2.0