OpenAI·~/.codex/config.toml

Codex + Mackerel

Reads remote MCP servers from ~/.codex/config.toml and project rules from AGENTS.md.

  1. 1

    Export your API key

    Set MACKEREL_API_KEY in your shell profile before launching Codex.

    export MACKEREL_API_KEY="mk_live_..."
  2. 2

    Add Mackerel to ~/.codex/config.toml

    Codex sends the environment variable as a Bearer token on every MCP call.

    ~/.codex/config.toml

    [mcp_servers.mackerel]
    url = "https://api.runmackerel.com/mcp"
    bearer_token_env_var = "MACKEREL_API_KEY"
  3. 3

    Install the skill file

    Drop SKILL.md into your repo or ~/.codex/skills so Codex applies Mackerel invariants automatically.

    mkdir -p .codex/skills/mackerel
    curl -fsSL https://runmackerel.com/skill.md -o .codex/skills/mackerel/SKILL.md
  4. 4

    Verify the connection

    Start codex and check the demo corpus.

    Call mackerel_list_corpora, then run mackerel_search on demo_sops for EU log retention during a litigation hold as group "legal" vs "engineering".

What your agent gets

Served over Streamable HTTP at https://api.runmackerel.com/mcp.

mackerel_search

Search demo_sops or custom corpora with ACL groups, override chains, and abstention.

mackerel_list_corpora

List available corpora and rule counts in the authenticated workspace.

mackerel_upsert_rule

Add or update rule nodes, ACL groups, overrides, and supersession edges.

Example build prompt
Add a typed Mackerel client to src/lib/policy.ts with X-Mackerel-ZDR: true and unit tests for governing, overridden, and abstained responses.