---
title: Statsig MCP with Codex
description: "Learn how to set up the Statsig MCP server using Codex CLI, IDE extension, or Desktop App."
product: general
lang: en
token_estimate: 689
---
# Statsig MCP with Codex

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Installation and authentication with OAuth

> **Note:**
>
> MCP OAuth only supports Personal Console API Keys. Ensure your Statsig org owner has enabled Personal Console API Keys creation for your role in [organization settings](https://console.statsig.com/settings?tab=organization).

On Codex, use OAuth and the HTTP transport directly. Codex saves authentication for future sessions.

#### Codex Desktop

In Codex Desktop, navigate to _Settings > MCP servers_ and add a new custom server. Select Streamable HTTP and set the URL to `https://api.statsig.com/v3/mcp`:

![Set up Statsig MCP in the Codex Desktop App](https://docs.statsig.com/images/integrations/mcp/statsig-codex-desktop-app-setup.png) ![Set up Statsig MCP in the Codex Desktop App](https://docs.statsig.com/images/integrations/mcp/statsig-codex-desktop-app-setup.dark.png)

Upon saving, you should see statsig turned on under custom servers.

#### Codex CLI and IDE extension

If you're working in Codex CLI or IDE extension, run the below command to add the Statsig MCP server into your `~/.codex/config.toml` file and restart Codex.

```bash
codex mcp add statsig --url https://api.statsig.com/v3/mcp
```

This command opens a browser window for you to sign in to your Statsig account and authorize access to your Statsig project.

After signing in, restart Codex and run `/mcp` in CLI to confirm the Statsig MCP appears as an available MCP server. Make sure the status is enabled:

![Statsig MCP in the Codex CLI MCP Servers List](https://docs.statsig.com/images/integrations/mcp/statsig-codex-cli-complete.png)

#### Using API key instead of OAuth

```toml
[mcp_servers.statsig]
url = "https://api.statsig.com/v3/mcp"
command = "npx"
args = ["--yes", "mcp-remote", "https://api.statsig.com/v3/mcp", "--header", "statsig-api-key: console-YOUR-CONSOLE-API-KEY"]
trust_level = "trusted"
enabled = true
```

Replace `console-YOUR-CONSOLE-API-KEY` with your actual Statsig Console API key, which you can retrieve from the [API keys page](https://console.statsig.com/api_keys). Ensure your API key has the right permissions: read-only keys can view data, while write keys can make changes to your project.

## Using Statsig MCP with Codex

With Statsig MCP configured in any Codex environment, you can:

- **Explore Experiments**: "List all my active experiments"
- **Manage Gates**: "What gates are currently stale?"
- **Configure Dynamic Configs**: "Show me the configuration for the dynamic config 'dynamic-config'"
- **Get Insights**: "Show me details about the experiment called 'new-checkout-flow'"

