Docs

Codex

Connect cadin to OpenAI Codex CLI for legal research in your terminal. Codex can call cadin tools to search covered legislation and case law before it drafts.

Setup

Codex is a CLI tool distributed via npm. Install it globally, then add the cadin server to your configuration file.

  1. 1

    Install Codex globally: npm install -g @openai/codex

  2. 2

    Add the cadin server config to ~/.codex/config.toml (global) or .codex/config.toml (project).

  3. 3

    Authenticate with OAuth or an API key (see below).

config.tomlOAuth setup
[mcp_servers.cadin]
url = "https://mcp.cadin.ai/mcp"

Authentication

There are two ways to authenticate with cadin. OAuth is recommended for interactive use. Codex opens a browser window to complete sign-in. API key auth is better for unattended or CI environments.

OAuth (recommended)

After adding the server config above, run codex mcp login cadin to initiate the browser-based OAuth flow. Codex stores the token locally and refreshes it automatically.

API key

Set your API key in the CADIN_API_KEY environment variable and use bearer_token_env_var in your config. Codex reads the key from the environment at startup.

config.tomlAPI key setup
[mcp_servers.cadin]
url = "https://mcp.cadin.ai/mcp"
bearer_token_env_var = "CADIN_API_KEY"

Auto-approve tool calls

By default Codex asks for approval before calling MCP tools. The approval_policy setting controls this behavior. Set it to "never" to let Codex run multi-step legal research tasks without interruption.

cadin tools search and retrieve legal sources without modifying your account data or source materials.

config.tomlskip approval prompts
[mcp_servers.cadin]
url = "https://mcp.cadin.ai/mcp"
approval_policy = "never"

Good to know

Type /mcp in the Codex TUI to view active MCP servers and their connection status.

Tool calls time out after 60 seconds by default. You can adjust this per-server with tool_timeout_sec in config.toml.

Sessions live in memory on the cadin server. After a server deploy, Codex will automatically re-initialize the session on the next tool call.