Skip to main content
Glama
hampsterx

codex-mcp-bridge

by hampsterx

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CODEX_CLI_PATHNoPath to the Codex CLI binary.codex
OPENAI_API_KEYNoYour OpenAI API key. Required if not using `codex auth login`.
CODEX_MCP_SERVERSNoControl which Codex internal MCP servers stay enabled.
CODEX_DEFAULT_MODELNoDefault model for all tools.(CLI default)
CODEX_FALLBACK_MODELNoFallback on quota exhaustion. Set to 'none' to disable.o3
CODEX_MAX_CONCURRENTNoMaximum concurrent subprocess spawns.3

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
codexA

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.

searchA

Web search via Codex CLI. Searches the web and synthesizes a comprehensive answer with source URLs. Use for current information, documentation lookups, API references, and research questions.

Tips:

  • Ask specific, focused questions for best results.

  • Results include source URLs for verification.

  • Use maxResponseLength to control response verbosity.

  • Default timeout is 2 minutes; increase for complex research queries that may require multiple web fetches.

queryA

Lightweight query for analysis or opinions on text you already have. No file reading, no repo exploration, no session state. Pass text in the context parameter. For code execution or file operations, use the codex tool instead.

Use cases: reviewing a plan, critiquing a draft, comparing approaches, answering questions about provided text, generating summaries.

Tips:

  • Pass the text to analyze in the context parameter, not as file paths.

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

  • Use maxResponseLength to control verbosity.

reviewA

Run Codex CLI's native diff-aware review via codex exec review --json. The bridge does not accept or bundle a review prompt; upstream Codex owns the reviewer instructions.

Use for MCP clients that cannot run shell commands but need native Codex review of uncommitted changes, a base branch diff, or a single commit.

Tips:

  • Set workingDirectory to the target git repository.

  • Choose mode "uncommitted", "base", or "commit".

  • Use the codex tool with sandbox "read-only" for free-form review prompts.

structuredA

Generate a JSON response conforming to a provided JSON Schema. Use for data extraction, classification, or any task needing machine-parseable output.

listSessionsA

List active Codex conversation sessions. Returns session metadata for orchestration (no prompts or responses, just IDs and timing). Use to check available sessions before resuming with the codex tool's sessionId parameter.

pingA

Health check: verifies Codex CLI is installed and authenticated, reports versions and capabilities.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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