qoder
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Qoder in Codex
Run Qoder CLI agents as delegated subagents from ChatGPT/Codex through the Model Context Protocol (MCP).
The Codex parent agent keeps control of the conversation. It delegates a self-contained task with qoder_spawn, polls with qoder_wait, and verifies the resulting workspace changes itself. Qoder is not merely selected as a chat model: its full CLI agent loop can inspect and edit files in the allowed workspace.
This is an independent project, not an official OpenAI or Qoder integration. Qoder tasks do not appear in Codex's native
/subagentslist.
Features
Two fixed routing tiers
fast→DeepSeek-Flashfor simple, mechanical, low-complexity tasks.pro→Kimi-K3.1-Profor everything else or when complexity is uncertain.
Real workspace delegation through Qoder CLI, with no tools disabled by the bridge.
Asynchronous lifecycle:
queued,running,completed,failed, andcancelled.Dynamic Codex workspaces: newly trusted Codex projects are picked up on every spawn without restarting the bridge.
Windows and Linux stdio MCP configurations.
Concurrency control: at most two tasks overall and one active task per tier; same-tier tasks queue.
Model auditing: returns raw
modelUsageandactual_models; ambiguous audits andautofallback fail the task.Safer defaults:
accept_edits, no permission-bypass flag, path validation, bounded output, redacted diagnostics, and private prompt attachments that are always cleaned up.No automatic task retries and no persistent Qoder sessions created by the bridge.
Related MCP server: AI CLI MCP Server
How it works
Codex parent agent
└─ qoder MCP stdio server
└─ task manager and concurrency queue
└─ Qoder CLI agent (fast or pro)
└─ shared, validated workspace
Codex parent then inspects and accepts the actual changes.Qoder does not inherit the parent conversation. Every delegated task must therefore include the relevant context, requirements, and acceptance criteria.
Requirements
Node.js 18 or newer; Node.js 24 is recommended.
A Codex version that supports stdio MCP servers and
default_tools_approval_mode.Qoder CLI CN (
qoderclicn) with access to these models:DeepSeek-FlashKimi-K3.1-Pro
A Qoder login or a Qoder CN personal access token (PAT).
The bridge has been exercised with Qoder CLI CN 1.1.74, Codex 0.153.4 on Linux, and Codex 0.166.0 on Windows.
Installation
git clone https://github.com/duyaOmega/qoder-in-codex.git
cd qoder-in-codex
npm ci
npm testKeep the checkout at a stable absolute path. The Codex MCP configuration will start src/index.js from that directory.
Authentication
Use one of the following methods.
Option A: Qoder CLI login
Authenticate the standalone CLI according to its normal login flow:
qoderclicn login
qoderclicn --list-modelsConfirm that both required models appear. If the CLI is already authenticated, no PAT-file setting is needed.
Option B: Reuse a PAT without putting it in Codex config
Create a private environment file outside all shared workspaces and allowed roots, for example:
QODERCN_PERSONAL_ACCESS_TOKEN=your_real_tokenSet QODER_MCP_PAT_FILE to that file's absolute path. The bridge reads the token only when starting a Qoder task and passes it directly to the child process. It does not write the token into task results or diagnostics.
Do not commit this file, place it in the repository, or paste the real token into config.toml.
Codex MCP configuration
Merge one [mcp_servers.qoder] block into the Codex config.toml used by the Codex process. Replace every placeholder with a real absolute path.
Ready-to-edit templates are also available in deploy/codex-mcp.toml and deploy/codex-mcp.windows.toml.
Linux
[mcp_servers.qoder]
command = "/absolute/path/to/node"
args = ["/absolute/path/to/qoder-in-codex/src/index.js"]
env = { QODERCLI_PATH = "/absolute/path/to/qoderclicn", QODER_MCP_ALLOWED_ROOTS = "/home/YOUR_USER/projects", QODER_MCP_CODEX_CONFIG = "/home/YOUR_USER/.codex/config.toml", QODER_MCP_PERMISSION_MODE = "accept_edits" }
startup_timeout_sec = 10
tool_timeout_sec = 35
default_tools_approval_mode = "approve"
supports_parallel_tool_calls = trueFor a remote Codex workspace, all paths—including cwd passed to the tools—are paths on the remote Linux host, not local Windows paths.
Windows
[mcp_servers.qoder]
command = "C:/Program Files/nodejs/node.exe"
args = ["C:/path/to/qoder-in-codex/src/index.js"]
env = { QODERCLI_PATH = "C:/Users/YOUR_NAME/AppData/Roaming/npm/node_modules/@qodercn-ai/qoderclicn/bundle/qoderclicn.js", QODER_MCP_ALLOWED_ROOTS = "C:/Users/YOUR_NAME/projects", QODER_MCP_CODEX_CONFIG = "C:/Users/YOUR_NAME/.codex/config.toml", QODER_MCP_PAT_FILE = "C:/Users/YOUR_NAME/.config/qoder/pat.env", QODER_MCP_PERMISSION_MODE = "accept_edits" }
startup_timeout_sec = 10
tool_timeout_sec = 35
default_tools_approval_mode = "approve"
supports_parallel_tool_calls = trueRemove QODER_MCP_PAT_FILE when using a persistent Qoder CLI login instead.
The Windows example invokes the Qoder JavaScript bundle through Node directly. This avoids .cmd shim and shell-quoting problems. Locate the installed bundle with your npm prefix if the example path differs.
After changing MCP configuration, start a new Codex session or restart Codex. Then verify registration:
codex mcp list
codex mcp get qoderWorkspace behavior
A task cwd must be an existing absolute directory and must pass validation at both queueing and execution time.
It is accepted when it is inside at least one of:
QODER_MCP_ALLOWED_ROOTS, an optional list of static roots.A project marked
trust_level = "trusted"in the Codex config named byQODER_MCP_CODEX_CONFIG.
Codex trusted projects are read afresh for every task. After the initial MCP setup, creating and trusting a new Codex workspace does not require another MCP restart or config edit.
Use your platform's path delimiter for multiple static roots:
Linux/macOS:
/path/one:/path/twoWindows:
C:/path/one;D:/path/two
When dynamic Codex trust is enabled, the bridge rejects the user-home root and the Codex configuration tree even if broad trust entries exist. Realpath checks also prevent lexical-prefix and symlink escapes. These checks are an application-level guard, not an operating-system sandbox.
Using it from Codex
Ask the Codex parent agent something like:
Use qoder_spawn in the current workspace with tier=pro.
Delegate a self-contained task to fix the failing parser test.
Use qoder_wait until the task reaches a terminal state.
Then inspect the diff and run the relevant tests yourself before reporting completion.Use fast only for mechanical work such as a narrowly specified file generation or simple rename. Use pro for debugging, reviews, refactors, multi-step edits, and uncertain tasks.
Always let the parent agent verify the final files. A completed Qoder task is not a substitute for independent acceptance.
MCP tools
qoder_spawn
Starts a task and returns immediately.
Argument | Required | Description |
| yes | Complete, self-contained task and relevant context. Maximum 256 KiB of UTF-8 text. |
| yes | Absolute working directory in the MCP server's host environment. |
| no |
|
The result includes task_id, status, requested model, and workspace path.
qoder_wait
Waits briefly for a state change without blocking the MCP connection for the full task duration.
Argument | Required | Description |
| yes | UUID returned by |
| no | Integer from 0 to 25; defaults to 20. |
Terminal results can include final content, session ID, turn count, duration, raw modelUsage, actual_models, exit code, and a stable error object.
qoder_cancel
Cancels a queued task or terminates a running task. Cancellation is idempotent. On Linux, the bridge terminates the Qoder process group, first with TERM and then KILL after a grace period.
Real-task smoke verification
The included verifier calls qoder_spawn exactly once, polls until a terminal state, and prints the structured result. It does not retry.
The following example consumes one real Qoder task and enforces a persistent one-spawn budget:
QODERCLI_PATH=/absolute/path/to/qoderclicn \
QODER_MCP_ALLOWED_ROOTS=/absolute/path/to/workspace \
QODER_MCP_CODEX_CONFIG=/home/YOUR_USER/.codex/config.toml \
QODER_MCP_PERMISSION_MODE=accept_edits \
QODER_MCP_MAX_SPAWNS=1 \
QODER_MCP_BUDGET_FILE=/absolute/private/path/smoke-budget.json \
node scripts/verify-mcp.js \
--tier fast \
--cwd /absolute/path/to/workspace \
--task "Create smoke-result.txt containing exactly SMOKE_OK and no trailing newline. Do not change any other file. Verify the file yourself."Check the returned status and actual_models, then independently inspect smoke-result.txt.
Configuration reference
Environment variable | Default | Purpose |
|
| Qoder CLI executable or JavaScript bundle. |
| empty | Static workspace roots separated by the platform path delimiter. |
| unset | Codex config used to discover trusted projects dynamically. |
|
| Qoder permission mode. Unsafe bypass modes are rejected. |
| unset | Optional private env file containing |
| system temp | Private task attachments and the default budget file. |
|
| Maximum Qoder task runtime. |
| unlimited | Persistent spawn budget, useful for tests and smoke checks. |
| runtime budget file | Budget counter shared across MCP restarts. |
|
| Per-stream stdout/stderr safety limit for the CLI runner. |
|
| Maximum queued tasks. |
|
| Retention time for terminal task results. |
Model audit behavior
Requested tier names and actual provider-side model identifiers are different. For example, Qoder may report internal identifiers such as dfmodel or kmodel_latest in actual_models.
The bridge fails a task when:
modelUsageis missing or contains multiple ambiguous models (MODEL_AUDIT_MISSING).Qoder silently falls back to
auto(MODEL_FALLBACK).The CLI exits unsuccessfully or omits a final result record.
This prevents a successful-looking response from hiding an unintended model fallback.
Security notes
default_tools_approval_mode = "approve"allows Codex to call these MCP tools without a separate approval prompt. Install the bridge only if you trust it and its configuration.The bridge intentionally does not expose arbitrary model names, raw extra CLI arguments,
bypass_permissions, or--dangerously-skip-permissions.Qoder retains its full CLI tool loop. Delegate only bounded tasks and inspect all resulting changes.
Keep PAT files, Codex configuration, and other credentials outside shared workspaces.
The path allowlist is not a substitute for OS isolation, containers, or a dedicated unprivileged account.
Prompt attachments are created privately and removed on every exit path. Nested Qoder SDK state is scrubbed before launching the standalone CLI.
Qoder sessions use
--no-session-persistence.
Troubleshooting
qoder does not appear in Codex
Run codex mcp get qoder against the same Codex home used by the application. Start a new Codex session or restart the application after editing MCP config.
Not logged in or immediate CLI exit
Run qoderclicn --list-models in a clean terminal. Authenticate with qoderclicn login, or configure QODER_MCP_PAT_FILE correctly. When launching from another Qoder agent, stale nested SDK environment variables can also interfere; the bridge scrubs known nested SDK state.
CWD_OUTSIDE_ROOTS
Confirm that:
cwdis absolute and exists on the MCP host.It is inside a configured static root or a currently trusted Codex project.
QODER_MCP_CODEX_CONFIGpoints to the same Codex config that contains the project trust entry.You are not passing a Windows path to a remote Linux MCP server, or vice versa.
MODEL_FALLBACK or MODEL_AUDIT_MISSING
Inspect the returned raw modelUsage. Do not treat the task as verified. The bridge does not automatically retry it.
MCP calls require approval
Ensure the Qoder MCP block contains:
default_tools_approval_mode = "approve"Restart or start a new Codex session after changing this setting.
Development
npm test
npm auditThe suite uses Node's built-in test runner, a fake Qoder CLI, and a real MCP stdio client. It covers configuration, trusted-workspace reloads, path escapes, attachments, output parsing, model fallback, output limits, cancellation, process-group cleanup, concurrency, budgets, TTL, and the MCP lifecycle.
Linux runs the process-group cancellation test; that Linux-only test is skipped on other platforms.
License
MIT. See LICENSE.
The implementation includes attribution to the earlier cantbeblank96/qodercli-mcp investigation, specifically v0.4.3 at commit c38fccf9bf857babe8601c77feca4966ef6477cc.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Design, build and run teams of AI agents with checked handoffs between them.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT conversations to directly inspect local workspaces and delegate coding tasks to a local Codex agent, with controlled concurrency, reusable sessions, and task/usage tracking.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to delegate complex coding tasks, refactorings, and automated code reviews to OpenAI Codex and Google Antigravity CLIs, running them autonomously in YOLO mode with process supervision.6MIT
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI coding assistant to delegate tasks in parallel to specialized CLI-based AI sub-agents, sharing project context and synthesizing their responses from within an IDE.-
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI coding assistant to delegate tasks to multiple specialized CLI-based sub-agents in parallel, share project context, and synthesize their responses into a single result. It supports using existing subscriptions and local tools without extra markup.-