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 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. |
GB_USER | Required | The name attached to any created 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 . |
GrowthBook Cloud users only need to configure GB_API_KEY
and GB_USER
.
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_USER": "YOUR_NAME"
}
}
}
}
{
"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_USER": "YOUR_NAME"
}
}
}
}
{
"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_USER": "YOUR_NAME"
}
}
}
}
{
"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"
}
}
}
}
- 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_USER": "YOUR_NAME"
}
}
}
}
{
"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_USER": "YOUR_NAME"
}
}
}
}
{
"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_USER": "YOUR_NAME"
}
}
}
}
{
"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"
}
}
}
}
- 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 Desktop
- Open Settings → Developer
- Click Edit Config
- Open
claude_desktop_config.json
- Add the following configuration:
- 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_USER": "YOUR_NAME"
}
}
}
}
{
"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_USER": "YOUR_NAME"
}
}
}
}
{
"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_USER": "YOUR_NAME"
}
}
}
}
{
"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"
}
}
}
}
- 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!

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.
Documentation Search
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:
- 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