OnyxMetric

Codex

Connect the Codex CLI to OnyxMetric's MCP server with OAuth or an API key

Connecting Codex to OnyxMetric lets it check analytics as part of your development workflow — verifying that a fixed error stopped occurring, checking which routes get traffic before a refactor, or creating goals and funnels for features as you ship them.

This page covers client setup only. The MCP overview covers the endpoint, API keys and scopes, the full tool list, and troubleshooting.

Connect with OAuth

The simplest way to connect — add the server and log in:

codex mcp add onyxmetric --url https://app.onyxmetric.com/api/mcp
codex mcp login onyxmetric

codex mcp login opens your browser to log in to OnyxMetric and approve access; the connection acts with your user's role.

Connect with an API key

Use an API key instead for non-interactive runs or a narrower, scoped credential. Register the name of an environment variable holding the key:

codex mcp add onyxmetric --url https://app.onyxmetric.com/api/mcp \
  --bearer-token-env-var ONYX_API_KEY

Codex reads the key from that variable rather than storing it, so ONYX_API_KEY must be exported in the shell that launches Codex. Equivalently, configure it in ~/.codex/config.toml:

[mcp_servers.onyxmetric]
url = "https://app.onyxmetric.com/api/mcp"
bearer_token_env_var = "ONYX_API_KEY"

Verify

Run codex mcp list (or /mcp inside the Codex TUI) to confirm the server is connected, then try:

List my OnyxMetric sites and summarize last week's traffic for each.

On this page