Skip to content

Connect to Codex

OpenAI Codex

Give Codex real product evidence: traffic, meaningful events, funnels, retention, session paths, and experiment results. Choose hosted MCP for native tool calls, or the skill and CLI when Codex can execute commands in your project.

Use a Codex client with remote Streamable HTTP and OAuth support. From the Codex CLI, register Agent Analytics and sign in:

Terminal window
codex mcp add agent-analytics --url https://mcp.agentanalytics.sh/mcp
codex mcp login agent-analytics

Complete browser approval with the Google or GitHub identity that owns your Agent Analytics projects. You do not need to copy an account API key. If Agent Analytics is already connected, reuse that connection.

Start a new conversation and ask:

List my Agent Analytics projects, then show the overview for my-site for the last 7 days.

Replace my-site with a project from the returned list. Hosts that support MCP Apps can show interactive analytics views alongside the tool result; other clients can use the text and structured data. Tool availability depends on your account permissions and plan.

The Agent Analytics plugin bundles the analytics skill and hosted MCP connection. It is available for local testing and is not currently listed in the public OpenAI Plugins Directory. Local marketplaces and the public directory are separate distribution paths.

Follow the plugin repository instructions for the package available there. A local test package can differ from the published repository version. Installing a plugin does not replace account approval, project setup, or event collection.

  • npx available in the environment Codex uses
  • Access to the Google or GitHub sign-in you want to connect when Codex opens browser approval

Alternative: install the Agent Analytics skill

Section titled “Alternative: install the Agent Analytics skill”
Terminal window
npx skills add agent-analytics/skills

If the installer asks which skill to install, choose agent-analytics for setup and reporting. Choose agent-analytics-autoresearch when you want Codex to run a structured growth loop for experiment candidates.

Then ask Codex:

Set up Agent Analytics for this project. Install it here if needed. Open the browser for me or give me a login link, then wait. I will sign in with Google or GitHub, approve it, and paste back any finish code if you need it. Then create the project, add tracking and key events, and verify the first event.

The skill teaches Codex how to set up tracking, query analytics, inspect project health, and run experiments from the same conversation loop. Browser approval creates or connects the account during setup, so you do not need to prepare an API key first.

Ask Codex:

  • List my Agent Analytics projects
  • How is my-site doing this week?
  • Which entry pages lead to my activation event, and where do sessions drop off?
  • Create an experiment for the signup CTA on my-site

If you have not created your first real project yet, continue with First Project in 5 Minutes.

  • If MCP returns no projects, check that browser approval used the account that owns them.
  • If a tool result works but its view does not appear, check the client’s MCP Apps support. Start a new conversation after refreshing or reconnecting stale server metadata; the text and structured result remain useful.
  • If an analysis is unavailable on your plan, use the supported analyses or review your plan. Switching to the CLI does not bypass permissions or plan limits.
  • If the skill installs but the setup pauses on approval, complete the browser sign-in and paste back any finish code if Codex asks for it.
  • If you intentionally use a compatibility API key for direct HTTP debugging, check that AGENT_ANALYTICS_API_KEY is present in the environment the agent actually runs in.
  • If npx is unavailable, install the required Node.js runtime first or use the direct API route temporarily.
  • If you need endpoint-level debugging, use the API reference and test with curl.