Skip to main content
Glama

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=True

  • prompt passed via stdin

  • timeout handling

  • working-directory validation and allowlist support

  • JSON-serializable structured output

Related MCP server: chatgpt-web-agent

Installation

python -m venv .venv
source .venv/bin/activate
pip install -e .

For tests:

pip install -e .[dev]
pytest

Configuration

2Bot is environment-driven.

Variable

Default

Description

TWOBOT_TRANSPORT

stdio

stdio or http

TWOBOT_HOST

127.0.0.1

HTTP bind host

TWOBOT_PORT

9000

HTTP bind port

TWOBOT_BASE_URL

unset

Optional public HTTPS URL for docs/ops

TWOBOT_LOG_LEVEL

INFO

Logging level

TWOBOT_ENABLE_NO_AUTH

true

Enable no-auth mode for initial ChatGPT testing

CODEX_ALLOWED_ROOTS

unset

Optional cwd allowlist (:-separated on macOS/Linux)

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.server

You can also force stdio:

TWOBOT_TRANSPORT=stdio 2bot-mcp

Remote mode (HTTP / Streamable HTTP)

Run HTTP mode locally on loopback:

TWOBOT_TRANSPORT=http TWOBOT_HOST=127.0.0.1 TWOBOT_PORT=9000 2bot-mcp

Or with explicit CLI flags:

2bot-mcp --transport http --host 127.0.0.1 --port 9000

Expose via HTTPS for ChatGPT

ChatGPT must reach a public HTTPS URL. Typical setup:

  1. Run 2Bot in HTTP mode on 127.0.0.1:9000.

  2. Put a reverse proxy or tunnel in front (Nginx, Caddy, Cloudflare Tunnel, etc.).

  3. Publish a TLS endpoint like https://mcp.example.com forwarding to http://127.0.0.1:9000.

  4. 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:

  1. Start 2Bot in HTTP mode.

  2. Expose the endpoint at a public HTTPS URL.

  3. 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_ROOTS to minimal directories.

  • Keep conservative defaults (sandbox=read-only, allow_edits=false).

  • Avoid danger-full-access unless 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-mcp

2) Reverse proxy / tunnel

  • Proxy https://mcp.example.com -> http://127.0.0.1:9000

  • Keep TLS at the edge

  • Keep 2Bot private behind the proxy where possible

3) Keep stdio mode for local MCP clients

TWOBOT_TRANSPORT=stdio 2bot-mcp

Tool reference: run_codex_prompt

Parameters:

  • prompt: str

  • cwd: str | None = None

  • model: str | None = None

  • profile: str | None = None

  • sandbox: "read-only" | "workspace-write" | "danger-full-access" = "read-only"

  • approval_policy: "untrusted" | "on-request" | "never" | None = None

  • allow_edits: bool = False

  • skip_git_repo_check: bool = False

  • add_dirs: list[str] | None = None

  • timeout_sec: int = 1800

  • ephemeral: bool = True

  • include_event_log: bool = False

Behavior is preserved from local mode while adding transport/config flexibility.

Available Tools

1 tool
run_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNo
modelNo
promptYes
profileNo
sandboxNoread-only
add_dirsNo
ephemeralNo
allow_editsNo
timeout_secNo
approval_policyNo
include_event_logNo
skip_git_repo_checkNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses two key behaviors: non-interactive mode and sending the prompt over stdin. However, it does not mention side effects, required permissions, error behavior, or the significance of sandbox/approval parameters. This is partial disclosure but not comprehensive for a potentially mutating tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, with each sentence adding distinct value: first purpose, then a critical behavioral detail. It is front-loaded and contains no fluff or repetition of structured data.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the tool is complex (12 parameters, many affecting safety and policy). The description omits any explanation of parameter semantics, usage context, or behavioral limitations. For an agent to invoke this tool correctly, it would need additional knowledge about sandbox modes, approval policies, and other settings that the description does not provide.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 12 parameters with 0% description coverage, and the tool description does not explain any of them. While 'prompt' is implicitly referenced via 'sends the prompt over stdin', no parameter semantics are clarified. The description fails to compensate for the schema's lack of descriptions, leaving the agent to guess the meaning of cwd, model, sandbox, approval_policy, etc.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Run a prompt via local Codex CLI (`codex exec`) and return structured automation output.' It specifies the verb, resource, and expected output. Since there are no sibling tools, differentiation is not needed, and the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit when-to-use guidance or mention alternatives (no siblings exist). The line '2Bot always uses non-interactive mode and sends the prompt over stdin' gives context about invocation but not about when to select this tool over others. Usage is implied by the purpose, but there is no clear context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev0.1.0
    • First observedrun_codex_prompt

TDQS

B3.4/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness3/5

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

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/charlesmichaelbaird/2bot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server