codex-app-mcp

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.

Category
访问服务器

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 (codex on PATH, or CODEX_APP_MCP_BIN)
  • Local auth: codex login (session under CODEX_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_TOKEN or CODEX_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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选