Skip to main content

Overview

OpenAI’s Codex ships in three form-factors that share the same configuration file:
  • Codex CLI — terminal agent (npm install -g @openai/codex or brew install --cask codex)
  • Codex App — native macOS / Windows desktop app (openai.com/codex)
  • Codex IDE Extension — VS Code (openai.chatgpt) and JetBrains (IntelliJ, PyCharm, WebStorm, Rider; 2025.3+)
All three read ~/.codex/config.toml, so one snippet wires CodeAlive into every Codex surface.
Quick install: Run npx @codealive/installer to automatically configure CodeAlive for Codex. See the Installation Guide for details.
Codex defaults to shell-based search (grep/rg) for exploration. Connecting the MCP server alone won’t change that — add routing rules to your project’s AGENTS.md. See Instructing Codex via AGENTS.md below.

Prerequisites

Setup

Verify the entry was registered:
Then restart Codex (CLI, App, or reload the IDE extension) and try in chat:
  • “What CodeAlive repositories are available?”
  • “Find authentication code in my codebase”

Codex App: Setup via UI

Codex App (macOS / Windows) lets you manage MCP servers from Settings → MCP Servers → Add Server. Fill in:
  • Name: codealive
  • URL: https://mcp.codealive.ai/api
  • Authentication: Choose browser OAuth when prompted; use an Authorization header only for the API-key fallback
The UI writes the entry into ~/.codex/config.toml; the CLI and IDE extension pick it up automatically.

Codex IDE Extension

The Codex extension for VS Code (openai.chatgpt) and JetBrains (2025.3+) shares ~/.codex/config.toml with the CLI and App — there is no separate config surface. In VS Code, open the Codex panel → settings (⚙) → MCP settings → Open config.toml.

Project-level Config

Codex now supports a per-project .codex/config.toml at the repository root (for trusted projects). Useful when:
  • The whole team should share the same MCP server set
  • Different projects need different CodeAlive workspaces
Each teammate runs codex mcp login codealive and receives their own CodeAlive authorization; no shared credential is committed.

Optional Fields

The [mcp_servers.codealive] table accepts several extras: Example with a larger tool timeout (useful when relying on the slower chat tool):

Instructing Codex via AGENTS.md

Codex reads AGENTS.md from the repository root on every run, plus a global ~/.codex/AGENTS.md that applies to all projects. Repo-root instructions win on conflict; keep org-wide defaults global and project specifics in the repo. Without instructions, Codex explores with shell search (grep/rg) over the local checkout. Add a CodeAlive section that names that habit explicitly:
AGENTS.md — CodeAlive section
Two Codex-specific notes:
  • The MCP server’s own instructions help too. At initialization Codex reads the server-provided instructions field, and the CodeAlive server ships tool-usage guidance there. That covers how to call the tools; AGENTS.md is still needed to set precedence over Codex’s built-in shell search.
  • AGENTS.md is cross-agent. Claude Code, Cursor’s CLI, and most modern agents read the same repo-root file, so this one section covers teammates on other tools. See Instructing Coding Agents for the general patterns.

Usage

Once connected, Codex can:
  • Search your codebase semantically across all indexed repositories
  • Answer architecture questions with full project context
  • Find patterns and implementations across multiple services

Troubleshooting

  1. Run codex mcp list to confirm Codex sees the entry
  2. Verify the config file is at ~/.codex/config.toml (or project-level .codex/config.toml)
  3. Check TOML syntax (use a TOML validator)
  4. Restart Codex (CLI, App, or reload the IDE extension)
  1. Confirm the URL is exactly https://mcp.codealive.ai/api
  2. Run codex mcp login codealive and complete the browser redirect
  3. Run codex mcp get codealive to inspect the stored configuration
  1. Run codex mcp logout codealive, then codex mcp login codealive
  2. Confirm the browser shows the expected CodeAlive consent screen and callback host
  3. If you intentionally use the API-key fallback, verify CODEALIVE_API_KEY is exported in the shell that launched Codex
For more solutions, see the Troubleshooting Guide.

Instruct Your Agent

Connecting CodeAlive makes its tools available, but the agent may still default to its built-in search. For reliable results, add a short instruction in the agent’s native format telling it to prefer semantic_search and grep_search when exploring indexed code. See Instructing Coding Agents.