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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.