Skip to main content
Glama
codex-appserver-mcp

codex-appserver-mcp

by azjhf-dev

codex-appserver-mcp

A small MCP stdio server that lets an MCP client (for example the Antigravity app) hand tasks to Codex through codex app-server. Zero dependencies, Node 20+.

Status: prototype. Tested only against a mock app-server written from the public docs, not against a real codex CLI or a real Antigravity. The mock mirrors https://learn.chatgpt.com/docs/app-server; field names for approval replies ({decision}) and thread/start options are from that doc and unverified against a real binary.

codex mcp-server was removed in Codex (deprecated 2026-08-24, removed 2026-09-05), so this talks to codex app-server instead (JSON-RPC 2.0, one JSON message per line).

What it does

One MCP tool, codex_run:

arg

meaning

prompt

task for Codex (required)

threadId

continue an earlier thread (returned in each result)

cwd, model, effort

passed through

sandbox

new threads only: read-only (default), workspace-write, danger-full-access

Flow: initialize (experimental API on) then thread/start or thread/resume, turn/start, then it collects item/agentMessage/delta, item/completed and turn/completed, and returns the final answer, thread id, commands run, changed files. MCP progress notifications are sent if the client supplies a progress token. A turn that gets no result in 10 minutes is interrupted.

Related MCP server: codex-app-mcp

Safety defaults

  • Sandbox read-only, approval policy on-request.

  • Command and file-change approval requests from Codex are declined, and the result says how many. Set CODEX_MCP_AUTO_APPROVE=1 to accept them (only with a sandbox you trust).

  • Codex uses its own login (codex login) or API key. This server never reads or stores credentials. Using a ChatGPT subscription login this way is the same as using the CLI yourself; check OpenAI's current terms if you share it.

Dynamic tools (Codex calls back into your machine)

Set CODEX_MCP_DYNAMIC_TOOLS to a JSON array. Each entry is registered on new threads as a Codex dynamic tool; when Codex calls it, this server runs command with the JSON arguments on stdin and returns stdout.

[{"name":"lookup_ticket","description":"Fetch a ticket","inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"command":["python3","/path/lookup.py"]}]

This is command-backed only. It does not forward calls to the MCP client's own tools (MCP has no way for a server to call a client's tools).

Install and use

git clone https://github.com/azjhf-dev/codex-appserver-mcp && cd codex-appserver-mcp
npm test

MCP config (Antigravity: Customizations > MCP Servers; or any MCP client):

{ "mcpServers": { "codex": { "command": "node", "args": ["/abs/path/codex-appserver-mcp/src/server.mjs"] } } }

Env: CODEX_BIN (default codex), CODEX_MCP_COMMAND (full argv, default codex app-server), CODEX_MCP_MODEL, CODEX_MCP_SANDBOX, CODEX_MCP_APPROVAL, CODEX_MCP_CWD, CODEX_MCP_AUTO_APPROVE, CODEX_MCP_DYNAMIC_TOOLS.

Known gaps

  • Not run against real Codex. First thing to do: run it against codex app-server and check thread/start accepts the params.

  • One tool, no thread listing or interrupt tool yet (the bridge has interrupt).

  • Stdio only, no remote or WebSocket app-server.

  • Notifications are matched by threadId; if the real server omits it on some events they are dropped unless only one run is active.

MIT.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients and external AI supervisors to oversee and steer native Codex sessions through a thin local stdio bridge. It exposes eleven codex_* supervisory tools for tasks such as listing threads, starting turns, observing progress, steering, responding to approvals, interrupting, checkpointing, and rolling over work.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A local stdio MCP server that lets any MCP client start a Codex thread and continue it by opaque thread ID through the codex and codex-reply tools, with fail-closed sandboxing and approval policies. It restores the removed Codex CLI MCP integration by bridging clients like OpenCode to the official Codex SDK.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Bridges MCP clients such as Claude Code and Cursor to independent Codex app-server sessions, letting them start, poll, steer, review, compact, cancel, and answer prompts for asynchronous Codex tasks over local stdio or a remote authenticated WebSocket. Runs read-only by default, with workspace-write sandboxing only when a user explicitly enables it, and reports job status, model listing, and progress back to the client.
      10
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude Code or any MCP client to delegate hands-on coding work to OpenAI Codex over a persistent app-server process, keeping long-lived threads with follow-ups, async polling, approvals, steering, and interrupts. Supports native code review, resuming existing sessions, structured output, and parallel worktree-isolated tasks.
      10
      24 npm
      1
      MIT