codex-app-mcp
Production-oriented MCP gateway for managing Codex through a persistent codex app-server process, supporting threads, autonomous goals, approvals, and HTTP/stdio transports.
README
codex-app-mcp
Version 0.4.0 — Governed MCP gateway for OpenAI Codex app-server.
This package turns a single long-lived codex app-server process into an MCP
server that other agents and IDEs can call. Codex remains the backend;
codex-app-mcp is the policy-aware gateway (stdio or bearer HTTP), not a
replacement for the CLI or for ChatGPT.
Security one-liner: no OAuth tokens or API keys belong in this repo. Model auth is the local Codex CLI session from
codex login(CODEX_HOME). HTTP bearer is an operator-generated local secret only.
Install guides
| Language | Guide |
|---|---|
| English | docs/install/en.md |
| Русский | docs/install/ru.md |
| 简体中文 | docs/install/zh-CN.md |
| Español | docs/install/es.md |
Also: REFERENCE · VERIFICATION · SECURITY · CONTRIBUTING · MIGRATION
Capabilities
- Threads, turns, steering, interrupt, fork, archive, and rollback
- Autonomous persisted goals with model, reasoning effort, and token budget
- Native review, command sessions, filesystem v2, and unsandboxed
process/* - Approvals, user input, dynamic tools, and server-initiated requests
- Durable SQLite jobs, worktree lanes, and timezone-aware RRULE schedules
- Typed access to methods in the configured experimental app-server schema
- Downstream MCP/SaaS calls with server and tool allowlists
- Stdio MCP and bearer-protected HTTP (no unsupported WebSocket surface)
- Exact-schema introspection, secret-safe audit, metrics, retry, and recovery
There are 20 MCP tools (including codex_app_status, codex_app_thread,
codex_app_goal, codex_app_lane, codex_app_job, and more). See
docs/REFERENCE.md.
Prerequisites
- Python 3.10+
- Codex CLI installed (
codexonPATH, orCODEX_APP_MCP_BIN) - Local auth:
codex login(session underCODEX_HOME)
Quick install
cd <path-to-repository>
python -m pip install -e ".[test]"
Project paths fail closed until roots are configured:
export CODEX_APP_MCP_ALLOWED_ROOTS="/path/to/allowed/project"
Quick run
Stdio (default — what most desktop MCP hosts spawn):
codex-app-mcp
# or:
python -m codex_app_mcp
HTTP (operator secret, loopback bind):
export CODEX_APP_MCP_HTTP_TOKEN="$(openssl rand -hex 32)"
codex-app-mcp --transport http --host 127.0.0.1 --port 8765
Prefer CODEX_APP_MCP_HTTP_TOKEN_FILE for services. The token env var and
token file are mutually exclusive. Never put OpenAI/Codex OAuth into these
settings.
Client matrix
| Client | Typical mode | Notes |
|---|---|---|
| Claude Desktop | stdio | Config JSON with command / env — example |
| Claude Code | stdio | Project/user .mcp.json — example |
| Cursor | stdio (or HTTP URL if supported) | example |
| VS Code / Continue | stdio | Register the same command in MCP / Continue settings |
| Remote agents | HTTP + TLS | Reverse proxy or tunnel; bearer required; not native ChatGPT web stdio |
ChatGPT web does not natively host local stdio MCP. Remote connectors, if any, need a HTTPS endpoint you control—never put OpenAI credentials into the HTTP bearer config. Full details: docs/install/en.md.
First verification
python -m pytest -q
python scripts/probe_stdio.py
python scripts/probe_http.py
In a connected MCP host, call codex_app_status. Optional deeper checks:
scripts/check_protocol.py, scripts/audit_protocol.py,
scripts/probe_full.py.
Architecture (short)
MCP client / agent host
│ stdio or bearer HTTP
▼
codex-app-mcp (policy, jobs, lanes, audit)
│ JSON-RPC over child stdio
▼
codex app-server (threads, turns, goals, tools)
│
▼
local CODEX_HOME session from `codex login`
Security
- No API keys or OAuth material in the repository or public examples
- Auth to Codex: local CLI session only
- HTTP: operator-generated bearer via
CODEX_APP_MCP_HTTP_TOKENorCODEX_APP_MCP_HTTP_TOKEN_FILE(never commit) - Project roots fail closed; full access and unsafe RPC are separate opt-ins
- Audit omits prompts, tokens, and credentials
Details and reporting: SECURITY.md.
Repository layout
codex_app_mcp/ runtime package
docs/ reference, verification, install (i18n)
examples/ placeholder MCP client configs
scripts/ protocol and transport probes
tests/ automated test suite
pyproject.toml package metadata (version 0.4.0)
Contributing
See CONTRIBUTING.md for tests, probes, and PR process.
License
See the repository license file if present; otherwise follow the terms of the project host.
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.