Skip to main content
Glama
codex-local-mcp

codex-local-mcp

by ossmalaysia

Run a task with the local Codex CLI

codex_run

Delegate natural-language coding tasks to the local Codex CLI, returning output and created files or a job ID to collect longer runs.

Instructions

Hand a natural-language task to the local Codex CLI coding agent. Codex can write and run code, install packages and call APIs inside an isolated workspace folder, then this returns its output plus any files it created. If Codex takes longer than wait_sec, this returns status: running and a job_id instead; call codex_job_result with it to collect the result.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "codex_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNoOverride the Codex model for this run.
promptYesThe task for Codex, written as you would to a developer.
wait_secNoSeconds to wait for the result before returning a job_id instead. Default 45, maximum 50, which keeps the call under common 60-second client timeouts.
workspaceNoRelative workspace folder name under the workspace root. Reuse the same name to continue working on the same files. Defaults to a new timestamped folder.
timeout_secNoSeconds before Codex is killed. Default 300.
reasoning_effortNoModel reasoning effort. Supported values depend on the model.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.0
    • addedInput schema / properties / reasoning_effort
      Added value: +{
      +  "description": "Model reasoning effort. Supported values depend on the model.",
      +  "enum": [
      +    "default",
      +    "none",
      +    "minimal",
      +    "low",
      +    "medium",
      +    "high",
      +    "xhigh"
      +  ],
      +  "type": "string"
      +}
  2. Changed1 schema field changedv0.2.0
    • addedInput schema / properties / wait_sec
      Added value: +{
      +  "description": "Seconds to wait for the result before returning a job_id instead. Default 45, maximum 50, which keeps the call under common 60-second client timeouts.",
      +  "type": "number"
      +}
  3. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  4. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the security-relevant behavior that Codex can write and run code, install packages and call APIs, that it operates in an isolated workspace folder, and that the call may return early with a job_id. It stops short of stating resource limits, network/permission boundaries, or whether runs are resumable across matching workspace names.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, zero filler, and front-loaded: what the tool does first, then its capabilities and return, then the timeout escape hatch. Each sentence contributes information an agent needs to call it correctly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description compensates by describing the return (Codex output plus created files) and the async variant. The only real gap is not pointing to codex_read_artifact for pulling back the files it mentions, which leaves a small hole in an otherwise complete picture for a 6-parameter, long-running tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all six parameters and the baseline would be 3. The description adds real meaning beyond it by tying wait_sec to a specific outcome (status: running plus a job_id) and explaining that the workspace name is what makes follow-up runs work on the same files.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource: handing a natural-language task to the local Codex CLI coding agent. It also bounds the scope ('isolated workspace folder') and says what comes back (output plus created files), so it is clearly distinguishable from codex_job_result and codex_read_artifact.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit guidance for the async path: if Codex exceeds wait_sec, the call returns status: running with a job_id and you should call codex_job_result. It does not explain when to reach for this versus codex_generate_image (image generation) or how to retrieve created files via codex_read_artifact, so the sibling routing is only partially covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.