2Bot
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., "@2Bot Create a new Python script that prints 'Hello, World!'"
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.
2Bot
2Bot is a FastMCP server that lets ChatGPT (or any MCP client) call your local Codex CLI through a controlled MCP tool.
MCP server name is fixed to
2Bot.Local mode uses stdio.
Remote mode uses HTTP (Streamable HTTP) for ChatGPT-compatible deployments.
What 2Bot does
2Bot exposes a single typed tool, run_codex_prompt, which runs codex exec --json - safely:
no
shell=Trueprompt passed via stdin
timeout handling
working-directory validation and allowlist support
JSON-serializable structured output
Related MCP server: ChatGPT Codex Bridge
Installation
python -m venv .venv
source .venv/bin/activate
pip install -e .For tests:
pip install -e .[dev]
pytestConfiguration
2Bot is environment-driven.
Variable | Default | Description |
|
|
|
|
| HTTP bind host |
|
| HTTP bind port |
| unset | Optional public HTTPS URL for docs/ops |
|
| Logging level |
|
| Enable no-auth mode for initial ChatGPT testing |
| unset | Optional cwd allowlist ( |
Authentication note: for first connection tests, use no auth. For production, prefer standards-based MCP-compatible auth in front of or integrated with this service.
Local mode (stdio)
Run with stdio (default):
2bot-mcp
# or
python -m twobot_codex_mcp.serverYou can also force stdio:
TWOBOT_TRANSPORT=stdio 2bot-mcpRemote mode (HTTP / Streamable HTTP)
Run HTTP mode locally on loopback:
TWOBOT_TRANSPORT=http TWOBOT_HOST=127.0.0.1 TWOBOT_PORT=9000 2bot-mcpOr with explicit CLI flags:
2bot-mcp --transport http --host 127.0.0.1 --port 9000Expose via HTTPS for ChatGPT
ChatGPT must reach a public HTTPS URL. Typical setup:
Run 2Bot in HTTP mode on
127.0.0.1:9000.Put a reverse proxy or tunnel in front (Nginx, Caddy, Cloudflare Tunnel, etc.).
Publish a TLS endpoint like
https://mcp.example.comforwarding tohttp://127.0.0.1:9000.Configure ChatGPT custom MCP connection to that public URL.
ChatGPT connection notes
ChatGPT connects to the remote HTTPS MCP endpoint, not to stdio.
High-level flow:
Start 2Bot in HTTP mode.
Expose the endpoint at a public HTTPS URL.
Create/connect the custom MCP app in ChatGPT pointing at that URL.
Use URL pattern:
https://<your-public-hostname>/(or the exact path your reverse proxy maps to the FastMCP HTTP app)
Security notes (important)
Exposing a tool that can execute local Codex workflows is sensitive.
Recommendations:
Restrict
CODEX_ALLOWED_ROOTSto minimal directories.Keep conservative defaults (
sandbox=read-only,allow_edits=false).Avoid
danger-full-accessunless absolutely necessary and trusted.Prefer private deployments (VPN, private network, authenticated gateway).
Do not expose an unrestricted instance on the public internet casually.
Example deployment notes
1) Local-only HTTP bind
TWOBOT_TRANSPORT=http TWOBOT_HOST=127.0.0.1 TWOBOT_PORT=9000 2bot-mcp2) Reverse proxy / tunnel
Proxy
https://mcp.example.com->http://127.0.0.1:9000Keep TLS at the edge
Keep 2Bot private behind the proxy where possible
3) Keep stdio mode for local MCP clients
TWOBOT_TRANSPORT=stdio 2bot-mcpTool reference: run_codex_prompt
Parameters:
prompt: strcwd: str | None = Nonemodel: str | None = Noneprofile: str | None = Nonesandbox: "read-only" | "workspace-write" | "danger-full-access" = "read-only"approval_policy: "untrusted" | "on-request" | "never" | None = Noneallow_edits: bool = Falseskip_git_repo_check: bool = Falseadd_dirs: list[str] | None = Nonetimeout_sec: int = 1800ephemeral: bool = Trueinclude_event_log: bool = False
Behavior is preserved from local mode while adding transport/config flexibility.
Available Tools
1 toolrun_codex_promptB
Run a prompt via local Codex CLI (codex exec) and return structured automation output.
2Bot always uses non-interactive mode and sends the prompt over stdin.
Inputs: prompt (required), cwd, model, profile, +8 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is zero ambiguity—no other tools exist to confuse with run_codex_prompt. The tool's purpose is distinct by default.
The single tool name 'run_codex_prompt' follows a clean verb_noun pattern, making it clear and predictable. With only one tool, consistency is inherently maintained.
A single tool is extremely thin for an MCP server, even for a narrow purpose. While it might serve a specific need, it feels like a minimal wrapper rather than a coherent tool set, earning a low score.
The tool covers the basic action of running a codex prompt, but the surface is incomplete—no ability to list past runs, check status, cancel, or configure the CLI. For the implied domain, notable operations are missing.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLocal MCP bridge enabling ChatGPT web to access approved local files and execute tasks via local Codex.16MIT
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to securely inspect local Codex projects, read session history, and dispatch confirmed tasks to the Codex CLI through a local MCP bridge.1Apache 2.0
- 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.8Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT web to read local files, search code, run shell commands, and drive a local Codex CLI via an official MCP connector, with human approval for risky commands and full audit logging.1MIT