# Statsig MCP

> Statsig connects feature flagging and experimentation directly to your AI agent. Test product rollouts, manage dynamic configurations, and log custom events—all through natural conversation. Instead of writing code or jumping between dashboards, you ask your agent about a user's gate status or fetch an experiment's JSON settings immediately.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** feature-flags, ab-testing, product-experimentation, dynamic-config, statsig

## Description

Managing feature flags used to mean living in a separate UI for every single check. Now, you can talk to your AI client and have it handle the complexity of product experimentation. Ask your agent if 'dark_mode_v2' is enabled for user 123, or ask it to fetch the configuration values for an active experiment. You don't need to remember which API key goes where; you just describe what you want done.

This MCP lets developers and PMs verify evaluation logic right from their chat window. Need to create a new feature flag? Just tell your agent, and it handles the setup using its management tools. If you spot an interesting metric during testing, simply ask your agent to log a custom event for real-time analytics. Because Vinkius hosts this MCP, connecting it is easy—you link once from any compatible client, and suddenly, product experimentation is just another conversation.

## Tools

### check_gate
Evaluates if one or more feature gates are enabled for a specific user.

### create_dynamic_config
Creates an entirely new dynamic configuration within the Statsig project.

### create_gate
Establishes a brand-new feature gate for use in product rollouts.

### delete_gate
Removes an existing, unused feature gate from the project entirely.

### get_config
Fetches configuration values for a specific dynamic config or experiment type.

### get_dynamic_config
Reads and returns the details of an existing dynamic configuration.

### get_gate
Retrieves all information about a specific, named feature gate.

### get_layer
Fetches parameter values from a user's layer to show how the evaluation works for that user.

### list_dynamic_configs
Provides an index of every dynamic configuration currently set up in your project.

### list_gates
Lists all feature gates that exist within the current Statsig project.

### log_event
Logs custom events, allowing you to track specific user actions for analytics purposes.

### update_gate
Modifies the settings or description of an existing feature gate.

## Prompt Examples

**Prompt:** 
```
Check if the gate 'new_checkout_flow' is enabled for user 'user_99'.
```

**Response:** 
```
I've checked the gate 'new_checkout_flow' for user 'user_99'. The gate is currently **Open** (True).
```

**Prompt:** 
```
List all feature gates in my Statsig project.
```

**Response:** 
```
I've retrieved the list of gates. You have 3 active gates: 'ai_beta_access', 'dark_mode_v2', and 'new_checkout_flow'.
```

**Prompt:** 
```
Create a new feature gate named 'mobile_redesign' with description 'Testing new UI'.
```

**Response:** 
```
The feature gate 'mobile_redesign' has been successfully created in your project.
```

## Capabilities

### Validate Feature Status
Checks if one or more feature flags are enabled for a specific user.

### Manage Experiment Settings
Creates, updates, and deletes feature gates, allowing you to control product access without code changes.

### Retrieve Dynamic Configurations
Fetches specific JSON configurations or lists all available dynamic settings for an experiment.

### Inspect User Layers
Retrieves parameter values from a user's layer to understand how the feature evaluation works.

### Track Usage Metrics
Logs custom events directly for generating analytics and calculating metrics.

## Use Cases

### Validating an A/B Test for Marketing
A Product Manager needs to know if a new landing page variant ('redesign') is live. They ask the agent, 'What's the status of the redesign gate for user X?' The agent runs `check_gate` and confirms its status (True/False), letting them greenlight the launch immediately.

### Debugging a Broken Feature in Code
A Developer finds a bug related to settings. They ask the agent to fetch the configuration for 'payment_gateway' using `get_dynamic_config`. This returns the exact JSON they need, letting them fix the issue without searching through old documentation.

### Tracking User Funnel Drop-off Points
A Data Scientist suspects a specific user action is failing. They ask the agent to `log_event` when that failure point is hit, tagging it with context. This creates a clean data stream for metric calculation.

### Onboarding a New Team Member
A new PM needs to see all available features for the project. They ask the agent to `list_gates`, which instantly provides them with a comprehensive list of every flag and gate that exists, letting them start planning right away.

## Benefits

- You can check a user's access status immediately. Instead of navigating to the Statsig UI, asking your agent to run `check_gate` tells you instantly if 'new_checkout_flow' is active for that specific user.
- Product changes are controlled directly via chat. Use `create_gate` or `update_gate` to manage feature flags and gates without needing a developer pull request just to flip a switch.
- Configuration data comes straight to your agent. If you need the settings for an experiment, calling `get_config` pulls the JSON structure so your workflow can consume it instantly.
- Monitoring happens in conversation. Use `log_event` when testing to send custom events that feed into your analytics dashboard, keeping track of every action without extra logging code.
- You can build out a complete picture of user behavior. By using `get_layer`, you inspect the underlying parameters, which helps data scientists validate if their metric collection is working correctly.

## How It Works

The bottom line is you talk to your AI client about product logic, and it handles all the API calls behind the scenes.

1. First, subscribe to this MCP in Vinkius and provide your Statsig Server Secret Key and Console API Key.
2. Next, tell your agent the exact task you need—for instance, 'List all feature gates' or 'Check gate X for user Y'.
3. Your agent executes the request through the tools, pulling back structured data (like True/False status or JSON configs) directly into the chat.

## Frequently Asked Questions

**How do I use Statsig MCP to check if a gate is active?**
You ask your agent to run the `check_gate` tool and provide the specific feature name and user ID. The agent evaluates the flag using the secret key and tells you the status (True/False).

**Can I use Statsig MCP to create new features?**
Yes, you can manage your flags directly. Use `create_gate` or `update_gate` when you need to establish a feature flag or modify an existing one's settings.

**What is the difference between dynamic configs and gates in Statsig MCP?**
Gates control whether a feature can be used at all. Dynamic configs store flexible data, like API keys or UI colors, that the feature uses once it's active.

**If I need to track user actions, which tool do I use in Statsig MCP?**
You use `log_event`. This tool lets you send custom events for analytics. You tell the agent what action happened and when it occurred.

**Does Statsig MCP require specific keys to run?**
Yes, the setup requires your Statsig Server Secret Key for evaluation tools (like `check_gate`) and your Console API Key for management tasks (like `create_gate`).