Codex Setup

Configure Berry as an MCP server in OpenAI Codex CLI

Prerequisites

  • Berry installed (pip install berry or pipx install berry)
  • Berry authenticated (berry auth login; or berry auth set for CI/headless)

Option 1: Run berry init

The simplest way. From your project root:

berry init

This creates .codex/config.toml with the Berry server configuration.

Use Berry skills in Codex

In Codex, you can invoke a skill by typing $ and the skill name (or use /skills to browse).

Search & Learn (verified)

Workflow: Search & Learn

$search_and_learn_verified
How does <feature> work in this repo? Cite evidence spans and verify.

RCA Fix Agent

Workflow: Refactoring & Bug Fixes

$rca_fix_agent
Bug: <describe failure + repro steps>. Provide root cause, fix, and tests.

Option 2: Manual configuration

Create .codex/config.toml in your project root:

[mcp_servers.berry]
command = "berry"
args = ["mcp", "--server", "classic"]

[mcp_servers.berry.env]
OPENAI_API_KEY = "sk-..."
BERRY_SERVICE_URL = "http://..."

Note: Codex uses TOML format, not JSON. The structure uses [mcp_servers.name]sections for each MCP server.

Tip: if you run berry auth login first, berry init will embed env defaults from ~/.berry/mcp_env.json for you.

Verify it works

  1. Start Codex in your project directory
  2. Check that Berry tools are available
  3. Try calling list_spans to confirm the connection

Config file location

File.codex/config.toml
FormatTOML
ScopePer-project (in project root)