Skip to main content
Glama
GrowthBook MCP Server

GrowthBook MCP Server

Official
by growthbook

GrowthBook MCP 服务器

借助 GrowthBook MCP 服务器,您可以直接从 LLM 客户端与 GrowthBook 进行交互。查看实验详情、添加功能标记等等。

设置

环境变量使用以下环境变量来配置 MCP 服务器。

变量名称

地位

描述

GB_API_密钥

必需的

GrowthBook API 密钥。

GB_用户

必需的

您的姓名。用于创建功能标记。

GB_API_URL

选修的

您的 GrowthBook API URL。默认为https://api.growthbook.io 。

GB_APP_ORIGIN

选修的

您的 GrowthBook 应用程序 URL 默认为https://app.growthbook.io 。

请参阅以下说明,了解如何将 MCP 服务器添加到客户端。任何支持 MCP 的客户端都兼容。请参阅其文档,了解如何添加服务器。

光标

  1. 打开游标设置→ MCP

  2. 点击添加新的全局 MCP 服务器

  3. 按照以下模式为 GrowthBook MCP 添加一个条目:

{
  "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. 保存设置。

服务器成功连接后,您应该看到绿色的活动状态!

VS 代码

  1. 打开用户设置 (JSON)

  2. 添加 MCP 条目:

 "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. 保存您的设置。

GrowthBook MCP 现在可以在 VS Code 中使用。

克劳德桌面

  1. 打开“设置” → “开发者”

  2. 单击编辑配置

  3. 打开claude_desktop_config.json

  4. 添加以下配置:

{
  "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. 保存配置并重启 Claude

聊天窗口中应该会出现一个锤子图标,表明您的 GrowthBook MCP 服务器已连接并可用!


Related MCP server: langfuse-mcp

工具

  • 功能标志

    • create_feature_flag :创建、添加或使用功能标志包装元素。指定键、类型、默认值和元数据。

    • get_feature_flags :列出 GrowthBook 实例中的所有功能标志。

    • get_single_feature_flag :通过 ID 获取特定功能标志的详细信息。

    • get_stale_safe_rollouts :列出所有已回滚或发布的安全推出规则。

    • create_force_rule :创建具有定位条件的功能标志。

    • generate_flag_types :生成功能标志的类型

  • 实验

    • get_experiments :列出 GrowthBook 中的所有实验。

    • get_experiment :通过 ID 获取特定实验的详细信息。

    • get_attributes :列出 GrowthBook 中跟踪的所有用户属性(对于定位有用)。

  • 环境

    • get_environments :列出 GrowthBook 中配置的所有环境(例如生产、暂存)。

  • 项目

    • get_projects :列出 GrowthBook 实例中的所有项目。

  • SDK 连接

    • get_sdk_connections :列出所有 SDK 连接(GrowthBook 如何连接到您的应用程序)。

    • create_sdk_connection :为您的应用创建一个新的 SDK 连接,指定语言和环境。

  • 文档搜索

    • search_growthbook_docs :通过关键字或问题搜索 GrowthBook 文档以获取有关如何使用某个功能的信息。

Available Tools

14 tools
create_feature_flagC

Create, add, or wrap an element with a feature flag.

Inputs: defaultValue (required), fileExtension (required), id (required), valueType (required), +4 more.

create_force_ruleA

Create a new force rule on an existing feature. If the existing feature isn't apparent, create a new feature using create_feature_flag first. A force rule sets a feature to a specific value for a specific environment based on a condition. For A/B tests and experiments, use create_experiment instead.

Inputs: environments (required), featureId (required), fileExtension (required), value (required), +2 more.

create_sdk_connectionC

Create an SDK connection for a user. Returns an SDK clientKey that can be used to fetch features and experiments.

Inputs: language (required), name (required), environment.

generate_flag_typesB

Generate types for feature flags

Inputs: no named parameters.

get_attributesD

Get all attributes

Inputs: no named parameters.

get_environmentsB

Fetches all environments from the GrowthBook API. GrowthBook comes with one environment by default (production), but you can add as many as you need. Feature flags can be enabled and disabled on a per-environment basis. You can also set the default feature state for any new environment. Additionally, you can scope environments to only be available in specific projects, allowing for further control and segmentation over feature delivery.

Inputs: no named parameters.

get_experimentC

Gets a single experiment from GrowthBook

Inputs: experimentId (required).

get_experimentsC

Fetches all experiments from the GrowthBook API

Inputs: limit, offset, project.

get_feature_flagsC

Fetches all feature flags from the GrowthBook API. Flags are returned in the order they were created, from oldest to newest.

Inputs: limit, offset, project.

get_projectsC

Fetches all projects from the GrowthBook API

Inputs: limit, offset.

get_sdk_connectionsC

Get all SDK connections, which are how GrowthBook connects to an app. Importantly, users need the key, which is a public client key that allows the app to fetch features and experiments the API

Inputs: limit, offset, project.

get_single_feature_flagC

Fetches a specific feature flag from the GrowthBook API

Inputs: id (required), project.

get_stale_safe_rolloutsC

Fetches all complete safe rollouts (rolled-back or released) from the GrowthBook API

Inputs: limit, offset, project.

search_growthbook_docsC

Search the GrowthBook docs on how to use a feature

Inputs: query (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as create_feature_flag vs. create_force_rule, but there is some overlap between get_feature_flags and get_single_feature_flag, which could cause confusion if an agent needs to fetch a specific flag versus all flags. The descriptions help clarify, but the boundary is not perfectly clear.

    Naming Consistency4/5

    The naming follows a consistent verb_noun pattern (e.g., create_feature_flag, get_experiments) with minor deviations like generate_flag_types (which uses 'generate' instead of 'get') and search_growthbook_docs (which includes 'growthbook' in the name). Overall, it is mostly predictable and readable.

    Tool Count5/5

    With 14 tools, the count is well-scoped for a GrowthBook MCP server, covering key operations like creating flags, rules, connections, and fetching various resources. Each tool appears to earn its place without feeling excessive or insufficient for the domain.

    Completeness4/5

    The tool set provides good coverage for core GrowthBook operations, including CRUD-like actions for features, experiments, and connections, but there are minor gaps such as missing update or delete tools for flags or experiments, which agents might need to work around. The inclusion of search_growthbook_docs adds helpful context.

    Maintenance

    ActivityActive
    ResponsivenessMixed handling

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server for managing Bucketeer feature flags, providing tools for listing, creating, retrieving, updating, and archiving feature flags.
      5
      1
      MIT
    • A
      license
      C
      quality
      A
      maintenance
      MCP server for Langfuse observability. Query traces, debug exceptions, analyze sessions, and manage prompts and datasets for your LLM applications.
      48
      2,753 PyPI
      112
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for managing deep links, analytics, and app configuration on Grovs. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible client.
      16
      2
      MIT