Behavry Integration — OpenAI Codex CLI
OpenAI Codex CLI supports MCP servers via both Streamable HTTP and stdio transports. Configuration lives in ~/.codex/config.yaml.
Prerequisites
- Behavry stack running (
make devordocker compose up) - Codex CLI installed
- Python 3.11+
Quick Setup
make setup
Manual Configuration
Add to ~/.codex/config.yaml:
Streamable HTTP (recommended)
mcp_servers:
behavry:
transport: streamable-http
url: http://localhost:8000/mcp/v1/
headers:
Authorization: "Bearer <behavry-jwt>"
stdio
mcp_servers:
behavry:
transport: stdio
command: behavry-mcp-stdio
args:
- --server-url
- http://localhost:8000
env:
BEHAVRY_CLIENT_ID: "<client_id>"
BEHAVRY_CLIENT_SECRET: "<client_secret>"
Use stdio when HTTP connectivity from Codex CLI is restricted.
Verify
- Run
codexin a project directory and invoke a tool - Check http://localhost:5173 → Live Activity for the event
Token Refresh
make tokens
For stdio transport, credentials are used to obtain fresh tokens automatically.