codex-worker-runtime

codex-worker-runtime

Enables Codex to delegate bounded work to external LLMs through role-based MCP tools, with worker health checks and audit logging.

Category
Visit Server

README

Codex Worker Runtime

Role-based external LLM delegation for Codex.

Codex stays the orchestrator and delegates bounded work through four MCP tools:

  • delegate_work
  • list_workers
  • worker_health
  • get_worker_run

Current routes

Role Worker Adapter
code_review qwen OpenAI-compatible API
x_research grok guarded Grok CLI
planning kimi opencodex Responses API
research kimi opencodex Responses API

Kimi is reached only through the worker runtime. The main Codex provider, history, CLI shim, account pool, and native subagent catalog do not need to be changed.

Guarantees

  • External workers cannot edit local files or execute Codex commands.
  • secret and credential requests are rejected before dispatch.
  • Worker results are normalized into a stable transport and semantic contract.
  • completed + rejected is preserved and is never overwritten by another provider.
  • Unavailable or timed-out workers return control to Codex according to policy.
  • Requests, attempts, and results are stored in a local SQLite audit ledger.
  • Prepared requests and raw provider responses stay out of the normal result.

Configuration

The runtime loads the first available policy:

  1. CODEX_WORKER_CONFIG
  2. ~/.codex/codex-worker-runtime/workers.toml
  3. bundled config/workers.toml

Relative worker commands are resolved from the policy file. ~/ paths expand to the current user home directory.

The bundled policy expects:

  • an OpenAI-compatible Qwen endpoint at http://127.0.0.1:8081
  • Grok Build installed at ~/.grok/bin/grok
  • Grok privacy settings that pass runtime/grok/grok_privacy_guard.py
  • opencodex listening on 127.0.0.1:10100 with the kimi provider authenticated

Start only the local proxy server used by the Kimi worker, without Codex model injection, history synchronization, a CLI shim, or a background service:

npm run start:kimi-proxy

To keep a custom policy outside the plugin, copy the file, update any relative worker commands for its new location, and set CODEX_WORKER_CONFIG to its absolute path.

Development

npm install
npm run check
npm run test:all

Local personal-plugin install

The installer creates named backups, stages the plugin, verifies source/target/cache hashes, and checks plugin activation.

node scripts/install-personal.mjs --dry-run
node scripts/install-personal.mjs

Optional environment variables:

  • CODEX_WORKER_CODEX_ROOT
  • CODEX_WORKER_CODEX_CLI
  • CODEX_WORKER_INSTALL_TARGET
  • CODEX_WORKER_MARKETPLACE
  • CODEX_WORKER_AUDIT

Coexistence with opencodex

opencodex and Codex Worker Runtime can coexist because they operate at different layers:

  • opencodex proxies the main Codex Responses API transport.
  • Codex Worker Runtime delegates selected roles through MCP.

Recommended policy:

  • keep the main Codex provider explicit
  • avoid routing the same job to both a native routed subagent and an MCP worker
  • review ~/.codex/config.toml after running ocx init or installing its shim
  • let only one installer manage the Codex provider configuration and CLI shim
  • keep credentials in each provider's own configuration; do not copy them into workers.toml

The runtime uses stdio MCP and does not bind opencodex's default port 10100. Its bundled Qwen example uses port 8081.

Adding a worker

  1. Add the worker and role to config/workers.toml.
  2. Reuse an existing adapter or add a dedicated adapter.
  3. Normalize the response into the common result contract.
  4. Add health, timeout, failure, audit, and redaction tests.

License

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured