GrowthBook MCP server

Enables AI to manage feature flags, experiments, environments, and SDK connections in GrowthBook, providing tools for searching documentation, creating targeting rules, and generating implementation code for various programming languages.
Back to servers
Setup instructions
Provider
GrowthBook
Release date
May 20, 2025
Stats
10 stars

The GrowthBook MCP server allows you to interact with GrowthBook features directly from your LLM client. You can manage feature flags, view experiments, and perform other GrowthBook operations without switching contexts.

Installation

To use the GrowthBook MCP server, you'll need to configure it with the appropriate environment variables and add it to your LLM client.

Required Environment Variables

Variable Name Status Description
GB_API_KEY Required A GrowthBook API key
GB_USER Required Your name (used when creating feature flags)
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)

Setting Up in Cursor

  1. Open Cursor SettingsMCP
  2. Click Add new global MCP server
  3. Add an entry for the GrowthBook MCP using this configuration:
{
  "mcpServers": {
    "growthbook": {
      "command": "npx",
      "args": ["-y", "@growthbook/mcp"],
      "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 and verify you see a green active status

Setting Up in VS Code

  1. Open User Settings (JSON)
  2. Add the MCP entry:
 "mcp": {
    "servers": {
      "growthbook": {
        "command": "npx",
        "args": [
          "-y", "@growthbook/mcp"
        ],
        "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

Setting Up in 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"],
      "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
  2. Look for a hammer icon in the chat window indicating a successful connection

Available Tools

Feature Flag Management

  • create_feature_flag: Create new feature flags with specified key, type, default value, and 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
  • create_force_rule: Create a feature flag with a targeting condition
  • generate_flag_types: Generate types for feature flags

Experiment Management

  • 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
  • create_experiment: Create a feature-flag based experiment

Environment Management

  • get_environments: List all environments configured in GrowthBook

Project Management

  • get_projects: List all projects in your GrowthBook instance

SDK Connection Management

  • get_sdk_connections: List all SDK connections
  • create_sdk_connection: Create a new SDK connection for your app

Documentation

  • search_growthbook_docs: Search the GrowthBook documentation by keyword or question

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "growthbook" '{"command":"npx","args":["-y","@growthbook/mcp"],"env":{"GB_API_KEY":"YOUR_API_KEY","GB_API_URL":"YOUR_API_URL","GB_APP_ORIGIN":"YOUR_APP_ORIGIN","GB_USER":"YOUR_NAME"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "growthbook": {
            "command": "npx",
            "args": [
                "-y",
                "@growthbook/mcp"
            ],
            "env": {
                "GB_API_KEY": "YOUR_API_KEY",
                "GB_API_URL": "YOUR_API_URL",
                "GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
                "GB_USER": "YOUR_NAME"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "growthbook": {
            "command": "npx",
            "args": [
                "-y",
                "@growthbook/mcp"
            ],
            "env": {
                "GB_API_KEY": "YOUR_API_KEY",
                "GB_API_URL": "YOUR_API_URL",
                "GB_APP_ORIGIN": "YOUR_APP_ORIGIN",
                "GB_USER": "YOUR_NAME"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later