Skip to main content
Glama
hampsterx

codex-mcp-bridge

by hampsterx

Codex CLI

codex
Destructive

Execute a prompt via Codex CLI to generate, analyze, refactor, or explain code with full project context. Supports file reading, git operations, and terminal commands.

Instructions

Execute a prompt via Codex CLI. Codex is an AI coding agent that can generate, analyze, refactor, and explain code with full project context (reads AGENTS.md/CODEX.md automatically).

Capabilities: code generation and refactoring, code analysis and explanation, file reading and modification (when sandbox allows), git operations and terminal commands, multi-turn conversations via sessionId.

When to use a different tool:

  • For analysis of text you already have (plans, docs, opinions), inline it directly in the prompt rather than passing file paths. The files parameter triggers full file I/O and increases timeout pressure.

Tips:

  • Set workingDirectory to the target repo for project-aware responses.

  • Use sandbox "read-only" (default) for analysis, "full-auto" for code changes.

  • Break complex tasks into focused prompts rather than one large request.

  • Resume multi-turn conversations with sessionId (returned in previous response metadata).

  • Include relevant files via the files parameter for targeted context (text and images supported).

  • Set reasoningEffort to control depth: "none" for trivial, "minimal" for lightweight, "low"/"medium" for routine, "high"/"xhigh" for deep analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNoFile paths relative to workingDirectory. Supports line ranges: 'path:start-end' (e.g. 'src/lib.rs:900-950'). Text and images supported (images ignore line ranges).
modelNoModel to use (e.g. o3, gpt-4.1)
promptYesThe prompt to send to Codex
sandboxNoSandbox level: read-only (default), workspace-write, or full-auto (Codex CLI convenience mode for workspace-write with auto-approve)read-only
timeoutNoTimeout in milliseconds (default: 60s no files, 180s+30s/file with files, max: 600000)
sessionIdNoSession ID to resume a previous conversation
resetSessionNoClear this session's conversation history and start fresh (requires sessionId)
reasoningEffortNoReasoning effort level (maps to -c model_reasoning_effort)
workingDirectoryNoWorking directory for the CLI
maxResponseLengthNoSoft limit on response length in words
Behavior4/5

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

Annotations already include destructiveHint=true and readOnlyHint=false. The description enhances this by detailing sandbox levels (read-only, workspace-write, full-auto), timeout behavior, and the impact of the files parameter on I/O and timeout. No contradictions with annotations.

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?

The description is well-organized: a one-sentence purpose, a bulleted capabilities list, a 'When to use a different tool' paragraph, and compact tips. Every sentence adds value, and the structure aids quick comprehension.

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?

For a tool with 10 parameters, no output schema, and complex capabilities, the description covers purpose, usage guidelines, tips, and behavioral context. It could be more explicit about the response format, but overall it provides sufficient context for effective use.

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 description coverage is 100%, so baseline is 3. However, the description adds significant practical context: line ranges for files, sandbox semantics, timeout defaults, reasoning effort mapping, and sessionId usage. This goes well beyond the schema descriptions.

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?

The description clearly states 'Execute a prompt via Codex CLI' and lists specific capabilities like code generation and refactoring. It distinguishes from siblings through the 'When to use a different tool' section and by emphasizing that this tool is for interacting with an AI coding agent with full project context.

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?

The description provides a 'When to use a different tool' section that advises against using the files parameter for simple text analysis, and offers tips on setting workingDirectory, sandbox level, and session management. While it doesn't explicitly contrast with sibling tools, the guidance is clear and actionable.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hampsterx/codex-mcp-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server