The GrowthBook MCP Server is the first Model Context Protocol server built for feature management and experimentation. It lets you create feature flags, run A/B tests, and manage experiments directly from AI coding tools like Claude, Cursor, and VS Code.
No more switching between your IDE and GrowthBook’s dashboard. Ask Claude to wrap your new feature in a flag, and it handles both the code and the GrowthBook configuration.
Table of contents
Open Table of contents
What is MCP?
Model Context Protocol (MCP) is a standard that lets AI tools connect to external platforms. Instead of writing custom integration code for every service, AI assistants can use MCP servers as a universal interface.
GrowthBook’s MCP server was the first in the experimentation space. It formalises the connection between your AI coding assistant and GrowthBook’s feature flag and experimentation platform.
Why this matters
GrowthBook frames this around a specific problem: “Don’t let vibe coding become vibe shipping.”
When you’re using AI to write code quickly, it’s tempting to deploy without proper safeguards. The MCP server removes friction from adding feature flags, so there’s no excuse to skip them.
Instead of:
- Write code with AI
- Open GrowthBook dashboard
- Create feature flag
- Copy configuration back to code
- Deploy and hope
You get:
- Ask Claude to add the feature with a flag
- Deploy safely
The flag creation happens inline. Your AI assistant handles both the code changes and the GrowthBook setup simultaneously.
What you can do with it
The GrowthBook MCP Server includes 14 tools:
Feature flags
- Create new flags and insert them directly into your code
- Configure targeting rules (e.g., restrict to beta testers)
- Generate TypeScript type definitions
- Detect and remove stale rollouts
- List existing flags or retrieve specific ones
Experiments
- Create A/B tests from your IDE
- Link experiments to feature flags
- Retrieve experiment results (metadata, full data, or summaries)
Other tools
- Create SDK connections
- Manage environments and projects
- Search GrowthBook documentation without leaving your editor
Setting it up
You’ll need a GrowthBook account and an API key. Create one in Settings → API Keys → New Secret Key.
The server requires two environment variables:
GB_API_KEY— Your GrowthBook API key or Personal Access TokenGB_EMAIL— Your registered email address
Two optional variables:
GB_API_URL— Defaults tohttps://api.growthbook.ioGB_APP_ORIGIN— Defaults tohttps://app.growthbook.io
Claude Code setup
Add this to your Claude Code configuration:
{
"mcpServers": {
"growthbook": {
"command": "npx",
"args": ["-y", "@growthbook/mcp"],
"env": {
"GB_API_KEY": "your-api-key",
"GB_EMAIL": "your-email@example.com"
}
}
}
}
Claude Desktop setup
For Claude Desktop, add the same configuration to your claude_desktop_config.json file.
Cursor and VS Code
Both editors support MCP servers through their settings. The GrowthBook documentation includes direct installation links for Cursor.
For a complete walkthrough, watch the GrowthBook MCP setup video.
Practical examples
Adding a feature flag to new code:
“Wrap this new checkout flow in a feature flag called ‘new-checkout’ and set it to off by default”
Claude creates the flag in GrowthBook, generates the code to check it, and wraps your feature appropriately.
Setting up a beta test:
“Create a feature flag for the new dashboard that’s only visible to users with the beta-tester attribute”
The MCP server handles the targeting configuration in GrowthBook while Claude updates your code.
Checking experiment results:
“Show me the results for the pricing-page-test experiment”
Get experiment data without opening the GrowthBook dashboard.
Real-world applications
Campaign optimisation
Marketing agencies can rapidly test different creative variations across client campaigns. Instead of manually setting up each test, describe your experiment goals to your AI tool and have the setup handled automatically.
Landing page testing
Growth teams can quickly iterate on landing page elements—headlines, CTAs, form fields—without breaking their analytical workflow. Ask your AI assistant to create experiments and immediately discuss potential outcomes and statistical considerations.
Email marketing
Email marketers can test subject lines, send times, and content variations while staying focused on overall campaign strategy. The AI integration means less time on platform management and more time on creative thinking.
GrowthBook vs PostHog: MCP comparison
Both GrowthBook and PostHog offer MCP server support. Here’s how they compare:
| Feature | GrowthBook MCP | PostHog MCP |
|---|---|---|
| Feature Flag Management | Comprehensive | Comprehensive |
| A/B Testing | Advanced statistical analysis | Integrated with product analytics |
| Marketing Focus | Strong experimentation features | Product-analytics focused |
| Setup Complexity | Straightforward | Moderate |
GrowthBook excels for teams focused primarily on experimentation, while PostHog provides broader product analytics alongside experimentation features.
The bigger picture
This is part of a broader shift in how developers interact with external services. MCP servers turn dashboard-based tools into conversational interfaces.
For teams using AI coding assistants heavily, having feature flags accessible through the same interface reduces the temptation to skip them. When adding a flag is as easy as asking for it, there’s less friction between “move fast” and “ship safely.”
The GrowthBook MCP Server is open source on GitHub and works with any MCP-compatible client.