CodeHands
An MCP server that gives web AI assistants like ChatGPT and Claude Chat hands-on control over a local development machine, enabling them to read, edit, and execute code through a safe, policy-checked interface.
README
CodeHands (MCP Coding Harness)
The Problem
Web AI assistants like ChatGPT and Claude Chat are incredibly smart — they can reason about code, plan fixes, and write solutions. But they're trapped behind a browser. They can't reach into your computer to actually read your files, edit your code, or run your tests. The brain is there, but it has no hands.
Meanwhile, tools like Cursor and Codex CLI work great locally — but only from one specific app on one specific machine. You can't use them from your phone, from a different browser, or from ChatGPT's interface.
The Vision
Code from anywhere. Open ChatGPT or Claude Chat on your phone, your tablet,
any browser, any device — type "fix the null check in src/app.ts line 42" —
and it happens on your development machine. The AI thinks, your machine
executes.
What This Is
A thin MCP server that gives web AI assistants (ChatGPT, Claude Chat) step-by-step control over your local development machine.
The web AI is the brain. This server is just the hands.
This server does not think. It does not make coding decisions. It does not run an agent loop. It only routes commands and enforces safety rules.
The Three Layers
┌─────────────────────────────────────────────────────────┐
│ BRAIN: Web AI (ChatGPT / Claude Chat) │
│ Decides what to read, edit, and run. Controls step │
│ by step. IS the agent loop. │
└────────────────────────┬────────────────────────────────┘
│ MCP tool calls
▼
┌─────────────────────────────────────────────────────────┐
│ ROUTER: CodeHands (this MCP server, TypeScript) │
│ Receives each tool call. Checks policy (is this │
│ workspace approved?). Forwards to exec-server. │
│ Returns results. Logs activity. │
│ Never makes coding decisions. │
└────────────────────────┬────────────────────────────────┘
│ JSON-RPC
▼
┌─────────────────────────────────────────────────────────┐
│ EXECUTOR: Codex exec-server (lean Rust process) │
│ Actually reads/writes files, runs terminal commands, │
│ manages sandboxing and safety. All the hard low-level │
│ work. Already built, open-source, battle-tested. │
└─────────────────────────────────────────────────────────┘
The web AI says "read this file" → this server checks policy → Codex reads the file → result flows back to the web AI. Every operation follows this path.
Why Codex CLI (The Hard Reality)
To make this vision work, the server needs to actually do things on your machine: read files safely, write files safely, run terminal commands in a sandbox, manage Git, validate paths. Building all of that from scratch is a massive amount of work — sandboxing alone is months of effort.
OpenAI already solved this problem. Their Codex CLI is open-source (Apache 2.0), lightweight, Rust-based, ranked #1 on Terminal-Bench. It handles file I/O, terminal execution, sandboxing, Git, and safety — all battle-tested.
So instead of rebuilding the wheel, we use their wheel. We clone Codex CLI into our project and talk to it through its public interface. Our code never goes inside it. We never touch Codex's code. Ever.
The Codex Boundary (Critical Rule)
vendor/codex/ is a clone of the OpenAI Codex repository. It is never
modified. No harness code goes inside it. No patches, no edits, no exceptions.
All our code lives OUTSIDE that folder. The entire harness is built around Codex, not inside it.
Why this matters: OpenAI actively updates Codex CLI on GitHub. When they release improvements — better sandboxing, new features, performance fixes — we want those updates instantly. Because we never touched their code, upgrading is one command:
git submodule update --remote vendor/codex
No merge conflicts. No broken patches. No "our edit conflicts with their edit." The folder just gets replaced with the latest version and everything keeps working because our code only talks to Codex through its public interface, never by reaching into its internals.
Access Modes
| Mode | How | Latency | Use case |
|---|---|---|---|
| Local (HTTP) | CodeHands runs on localhost, clients connect via HTTP | ~1-3ms | Same machine, multiple chats |
| Local (stdio) | Client spawns CodeHands as subprocess (adapter) | ~0.1ms | Single client (Claude Desktop) |
| Hosted (tunnel) | Any tunnel exposes CodeHands' HTTP port publicly | ~50-200ms | Control from anywhere — phone, browser, any device |
The HTTP server is the core. The stdio adapter wraps it for clients that only support stdio. Design is tunnel-agnostic. Server listens on a port; you pick the tunnel. Default recommendation: Tailscale with Funnel (free, private, no domain).
Target Providers
Both ChatGPT and Claude Chat are primary targets.
Tech Decisions
- Language: TypeScript (MCP SDK is TS-first, fast iteration)
- Communication: Codex exec-server via JSON-RPC (granular operations)
- Transport: HTTP core + stdio adapter (Option C). HTTP handles multi-client and hosted mode. Thin stdio adapter supports clients like Claude Desktop.
- MCP tools: 16 tools mirroring exec-server ops (underscore naming for MCP
compatibility:
fs_readFile,process_start, etc.) +workspace_list,workspace_set. - UI: None. JSON config file for workspace management.
- Config location:
~/.codehands/config.json - Multi-workspace: One shared exec-server. CodeHands validates paths against approved workspaces before forwarding.
- Concurrency: One CodeHands instance serves multiple AI chats on multiple projects simultaneously.
- Tunnel: Tunnel-agnostic. Recommend Tailscale Funnel for hosted mode.
- Security: Blocked commands list + workspace validation + exec-server sandbox
- Error recovery: Auto-restart exec-server up to 3 times, notify connected AIs.
- API key: None. Exec-server is purely local — no cloud calls.
- Distribution: GitHub clone +
npm link. Globalcodehandscommand. Updates viagit pull. - Name: CodeHands
Setup Guide
Prerequisites
- Node.js 22+ installed
- Git installed
- pnpm installed (
npm install -g pnpm)
Installation (one-time)
git clone https://github.com/YOUR_USERNAME/codehands.git
cd codehands
npm install -g @openai/codex
pnpm install
pnpm run build
cd apps/local-agent && npm link && cd ../..
codehands init
After this, codehands is available as a global command from anywhere.
Edit ~/.codehands/config.json to add your project paths.
Running (every time)
codehands start
That's it. CodeHands starts the HTTP server and spawns the exec-server automatically. AI clients can connect immediately.
First-time config
On first run, CodeHands creates ~/.codehands/config.json if it doesn't
exist. Open it in your editor and add your project folders:
{
"workspaces": [
"C:/Users/you/projects/my-app",
"C:/Users/you/projects/another-project"
],
"blockedCommands": [
"rm -rf /",
"format C:"
]
}
Updating
cd codehands
git pull
pnpm install
The codehands command automatically points to the updated code (npm link
is a symlink).
Updating Codex (when OpenAI releases improvements)
cd codehands
git submodule update --remote vendor/codex
Current Status
Working. All 16 MCP tools implemented and tested end-to-end.
codehands start → Starts server + exec-server on port 3100
codehands stdio → stdio mode for Claude Desktop
codehands init → Creates default config
See docs/client-setup.md for connecting ChatGPT or Claude.
Key Design Rules
- The web AI controls everything step by step. This server never runs an autonomous agent loop.
- Codex is used as-is. Never modify its source. Upgrade by moving the submodule pointer.
- All operations go through Codex. Don't rebuild what Codex already does.
- MCP tools are granular. Read file, edit file, run command — not "fix my app."
- Provider-neutral. Tool schemas work identically for ChatGPT and Claude.
- Lightweight. Minimal RAM usage, lean process. No bloat.
- No UI. This is a headless server. Users already have editors. No dashboards, no electron apps, no windows.
- Low latency. Responses must be near-instant. This is why local-first matters.
- Simple UX. Easy to set up, easy to use. Avoid complexity wherever possible.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。