Overview
OpenAI’s Codex ships in three form-factors that share the same configuration file:- Codex CLI — terminal agent (
npm install -g @openai/codexorbrew 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+)
~/.codex/config.toml, so one snippet wires CodeAlive into every Codex surface.
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
- Any of: Codex CLI, Codex App, or Codex IDE Extension
- CodeAlive account (Sign up here)
- Indexed repositories in your CodeAlive dashboard
Setup
- HTTP with browser OAuth (Recommended)
- HTTP with API key
- Docker (STDIO)
- Manual HTTP with static header
Run this in your terminal:Authenticate once in your browser:
- “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
~/.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
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 readsAGENTS.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
- The MCP server’s own instructions help too. At initialization Codex reads the server-provided
instructionsfield, and the CodeAlive server ships tool-usage guidance there. That covers how to call the tools;AGENTS.mdis still needed to set precedence over Codex’s built-in shell search. AGENTS.mdis 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
MCP server not detected
MCP server not detected
- Run
codex mcp listto confirm Codex sees the entry - Verify the config file is at
~/.codex/config.toml(or project-level.codex/config.toml) - Check TOML syntax (use a TOML validator)
- Restart Codex (CLI, App, or reload the IDE extension)
HTTP transport not working
HTTP transport not working
- Confirm the URL is exactly
https://mcp.codealive.ai/api - Run
codex mcp login codealiveand complete the browser redirect - Run
codex mcp get codealiveto inspect the stored configuration
Authentication errors
Authentication errors
- Run
codex mcp logout codealive, thencodex mcp login codealive - Confirm the browser shows the expected CodeAlive consent screen and callback host
- If you intentionally use the API-key fallback, verify
CODEALIVE_API_KEYis exported in the shell that launched Codex
Related Resources
- Instructing Coding Agents
- CodeAlive & 1С (1C:Enterprise specifics)
- MCP Overview
- Installation Guide
- Self-Hosting Guide
- Agent Skills
- Codex MCP Documentation (OpenAI)
- Codex Config Reference (OpenAI)
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 prefersemantic_search and grep_search when exploring indexed code. See Instructing Coding Agents.