developer-toolsapi_key

Statsig

Statsig provides server-side feature gate evaluation, dynamic configuration, experimentation, and event measurement APIs.

Verdict

Statsig's MCP lets your team check feature flags, pull experiment configs, and log analytics events without leaving a Switchy Project. @mention it to evaluate gates for specific users, fetch dynamic config values mid-conversation, or rank variants in a contextual bandit. Engineers use it to debug rollouts in chat; PMs use it to check experiment assignments before writing a spec. The MCP reads flag state and writes event logs — it won't create gates or change targeting rules, so you'll still configure experiments in Statsig's dashboard.

Common use cases

  • Debug why a feature flag returned false for a user
  • Fetch experiment parameters during a product review
  • Log custom events from support conversations
  • Rank bandit variants before writing copy
  • Check gate status across multiple environments

Integration

Vendor
Statsig
Category
developer-tools
Auth
API_KEY
Tools
7
Composio slug
statsig

Tools

  • Check Feature Gate

    Evaluate one Statsig feature gate with optional user context without logging an exposure. A false result can mean either that the context fails the gate or that the gate name does not exist.

  • Check Feature Gates

    Evaluate multiple Statsig feature gates with optional shared user context without logging exposures. Results are keyed by gate name; a false result does not prove that a gate exists.

  • Get Dynamic Config

    Evaluate a Statsig dynamic config or experiment with optional user context and return its value and assignment metadata without logging an exposure. A missing name returns an empty value object.

  • Get Layer

    Evaluate a Statsig layer with optional user context and return its parameter values and assignment metadata without logging an exposure. A missing layer is reported as not found.

  • Get Ranked Variants

    Rank variants for a Statsig contextual-bandit Autotune configuration using optional user context without logging an exposure.

  • Log Custom Exposures

    Permanently log one or more Statsig gate, experiment, or dynamic-config exposures when automatic exposure logging is not being used. Acknowledged exposures cannot be deleted through the runtime API.

  • Log Events

    Permanently log one or more custom Statsig events for analytics and metric calculation in a single batch. Acknowledged events cannot be deleted through the runtime API.

Setup

Setup guide

  1. 11. In Switchy, open your workspace settings and click Integrations. 2. Find Statsig in the developer tools section and click Connect. 3. You'll be prompted for a Statsig Server Secret Key — generate one in your Statsig console under Project Settings > Keys & Environments (choose the environment you want Switchy to query). 4. Paste the key into Switchy and click Authorize. 5. Switchy confirms the connection and lists the seven available tools. 6. Open any Project, type '@Statsig check the launch_v2_ui gate for user ID 12345' and send — if the MCP replies with a boolean result, the connection works. 7. You can now invoke any tool by @mentioning Statsig and describing the gate, config, or event you need.

What teammates see: by default, memories from Statsig are scoped to the Project (PROJECT visibility) - you can mark any memory PRIVATE or share it ORG-wide.

Works well with

Top models

Compatibility data appears once enough Projects have used this MCP together with a given model.

How Switchy teams use it

Not enough Projects yet to publish anonymised usage stats (we require ≥ 50 Projects per week).

Starter prompts

Check User Gate

@Statsig check the new_checkout_flow gate for user ID 78392. Return true or false and explain why the result matters for this user.

Pull Experiment Config

@Statsig get the homepage_layout dynamic config for user ID 54321. Show me the assigned variant and all parameter values.

Rank Bandit Variants

@Statsig rank variants for the promo_banner_autotune config with user ID 99001. List the top three variants in order.

Log Custom Event

@Statsig log a custom event named 'support_ticket_resolved' with user ID 44556, metadata ticket_id=TKT-9988, and value 1. Confirm it was logged.

Batch Check Gates

@Statsig check gates new_onboarding, dark_mode, and premium_features for user ID 12000. Return a table showing which are enabled.

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

@statsig check the 'new_checkout_flow' feature gate for user ID 'usr_42' with country set to 'US'

Output

The feature gate 'new_checkout_flow' evaluates to **true** for user 'usr_42' in the US context. This gate is currently enabled for 15% of US users as part of the checkout-redesign experiment running through March 2025. The evaluation used rule set version 1.2.4 and matched the 'us_early_adopters' targeting segment. No exposure was logged by this check.

Notes

This read-only check is ideal for debugging gate behavior before committing to log an exposure. Note that a 'false' result is ambiguous—it could mean the user failed targeting rules or that the gate name doesn't exist in your Statsig project. Always verify gate names in the Statsig console first.

Prompt

@statsig log a custom event named 'checkout_completed' for user 'usr_42' with value 149.99 and metadata including cart size and payment method

Output

Successfully logged the 'checkout_completed' event to Statsig. The event includes user ID 'usr_42', numeric value $149.99, and metadata fields 'cart_size: 3' and 'payment_method: credit_card'. This event is now permanently recorded and will appear in your Statsig metrics dashboard within 2-5 minutes. It can be used to calculate conversion rates, revenue metrics, and experiment impact analysis.

Notes

Logged events are **permanent and cannot be deleted** via the runtime API. Use this for production analytics only—test events will pollute your metrics. Ensure your API key has write permissions and that event names match your metric definitions exactly, as Statsig is case-sensitive.

Prompt

@statsig get the 'recommendation_algorithm' dynamic config for user 'usr_42', then explain which ranking strategy I should use based on the returned parameters

Output

The 'recommendation_algorithm' config for user 'usr_42' returns: `{"strategy": "collaborative_filtering", "min_score": 0.65, "max_results": 20}`. Based on these parameters, you should use **collaborative filtering** as your ranking strategy, filtering recommendations to those with a similarity score of at least 0.65 and capping the result set at 20 items. This configuration is part of the 'rec_algo_test' experiment, currently in the treatment group 'cf_optimized'.

Notes

This example combines Statsig's config retrieval with AI reasoning to interpret the parameters. Dynamic configs return empty objects if the name doesn't exist, so always validate the response structure. No exposure is logged here—call Log Custom Exposures separately if you need attribution for experiment analysis.

Use-case deep-dives

Beta rollout for SaaS product team

When Statsig beats homegrown flags for gradual feature launches

A 6-person SaaS team shipping a redesigned billing flow needs to gate the feature behind a flag and roll it out to 10% of paid users first. The Check Feature Gate tool evaluates the flag without logging an exposure, so the team can test the gate logic in CI without polluting analytics. Once live, they use Log Custom Exposures to track which users actually saw the new flow, feeding Statsig's experiment dashboard. The dynamic config tool lets them tweak copy or thresholds without redeploying. This setup works when you have distinct user segments and want to measure conversion lift. If your product has fewer than 500 active users or you only ship once a quarter, a boolean environment variable is simpler. Use Statsig when you need per-user targeting and real-time rollback.

Support team knowledge-base routing

How layers route support tickets to the right help article

A 12-person support org uses Statsig layers to route incoming tickets to different knowledge-base articles based on user plan, region, and issue type. The Get Layer tool evaluates the routing rules and returns the article ID and metadata without logging an exposure until the agent actually opens the article. This keeps analytics clean: only real views count. The team updates layer parameters in Statsig's console to adjust routing weights as new articles go live. The ranked-variants tool could handle A/B tests on article headlines, but the support team hasn't needed that yet. This approach wins when you have more than 50 articles and routing logic changes weekly. If your knowledge base is under 20 articles or routing is static, a hardcoded lookup table is faster. Choose Statsig when routing rules are a product surface, not a config file.

Mobile app onboarding experiment

When dynamic configs beat hardcoded onboarding for mobile teams

A 4-person mobile team runs onboarding experiments on their iOS app and needs to change screen order, button copy, and illustration assets without waiting for App Store review. The Get Dynamic Config tool fetches the current experiment variant and returns a JSON blob with screen definitions. The team logs events with Log Events to track drop-off at each step, feeding Statsig's funnel reports. The API-key auth means the mobile client can call Statsig directly without a backend proxy. This setup works when you ship experiments faster than you ship app updates. If your onboarding flow is stable or you only test once per quarter, baking the flow into the app binary is simpler. Use Statsig when experiment velocity matters more than client-side bundle size.

Frequently asked

What does the Statsig MCP do in Switchy?

It lets AI agents check feature flags, pull experiment configs, and log custom events directly in Statsig without writing code. Agents can evaluate gates for specific users, fetch dynamic config values, rank autotune variants, and send analytics events — all through natural language. You skip the SDK boilerplate and get real-time feature-flag decisions inside your AI workflows.

Do I need a Statsig server secret key or client key?

You need a Statsig server secret key. The MCP uses server-side evaluation APIs, which require the secret key to check gates and log exposures. Client keys won't work because they're scoped to browser SDKs. Generate a server secret in your Statsig project settings under API Keys, then paste it into Switchy's auth form.

Can the MCP automatically log exposures when checking a gate?

No. Every tool in this MCP evaluates gates and configs without logging exposures by default. If you want exposure events in Statsig's analytics, you must explicitly call Log Custom Exposures after the check. This gives you control over when exposure data is recorded, but it means two-step workflows for most feature-flag decisions.

How is this different from calling Statsig's REST API directly?

The MCP wraps Statsig's server evaluation endpoints so agents can check flags in plain English instead of constructing JSON payloads. You lose nothing — the same gates, configs, and user context are available — but you gain the ability to say "check the new-checkout gate for user 12345" without writing curl commands or handling auth headers manually.

Who on my team should connect the Statsig MCP?

Whoever owns your Statsig project and can generate server secret keys. Typically that's a backend engineer or DevOps lead. Once connected, anyone in your Switchy workspace can ask agents to check flags or log events, but the initial setup requires admin access to Statsig's API key settings.

More developer tools MCPs

See all developer tools MCPs →

Data last verified 61 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.