codex-mcp-tool

v2.7.0
io.github.x51xxx/codex-mcp-tool Checked 3 days ago Published 20 days ago

MCP server bridging AI assistants to OpenAI Codex CLI for code analysis and review

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

ask-codex

Execute Codex CLI with file analysis (@syntax), skills ($syntax), model selection, and safety controls. Supports changeMode.

ParameterTypeDescription
prompt *stringTask or question. Use @ to include files (e.g., '@largefile.ts explain').
addDirsarrayAdditional writable directories beyond workspace (e.g., ["/tmp", "/var/log"]). Useful for monorepos and multi-directory projects.
approvalstringDeprecated alias for approvalPolicy — both map to --ask-for-approval. Prefer approvalPolicy. Values: on-request, never
approvalPolicystringApproval policy (-a): never, on-request. Note: non-interactive `codex exec` runs report `approval: never` even with on-request, since nobody can answer a prompt.
bypassHookTrustbooleanDANGEROUS: run enabled hooks without persisted hook trust
cdstringWorking directory
changeModebooleanReturn structured OLD/NEW edits for refactoring
chunkCacheKeystringCache key for continuation
chunkIndexnumberChunk index (1-based)
configConfiguration overrides as 'key=value' string or object
disableFeaturesarrayDisable feature flags (repeatable). Equivalent to -c features.<name>=false
enableFeaturesarrayEnable feature flags (repeatable). Equivalent to -c features.<name>=true
ephemeralbooleanRun without persisting Codex session files to disk
fullAutobooleanCompatibility alias for workspace-write with approval=never (not --yolo)
ignoreRulesbooleanIgnore user and project execpolicy .rules files for this run
ignoreUserConfigbooleanIgnore $CODEX_HOME/config.toml for this run; authentication is still loaded
imageOptional image file path(s) to include with the prompt
includeMetadatabooleanInclude configuration metadata in response
includeThinkingbooleanInclude reasoning/thinking section in response
localProviderstringSpecify which local provider to use (lmstudio or ollama). Automatically enables --oss if not set. If omitted with --oss, uses config default or shows selection.
modelstringOptional model override. Known: gpt-6.1-sol, gpt-6-astra, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna. If omitted, uses your Codex CLI default (~/.codex/config.toml)…
ossbooleanUse local Ollama server (convenience for -c model_provider=oss). Requires Ollama running locally. Automatically sets sandbox to workspace-write if not specified.
outputLastMessagestringWrite final Codex message to file path. Useful for CI/CD result capture (Codex CLI v0.95.0+)
outputSchemaJSON Schema path or inline schema to constrain output format (Codex CLI v0.95.0+)
personalitystringCommunication style: pragmatic (concise, machine-friendly), friendly (conversational) or none (no personality instructions)
profilestringConfig profile (-p <name>): layers $CODEX_HOME/<name>.config.toml over the base config. Legacy [profiles.<name>] tables in config.toml make the CLI refuse the run.
reasoningEffortstringReasoning depth. Omit to use the CLI default. max/ultra are model-dependent GPT-6/GPT-5.6 options; ultra may delegate to subagents.
resetSessionbooleanClear session context before execution. Starts fresh conversation.
responseModestringResponse verbosity: "clean" returns only the final answer (default), "full" returns the complete execution log including thinking, tool calls, and agent activity
sandboxbooleanQuick automation mode: enables workspace-write with approval=never. Sandboxing remains active.
sandboxModestringAccess: read-only, workspace-write, danger-full-access
searchbooleanEnable web search using native --search flag (v0.52.0+). Requires network access - automatically sets sandbox to workspace-write if not specified.
sessionIdstringSession ID for conversation continuity. Enables native Codex resume.
skipGitRepoCheckbooleanSkip git repository validation. Useful for non-git directories (Codex CLI v0.75.0+)
strictConfigbooleanFail when config.toml contains fields unknown to the installed Codex CLI
timeoutintegerMaximum execution time in milliseconds (optional)
toolOutputTokenLimitnumberMaximum tokens for tool outputs (100-10,000). Controls response verbosity.
workingDirstringWorking directory for execution
yoloboolean⚠️ Bypass all safety (dangerous)

batch-codex

Delegate multiple atomic tasks to Codex for batch processing. Ideal for repetitive operations, mass refactoring, and automated code transformations

ParameterTypeDescription
tasks *arrayArray of atomic tasks to delegate to Codex
concurrencyintegerMaximum parallel Codex processes when parallel=true. Default: min(task count, 4)
disableFeaturesarrayDisable feature flags
enableFeaturesarrayEnable feature flags
modelstringOptional model override applied to every task. Known: gpt-6.1-sol, gpt-6-astra, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna. If omitted, uses your Codex CLI default…
ossbooleanUse local Ollama server
parallelbooleanExecute independent tasks in parallel
sandboxstringSandbox mode: read-only, workspace-write, danger-full-access
searchbooleanEnable live web search for all tasks using the native --search flag
stopOnErrorbooleanStop execution if any task fails
timeoutintegerMaximum execution time per task in milliseconds
workingDirstringWorking directory for execution

review-changes

Run a code review against the current repository using Codex CLI native review subcommand

ParameterTypeDescription
basestringReview changes against a specific base branch (e.g., "main", "develop")
commitstringReview the changes introduced by a specific commit SHA
modelstringOptional model override. Known: gpt-6.1-sol, gpt-6-astra, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna. If omitted, uses your Codex CLI default (~/.codex/config.toml)…
promptstringCustom review instructions or focus areas (cannot be used with uncommitted=true; use base/commit review instead)
reasoningEffortstringReasoning depth for the review. Default: high (code review benefits from deep reasoning).
timeoutintegerMaximum execution time in milliseconds
titlestringOptional title to display in the review summary
uncommittedbooleanReview staged, unstaged, and untracked changes (working tree) - cannot be combined with custom prompt
workingDirstringWorking directory to run the review in (passed via -C as a global Codex option)

ping

Echo

ParameterTypeDescription
promptstringMessage to echo

help

receive help information

version

Display version and system information

brainstorm

Generate creative ideas using structured frameworks with domain context and feasibility analysis.

ParameterTypeDescription
prompt *stringBrainstorming challenge or question
approvalPolicystringApproval policy (-a): never, on-request. Note: non-interactive `codex exec` runs report `approval: never` even with on-request, since nobody can answer a prompt.
cdstringWorking directory
constraintsstringLimitations: budget, time, technical, legal, etc.
disableFeaturesarrayDisable feature flags
domainstringDomain: software, business, creative, research, product, marketing, etc.
enableFeaturesarrayEnable feature flags
existingContextstringBackground info or previous attempts
fullAutobooleanCompatibility alias for workspace-write with approval=never
ideaCountintegerNumber of ideas (default: 12, range: 5-30)
includeAnalysisbooleanInclude feasibility/impact analysis
localProviderstringSpecify which local provider to use (lmstudio or ollama). Automatically enables --oss if not set.
methodologystringFramework: divergent, convergent, scamper, design-thinking, lateral, auto (default)
modelstringOptional model override. Known: gpt-6.1-sol, gpt-6-astra, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna. If omitted, uses your Codex CLI default (~/.codex/config.toml)…
ossbooleanUse local Ollama server
personalitystringCommunication style: pragmatic (concise, machine-friendly), friendly (conversational) or none (no personality instructions)
reasoningEffortstringReasoning depth. Default: high (creative ideation benefits from depth). Override with "xhigh" for very complex domains, "medium" for quick exploration.
sandboxModestringAccess: read-only, workspace-write, danger-full-access
searchbooleanEnable live web search using the native --search flag
yoloboolean⚠️ Bypass all safety (dangerous)

fetch-chunk

Retrieves cached chunks from a changeMode response. Use this to get subsequent chunks after receiving a partial changeMode response.

ParameterTypeDescription
cacheKey *stringThe cache key provided in the initial changeMode response
chunkIndex *numberWhich chunk to retrieve (1-based index)

list-sessions

List all active conversation sessions with metadata, or manage sessions

ParameterTypeDescription
actionstringAction: list (default), delete (single session), clear (all sessions)
sessionIdstringSession ID for delete action
workingDirstringWith delete: remove only the session for this directory. Without it, every session with that ID is removed (one sessionId can exist once per directory).

health

Check Codex CLI and session health status

ParameterTypeDescription
sessionIdstringOptional session ID to check specific session health
verbosebooleanInclude detailed diagnostic information

list-skills

Discover available Codex skills: project .agents/skills and .codex/skills, plus user $CODEX_HOME/skills and ~/.agents/skills

ParameterTypeDescription
workingDirstringWorking directory to search for skills. Defaults to resolved working directory.

do-act

Execute task via Codex, verify with shell command, auto-fix on failure. Act-Check-Fix loop.

ParameterTypeDescription
task *stringTask for Codex to execute
fullAutobooleanCompatibility alias for workspace-write with approval=never
localProviderstring
maxRetriesintegerMax retry attempts if verify fails. Default: 2
modelstringOptional model override. Known: gpt-6.1-sol, gpt-6-astra, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna. If omitted, uses your Codex CLI default (~/.codex/config.toml)…
ossbooleanUse local Ollama/LM Studio
reasoningEffortstringReasoning depth. Default: high (act-check-fix loops benefit from depth so retries converge). Override with "xhigh" for hard tasks, "medium" for simple verifiable steps.
sandboxModestringAccess: read-only, workspace-write, danger-full-access
timeoutintegerCodex timeout per attempt in ms. Default: 10min
verifyobjectShell command to validate result. Triggers act-check-fix loop on failure.
workingDirstringWorking directory

image-gen

Generate or edit images with Codex's built-in image_gen tool (ChatGPT login, no API key). Builds a structured prompt from use case, style, composition, exact text, reference roles and edit invariants, then returns the saved file paths. The image model and pixel size are chosen by Codex; aspect ratio and transparency are requested through the prompt.

ParameterTypeDescription
prompt *stringWhat to create, or for edits, what to change. Be concrete about the subject.
aspectstringAspect ratio: square, landscape (3:2), portrait (2:3), wide (16:9), tall (9:16), or W:H. Requested via the prompt; exact pixel size is chosen by Codex.
assetTypestringWhere the image will be used, e.g. "landing page hero", "app store screenshot"
avoidarrayThings that must not appear
compositionstringFraming, viewpoint, placement, negative space
editImagestringImage to edit (absolute or relative to workingDir). Switches to edit mode.
enhancebooleanLet the Codex host model enrich generic prompts with composition/lighting detail (never adds new subjects or text). false = pass the spec verbatim.
lightingstringLighting and mood
materialsstringMaterials and textures
modelstringHost model that relays the call (not the image model). Known: gpt-6.1-sol, gpt-6-astra, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna. Omit to use the Codex default.
outputPathstringCopy results here (relative to workingDir). A path ending in / is a directory. Without it, images stay in $CODEX_HOME/generated_images.
overwritebooleanOverwrite an existing outputPath instead of writing a -v2 sibling
palettestringColor palette
preservearrayEdit invariants, e.g. ["person and pose", "all text outside the sign"]
presetsarrayGuidance blocks: photoreal, portrait, likeness, product, thumbnail, no-text, exact-text, brand-style
reasoningEffortstringHost model reasoning. Default low: the host only relays the prepared spec.
referencesarrayReference images with roles. Up to 5 images including editImage.
stylestringMedium and style, e.g. "35mm film photo", "flat vector"
textstringExact in-image text, rendered verbatim
timeoutintegerTimeout in ms. Default 10 min; each image takes roughly 30-90s.
transparentBackgroundbooleanAsk for a transparent (alpha) background; check `hasAlpha` in the result
typographystringFont style, size, color and placement for `text`
useCasestringTask category from the Codex imagegen taxonomy; sets the polish level
variantsintegerNumber of images; each is a separate image_gen call
workingDirstringWorking directory for relative paths