---
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
token_estimate: 770
---
# 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 [here](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. Set up using Streamable HTTP, with URL set to `https://api.statsig.com/v1/mcp`:

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

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

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

#### 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/v1/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/v1/mcp"
command = "npx"
args = ["--yes", "mcp-remote", "https://api.statsig.com/v1/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 [here](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'"

## Next steps

After installation, you can:

- List experiments, gates, and dynamic configs
- Create and update experiments, gates, and configs
- Access your Statsig data directly from Codex

For available MCP capabilities, go to the [MCP capabilities](https://docs.statsig.com/integrations/mcp/overview#current-mcp-capabilities) section.

