Skip to main content

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.

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 SettingsAPI KeysNew 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 NameStatusDescription
GB_API_KEYRequiredA GrowthBook API key.
GB_USERRequiredThe name attached to any created flags.
GB_API_URLOptionalYour GrowthBook API URL. Defaults to https://api.growthbook.io.
GB_APP_ORIGINOptionalYour GrowthBook app URL Defaults to https://app.growthbook.io.

tip

GrowthBook Cloud users only need to configure GB_API_KEY and GB_USER.

Cursor

  1. Open Cursor SettingsMCP
  2. Click Add new global MCP server
  3. Add an entry for the GrowthBook MCP, following the pattern below:
{
"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_USER": "YOUR_NAME"
}
}
}
}
  1. Save the settings.

You should now see a green active status after the server successfully connects!

GrowthBook MCP in Cursor

VS Code

  1. Open User Settings (JSON)
  2. Add an MCP entry:
{
"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_USER": "YOUR_NAME"
}
}
}
}
  1. 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.

GrowthBook MCP in VS Code Copilot

Claude Desktop

  1. Open SettingsDeveloper
  2. Click Edit Config
  3. Open claude_desktop_config.json
  4. Add the following configuration:
{
"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_USER": "YOUR_NAME"
}
}
}
}
  1. Save the config and restart Claude

A hammer icon will appear in the chat window, indicating that your GrowthBook MCP server is connected and available for use!

GrowthBook MCP in Claude

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 all feature flags in your GrowthBook instance.
  • get_single_feature_flag: Fetch details for a specific feature flag by ID.
  • get_stale_safe_rollouts: List all 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 all experiments in GrowthBook.
  • get_experiment: Fetch details for a specific experiment by ID.
  • get_attributes: List all user attributes tracked in GrowthBook (useful for targeting).

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 all SDK connections (how GrowthBook connects to your apps).
  • create_sdk_connection: Create a new SDK connection for your app, specifying language and environment.
  • search_growthbook_docs: Search the GrowthBook documentation for information on how to use a feature, by keyword or question.

Next steps

Now that you're connected, start using GrowthBook's MCP tools directly from your editor to:

Join our community Slack for additional tips and tricks