Statsig MCP Server
Model Context Protocol server for Statsig feature flags and experimentation platform.
This MCP server enables AI assistants to interact with Statsig's Console API for comprehensive feature management and experimentation platform administration.
Features
- 🚩 Feature Gate Management: Create, read, update, and delete feature gates
- ⚙️ Dynamic Configuration Management: Full CRUD operations for dynamic configs
- 🧪 Experiment Management: Create, read, update, and delete experiments
- 👥 Segment Management: Create and manage user segments
- 📊 Metrics Access: View and analyze platform metrics
- 📈 Audit Logs: Track changes and access audit trail
- 🎯 Target Apps: Manage target applications
- 🔑 API Key Management: List and manage API keys
- 👤 Team Management: List team users and get user details by email
- 📋 Event Querying: List available event types in your project
Installation
Using uv (Recommended)
Using pip
Quick Start
1. Get Your Console API Key
- Go to Statsig Console
- Navigate to Project Settings → Keys & Environments
- Copy your Console API Key (not the client or server key)
2. Run the Server
With uv (Recommended):
With Python:
3. Configuration Options
The server supports both command-line arguments (recommended for MCP) and environment variables:
Command-Line Arguments (MCP Best Practice)
Argument | Type | Default | Description |
---|---|---|---|
--api-key | string | None | Statsig Console API key (required) |
--environment | string | development | Environment tier |
--api-timeout | int | 3000 | API timeout in milliseconds |
--disable-logging | flag | false | Disable event logging to Statsig |
--debug | flag | false | Enable debug logging |
Environment Variables (Fallback)
Variable | Description |
---|---|
STATSIG_CONSOLE_API_KEY | Statsig Console API key |
STATSIG_ENVIRONMENT | Environment tier |
STATSIG_API_TIMEOUT | API timeout in milliseconds |
STATSIG_DISABLE_LOGGING | Disable logging (true/false) |
STATSIG_DEBUG | Enable debug mode (true/false) |
4. MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json
:
Alternative with Environment Variables
5. Test with MCP Inspector
Available Tools
The server provides 27 Console API tools organized by resource type:
Feature Gates Management
list_gates
: List all feature gatesget_gate
: Get details of a specific feature gatecreate_gate
: Create a new feature gateupdate_gate
: Update an existing feature gatedelete_gate
: Delete a feature gate
Experiments Management
list_experiments
: List all experimentsget_experiment
: Get details of a specific experimentcreate_experiment
: Create a new experimentupdate_experiment
: Update an existing experimentdelete_experiment
: Delete an experiment
Dynamic Configs Management
list_dynamic_configs
: List all dynamic configsget_dynamic_config
: Get details of a specific dynamic configcreate_dynamic_config
: Create a new dynamic configupdate_dynamic_config
: Update an existing dynamic configdelete_dynamic_config
: Delete a dynamic config
Segments Management
list_segments
: List all segmentsget_segment
: Get details of a specific segmentcreate_segment
: Create a new segment
Analytics & Monitoring
list_metrics
: List all metricsget_metric
: Get details of a specific metriclist_audit_logs
: List audit logs with optional date filtering
Platform Management
list_target_apps
: List all target appsget_target_app
: Get details of a specific target applist_api_keys
: List all API keys
Team & Events
list_team_users
: List all team membersget_user_by_email
: Get team member info by emailquery_events
: Query event types and details
Example Usage
Create a Feature Gate
Development
Setup Development Environment
Using uv (Recommended):
Using pip:
Running Commands
With uv
, you can run any command in the virtual environment:
Project Structure
Architecture
This MCP server uses a hybrid approach with three Statsig APIs:
- Console API (
https://statsigapi.net/console/v1/*
) - For project management (team users, event types) - HTTP API (
https://api.statsig.com/v1/*
) - For real-time feature checks (gates, configs, experiments, layers) - Events API (
https://events.statsigapi.net/v1/*
) - For direct event logging
This approach provides the best balance of functionality and performance, allowing both management operations and real-time feature evaluation.
Security Notes
- Never expose your Statsig Console API key in client-side code
- Use command-line arguments or environment variables for API keys
- The Console API key provides full access to your Statsig project
- Consider using separate API keys for different environments
- Console API keys are different from client keys and server secret keys
Requirements
- Python 3.10+
- uv (recommended) or pip for package management
Troubleshooting
Common Issues
- "API key not found" error: Ensure
--api-key
is provided orSTATSIG_CONSOLE_API_KEY
is set - Network timeouts: Increase timeout with
--api-timeout 5000
- Feature gate not found: Verify the gate name exists in your Statsig console
- Python version error: This package requires Python 3.10+ (MCP requirement)
- Wrong API key type: Make sure you're using a Console API key, not a client or server key
Debug Mode
Enable debug logging for troubleshooting:
Help
Get help with command-line options:
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run tests and linting:
uv run pytest && uv run ruff check
- Submit a pull request
Resources
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI assistants to interact with Statsig's feature management and experimentation platform, allowing them to check feature flags, retrieve configurations, get experiment assignments, and log events.
- Features
- Installation
- Quick Start
- Available Tools
- Create server parameters with flags (recommended)
- Clone and setup
- Install all dependencies including dev tools
- Run tests
- Format code
- Type checking
- Linting
- Install in development mode with dev dependencies
- Run tests
- Format code
- Type checking
- Run the server with flags
- Run tests with verbose output
- Run validation script
- Format and lint
- With command-line flag (recommended)
- With environment variable
Related MCP Servers
- AsecurityAlicenseAqualityEnables AI assistants to control SwitchBot devices, providing functionalities like device management, scene execution, and sensor information monitoring through the SwitchBot API.Last updated -3JavaScriptISC License
- -securityFlicense-qualityEnables AI assistants to interact with Metabase databases and dashboards, allowing users to list and execute queries, access data visualizations, and interact with database resources through natural language.Last updated -25JavaScript
- -securityFlicense-qualityEnables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.Last updated -JavaScript
StarRocks MCP Serverofficial
AsecurityAlicenseAqualityActs as a bridge between AI assistants and StarRocks databases, allowing for direct SQL execution and database exploration without requiring complex setup or configuration.Last updated -577PythonApache 2.0