# Overview

## MCP configuration guides

{% card-grid columns="2" %}
{% card title="Codex" href="https://docs.statsig.com/integrations/mcp/codex" icon="computer" %}
Set up Statsig MCP using Codex Desktop App, CLI, or IDE extension.
{% /card %}

{% card title="ChatGPT Connector" href="https://docs.statsig.com/integrations/mcp/chatgpt-connector" icon="message" %}
Talk to your Statsig projects from within ChatGPT.
{% /card %}
{% /card-grid %}

{% card-grid columns="3" %}
{% card title="Cursor" href="https://docs.statsig.com/integrations/mcp/cursor" %}
Configure Statsig MCP in Cursor IDE.
{% /card %}

{% card title="Claude Code" href="https://docs.statsig.com/integrations/mcp/claude-code" %}
Set up Statsig MCP in Claude Code.
{% /card %}

{% card title="Manual setup" href="https://docs.statsig.com/integrations/mcp/manual-setup" %}
Manual configuration for any MCP-compatible tool.
{% /card %}
{% /card-grid %}

## Current MCP capabilities

{% accordion-group %}
{% accordion title="Audit Logs" %}
{% table %}

- Tool
- Description

---

- Get_Audit_Logs
- List audit logs in the project. Filter by:
  - `id`
  - `sortKey`
  - `sortOrder`
  - `tags`
  - `startDate`
  - `endDate`
{% /table %}
{% /accordion %}

{% accordion title="Dynamic Configs" %}
{% table %}

- Tool
- Description

---

- Create_Dynamic_Config
- Create new config

---

- Get_Dynamic_Config_Details_by_ID
- Retrieve detailed config information

---

- Get_List_of_Dynamic_Configs
- List all dynamic config objects in the project. Filter by:
  - `creatorName`
  - `tags`

---

- Update_Dynamic_Config_Entirely
- Replace entire dynamic config with new targeting and values

---

- Get_Dynamic_Config_Version_History
- Retrieve the version history for a dynamic config
{% /table %}
{% /accordion %}

{% accordion title="Experiments (A/B Tests)" %}
{% table %}

- Tool
- Description

---

- Create_Experiment
- Create new experiment

---

- Get_Experiment_Details_by_ID
- Get experiment details. Optionally trim the response to only the fields you need:
  - `fields`: comma-separated list of field names to return (for example, `hypothesis,primaryMetrics`); omit to return all fields. Reduces context consumption by up to 95–99%.

---

- Get_Experiment_Overall_Results
- Retrieve experiment results/pulse data for a specific experiment.
  Analyze by:
  - `date`
  - `cuped`
  - `confidence`

---

- Get_Experiment_Metric_Dimension_Results
- Retrieve metric results for one experiment metric with dimensional
  breakdowns. Analyze by:
  - `date`
  - `cuped`
  - `confidence`

---

- Get_List_of_Experiments
- List all experiments in the project. Filter by:
  - `status`
  - `creatorName`
  - `tags`
  - `stale`

---

- Update_Experiment_Entirely
- Replace entire experiment configuration (Statsig removes any excluded data)

---

- GetExperimentSummaryCharts
- Retrieve summary charts for a specific experiment

---

- Get_Experiment_Version_History
- Retrieve the version history for an experiment

---

- Start_Experiment_Code_Cleanup
- Start the code cleanup process for an experiment after it has concluded
{% /table %}
{% /accordion %}

{% accordion title="Autotunes" %}

**Create_Autotune**: Create a new Autotune (multi-armed bandit) experiment. Describe the arms, success event, exploration/attribution windows, and winner threshold; the agent builds and creates the Autotune. Creates in draft by default; start the Autotune from the console to allocate traffic. Prompts for confirmation before creating.

{% /accordion %}

{% accordion title="Gates (Feature Flags)" %}
{% table %}

- Tool
- Description

---

- Create_Gate
- Create new gate/flag

---

- Get_Gate_Details_by_ID
- Get complete gate configuration details

---

- Get_Gate_Results
- Retrieve pulse/results for a specific gate rule.
  - `cuped`
  - `confidence`

---

- Get_List_of_Gates
- List all gates/flags. Filter by:
  - `type`
  - `creatorName`
  - `tags`

---

- Update_Gate_Entirely
- Replace entire gate setup with new rules and settings (Statsig removes any excluded data)

---

- Get_Gate_Version_History
- Retrieve the version history for a gate

---

- Start_Gate_Code_Cleanup
- Start the code cleanup process for a gate after it has concluded
{% /table %}
{% /accordion %}

{% accordion title="Layers" %}
{% table %}

- Tool
- Description

---

- Create_Layer
- Create a new layer

---

- Get_Layer_Details_by_ID
- Retrieve layer details, including parameters and metadata

---

- Get_List_of_Layers
- List all layers in the project

---

- Update_Layer_Entirely
- Replace the full layer configuration
{% /table %}
{% /accordion %}

{% accordion title="Metrics and Metric Sources" %}
{% table %}

- Tool
- Description

---

- Get_List_of_Metric_Sources
- List all metric sources in the project

---

- Get_List_of_Metrics
- List all metrics in the project. Filter by:
  - `showHiddenMetrics`
  - `tags`
  - `filters`

---

- Get_Metric_Definition_by_ID
- Get the full definition for a metric, including its type, source, and configuration details
{% /table %}
{% /accordion %}

{% accordion title="Parameter Stores" %}
{% table %}

- Tool
- Description

---

- Get_List_of_Param_Stores
- List all Parameter Stores in the project

---

- Get_Param_Store_Details_by_Id
- Retrieve details for a specific Parameter Store by ID

---

- Create_Param_Store
- Create a new Parameter Store and its parameters

---

- Update_Param_Store
- Update an existing Parameter Store, including adding or changing parameters

---

- Delete_Param_Store
- Delete a Parameter Store
{% /table %}
{% /accordion %}

{% accordion title="Segments" %}
{% table %}

- Tool
- Description

---

- Create_Segment
- Create a new segment. Supports `id_list`, `rule_based`, `analysis_list`, and `user_store_id_list` segment types

---

- Get_List_of_Segments
- List all segments in the project

---

- Get_Segment_by_ID
- Retrieve segment details

---

- Update_Segment
- Update an existing segment. Specifically:
  - Update rules for conditional segment types
  - Add IDs to user stores and ID lists
{% /table %}
{% /accordion %}

{% accordion title="Reviews" %}
{% table %}

- Tool
- Description

---

- Create_Gate_Review
- Create a review request for a gate change

---

- Edit_Gate_Review
- Edit an existing gate review request

---

- Approve_Gate_Review
- Approve a gate review request

---

- Reject_Gate_Review
- Reject a gate review request

---

- Commit_Gate_Review
- Commit an approved gate review, applying the change

---

- Cancel_Gate_Review
- Cancel a gate review request

---

- Get_Gate_Review_by_ID
- Retrieve a specific gate review by ID

---

- Get_List_of_Gate_Reviews
- List all reviews for a gate

---

- Get_Gate_Eligible_Reviewers
- List users eligible to review a gate change

---

- Create_Experiment_Review
- Create a review request for an experiment change

---

- Edit_Experiment_Review
- Edit an existing experiment review request

---

- Approve_Experiment_Review
- Approve an experiment review request

---

- Reject_Experiment_Review
- Reject an experiment review request

---

- Commit_Experiment_Review
- Commit an approved experiment review, applying the change

---

- Cancel_Experiment_Review
- Cancel an experiment review request

---

- Get_Experiment_Review_by_ID
- Retrieve a specific experiment review by ID

---

- Get_List_of_Experiment_Reviews
- List all reviews for an experiment

---

- Get_Experiment_Eligible_Reviewers
- List users eligible to review an experiment change

---

- Create_Autotune_Review
- Create a review request for an Autotune change

---

- Edit_Autotune_Review
- Edit an existing Autotune review request

---

- Approve_Autotune_Review
- Approve an Autotune review request

---

- Reject_Autotune_Review
- Reject an Autotune review request

---

- Commit_Autotune_Review
- Commit an approved Autotune review, applying the change

---

- Cancel_Autotune_Review
- Cancel an Autotune review request

---

- Get_Autotune_Review_by_ID
- Retrieve a specific Autotune review by ID

---

- Get_List_of_Autotune_Reviews
- List all reviews for an Autotune

---

- Get_Autotune_Eligible_Reviewers
- List users eligible to review an Autotune change
{% /table %}
{% /accordion %}

{% accordion title="Logs and Observability" %}
{% table %}

- Tool
- Description

---

- Query_Logs_Explorer
- Query the Logs Explorer for raw event data

---

- Cluster_Log_Patterns
- Cluster and summarize log patterns to surface recurring events and anomalies
{% /table %}
{% /accordion %}
{% /accordion-group %}

Need other functions? Statsig considers additions by request. Reach out in Slack.

## Use cases

The Statsig MCP server supports both `GET` and `POST` requests. Read-only users can connect and use all read tools. Write tools require an API key with write permissions. The Statsig MCP server is especially useful for:

- Repetitive tasks like cleaning up stale gates
- Summarizing console information in your IDE workflows
- Bulk creating or deleting gates, and making the necessary changes in your code

### Example prompt for stale gate cleanup

```
You are an expert, diligent Software engineer with the sole goal of reducing the amount of tech debt in the code base. This code base, making use of best practices, leverages feature gates liberally using Statsig. As gates complete their lifecycle in Statsig, they may end up "stale" which means that they're enabled, but no longer checked. Your job is to find these gates, and refactor the codebase to no longer check the gate (instead, changing the check to a constant value).

You should follow coding best practices:
- You should not simply replace gate calls with "True" or "False" but instead carefully trace the logic through to where it is used and change the behavior that way - adjusting the code in minor ways to make the default behavior what the value is that the gate was returning
- You should always strive to write minimal code - readable but terse, never longer than it needs to be
- You should never write comments or debug statements.

You should use the statsig-local MCP to list feature gates, then look for gates that are marked as stale. You should then grep the codebase for that feature flag name, and do a minimal rewrite of the code to no longer use Statsig, removing the checkGate call or similar. When you use the MCP use the get /console/v1/gates endpoint and parameters type="STALE" and limit =10. You should select only one gate to do this with, before stopping. If you cannot find the gate after a grep, try the next one you found using the MCP. Once you successfully remove a gate, return.
```
