Official GrowthBook MCP Server
Model Context Protocol (MCP) is a standard for integrating AI tools and agents with developer platforms like GrowthBook. This guide shows you how to connect your AI tools to GrowthBook's MCP server and which tools are available for use.
Check us out on the official MCP Registry
Prerequisites
- Node.js: Check if you have it by running
node -v. Install it from nodejs.org - GrowthBook API Key: To create a new key, go to Settings → API Keys → New Secret Key. Use this key in the next step.
Installation
We cover how to connect the GrowthBook MCP server for the most popular tools below, but the installation steps are similar for most AI tools.
Configuration includes 4 environment variables. Here's what they mean:
| Variable Name | Status | Description |
|---|---|---|
| GB_API_KEY | Required | A GrowthBook API key or PAT. When using a PAT, you can only access tools that your permissions allow. |
| GB_EMAIL | Required | Your email address used with GrowthBook. Used when creating feature flags and experiments. |
| GB_API_URL | Optional | Your GrowthBook API URL. Defaults to https://api.growthbook.io. |
| GB_APP_ORIGIN | Optional | Your GrowthBook app URL Defaults to https://app.growthbook.io. |
You only need to configure GB_API_KEY and GB_EMAIL.
Cursor
- Open Cursor Settings → MCP
- Click Add new global MCP server
- Add an entry for the GrowthBook MCP, following the pattern below:
- macOS
- Windows
- WSL
- Linux
{
"mcpServers": {
"growthbook": {
"command": "npx",
"args": ["-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
{
"mcpServers": {
"growthbook": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
{
"mcpServers": {
"growthbook": {
"command": "wsl",
"args": ["npx", "-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
{
"mcpServers": {
"growthbook": {
"command": "npx",
"args": ["-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
- Save the settings.
You should now see a green active status after the server successfully connects!

VS Code
- Open User Settings (JSON)
- Add an MCP entry:
- macOS
- Windows
- WSL
- Linux
{
"servers": {
"growthbook": {
"command": "npx",
"args": ["-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
{
"servers": {
"growthbook": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
{
"servers": {
"growthbook": {
"command": "wsl",
"args": ["npx", "-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
{
"servers": {
"growthbook": {
"command": "npx",
"args": ["-y", "@growthbook/mcp@latest"],
"env": {
"GB_API_KEY": "YOUR_API_KEY",
"GB_API_URL": "YOUR_API_URL",
"GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
"GB_EMAIL": "YOUR_EMAIL"
}
}
}
}
- Save your settings. In your file, a Start button will appear. Click it to the start the server.
In CoPilot Chat, you'll see a tool icon, indicating the server is connected successfully. GrowthBook MCP is now ready to use in VS Code.

Claude Code
Claude Code uses command-line commands to add MCP servers. Run the following command in your terminal:
claude mcp add --transport stdio --env GB_API_KEY=YOUR_API_KEY --env GB_API_URL=YOUR_API_URL --env GB_APP_ORIGIN=YOUR_APP_ORIGIN --env GB_EMAIL=YOUR_EMAIL growthbook -- npx -y @growthbook/mcp@latest
All options (--transport, --env, etc.) must come before the server name. The -- (double dash) separates the server name from the command and arguments that get passed to the MCP server.
You can verify the server was added by running:
claude mcp get growthbook
To see all configured MCP servers, use:
claude mcp list
Within Claude Code, you can check server status using the /mcp command.
Claude Desktop
We have an official extension in the Connectors Directory.
- Go to Settings → Extensions → Browse Extensions
- Select Desktop Extensions and search for "GrowthBook"
- Follow the prompts to install and configure the extension
- That's it!
Claude Desktop ships with its own version of Node, which means it's not required here
Tools
Feature Flags
create_feature_flag: Create, add, or wrap an element with a feature flag. Accepts key, type, default value, and other metadata.get_feature_flags: List feature flags in your GrowthBook instance.get_single_feature_flag: Fetch details for a specific feature flag by ID.get_stale_safe_rollouts: List safe rollout rules that have been rolled back or released. This tools is helpful for removing stale flags from your codebase.create_force_rule: Create a feature flag with a targeting condition (e.g.,country = CA).generate_flag_types: Generate TypeScript types for feature flags.
Experiments
get_experiments: List experiments in GrowthBook.- This tool has 3 modes:
metadata: The default response from the GrowthBook API, including basic information about experiments.full: Metadata about experiments plus results. Warning: This returns a large payload, which fills up the context window quickly.summary: Presents a high-level summary of experiments and their results, combining experiment metadata, results, and metrics.
- This tool has 3 modes:
get_experiment: Fetch details for a specific experiment by ID. (Supportsmetadataandfullmodes. See above for details.)get_attributes: List user attributes tracked in GrowthBook (useful for targeting).create_experiment: Creates a feature-flag linked experiment. Note that this tool callsget_defaults, which provides a sampling of previous experiments to help the AI agent create the experiment correctly. For better performance, these defaults are saved to the local file system and periodically updated.get_defaults: Get default values for experiments including hypothesis, description, datasource, and assignment query. (Runs automatically when the create experiment tool is called.)create_defaults: Set custom default values for experiments that will be used when creating new experiments.clear_user_defaults: Clear user-defined defaults and revert to automatic defaults.
Environments
get_environments: List all environments (e.g., production, staging) configured in GrowthBook.
Projects
get_projects: List all projects in your GrowthBook instance.
SDK Connections
get_sdk_connections: List SDK connections (how GrowthBook connects to your apps).create_sdk_connection: Create a new SDK connection for your app, specifying language and environment.
Metrics
get_metrics: List fact and legacy metrics (useful for better understanding experiments).get_metric: Fetch a specific fact or legacy metric by ID.
Documentation Search
search_growthbook_docs: Search the GrowthBook documentation for information on how to use a feature, by keyword or question.
Video Tutorial
Watch this video for a complete walkthrough of setting up and using the GrowthBook MCP Server:
Next steps
Now that you're connected, start using GrowthBook's MCP tools directly from your editor to:
- Add new flags to your code and GrowthBook
- Generate type definitions for your flags for typesafe feature flagging
- Remove stale flags from your code automatically
- Search the GrowthBooks docs without leaving the editor
- Check out the GrowthBook MCP Server code on GitHub