Codex Free
An MCP server that bridges ChatGPT Web Pro to local tools, enabling file read/write, shell command execution, git operations, and search within a specified project directory.
README
Codex Free
Codex Free (but you still have to buy ChatGPT Plus)
A local MCP bridge server that lets ChatGPT Web Pro call tools on your machine: read/write files, run shell commands, git operations, search. Built with Bun + TypeScript, using @modelcontextprotocol/sdk over Streamable HTTP.
ChatGPT talks to a public tunnel URL, which forwards to this server running on your machine, which operates on a project directory you choose.
Architecture
flowchart LR
ChatGPT["ChatGPT Web Pro"]
Tunnel["Public Tunnel\n(ngrok / cloudflared)"]
Server["Codex Free\nMCP Bridge\n:3000"]
Tools["Tool Registry"]
FS["read_file\nwrite_file\nlist_directory\ntree"]
Search["glob\ngrep"]
Shell["run_command"]
Git["git_status\ngit_push\ngit_commit\ngit_log"]
WorkDir[("Project\nDirectory")]
ChatGPT -- "HTTPS" --> Tunnel
Tunnel -- "HTTP\n/mcp" --> Server
Server -- "Streamable HTTP\n(MCP Protocol)" --> Tools
Tools --> FS
Tools --> Search
Tools --> Shell
Tools --> Git
FS --> WorkDir
Search --> WorkDir
Shell --> WorkDir
Git --> WorkDir
Quick start
bun install
bun run main.ts --work-dir /path/to/your/project
Server starts on http://localhost:3000. MCP endpoint is /mcp.
CLI flags
| Flag | Required | Default | Description |
|---|---|---|---|
--work-dir |
Yes | - | Project directory the tools operate on |
--port |
No | 3000 |
Server port |
--api-key |
No | - | Bearer token for auth |
--config |
No | ./codex.config.json |
Config file path |
Tools
| Tool | Description |
|---|---|
read_file |
Read a file's contents, with optional line offset/limit |
write_file |
Write content to a file, creating parent directories if needed |
run_command |
Execute a command in the work directory (allowlist-restricted) |
git_status |
Show git status, parsed into changed files with status codes |
git_push |
Push commits to a remote |
git_commit |
Create a commit, optionally staging all tracked changes |
git_log |
Show recent commit history |
glob |
Find files matching a glob pattern |
grep |
Search file contents by regex, with optional context lines |
list_directory |
List files and directories with name, type, and size |
tree |
Print directory tree as ASCII art |
All paths are resolved relative to --work-dir.
Config file
codex.config.json in the project root, or pass a custom path with --config:
{
"allowedCommands": ["bun", "npm", "npx", "node", "git", "python", "pip", "cargo", "make"],
"port": 3000,
"tree": {
"defaultDepth": 3,
"ignore": ["node_modules", ".git", "dist", ".next", "__pycache__", ".venv", "venv"]
},
"command": {
"defaultTimeout": 30000,
"maxTimeout": 120000
}
}
CLI flags override values from the config file.
Connecting to ChatGPT
- Start the server:
bun run main.ts --work-dir /path/to/your/project - Expose it with a tunnel (ngrok, Cloudflare Tunnel, etc.):
ngrok http 3000 - In ChatGPT, go to Plugins > + New Plugin.
- Set the Server URL to the tunnel URL with
/mcpappended, e.g.https://<your-tunnel>/mcp. - Set Authentication to "No Auth".
- After creating the plugin, go to Permissions and set it to Allow all actions so ChatGPT can call tools without asking for confirmation each time.
ChatGPT Plugins only support OAuth, No Auth, and Mixed. The
--api-keyoption is for non-ChatGPT clients or tunnel-level auth. When using ChatGPT, secure access through your tunnel provider instead (e.g. ngrok IP restrictions, Cloudflare Access).
Security
- Path traversal prevention: every filesystem tool resolves paths through a guard that rejects anything outside
--work-dir. - Command allowlist:
run_commandonly runs binaries listed inallowedCommands; everything else is rejected. - Optional bearer token auth: set
--api-keyto require anAuthorization: Bearer <key>header on all requests (except/health). Useful for non-ChatGPT clients. ChatGPT Plugins do not support simple bearer token auth.
This server has no sandboxing beyond the above. Anyone with access to the tunnel URL can read, write, and execute commands in your work directory. Don't expose it without tunnel-level access control, and don't point it at directories you don't trust ChatGPT with.
Dev commands
bun run dev # watch mode
bun test # tests
bunx tsc --noEmit # type check
License
MIT - see LICENSE.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。