Skip to main content

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 dev or docker compose up)
  • Codex CLI installed
  • Python 3.11+

Quick Setup

make setup

Manual Configuration

Add to ~/.codex/config.yaml:

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

  1. Run codex in a project directory and invoke a tool
  2. Check http://localhost:5173Live Activity for the event

Token Refresh

make tokens

For stdio transport, credentials are used to obtain fresh tokens automatically.