GG

growthbook/growthbook-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

26 stars 24 forks 质量 83 趋势 20MIT

官方GrowthBook MCP服务器,用于创建旗帜、获取实验等功能。

概览

一个为GrowthBook设计的薄MCP服务器,配备四个工具: 能力存在于技能仓库中,并且是。能力分为读写API工具(无每个端点的格式化工具),因此客户端可以正确遵守readOnlyHint和destructiveHint。 工具前缀带有growthbook_,以便在客户端加载多个MCP服务器时保持清晰。 将MCP客户端指向已编译的入口点: 客户端连接如下:- http://127.0.0.1:3333/mcp — 完整(技能 + API 读写) - http://127.0.0.1:3333/mcp/api — 仅能力 (growthbook_api_read + growthbook_api_write) 未认证请求接收401,WWW-Authenticate指向/.well-known/oauth-protected-resource,宣传GrowthBook授权服务器。 在处理MCP之前,服务器会向承载者探测GrowthBook REST(GET /api/v1/)。

概述(AI 翻译)

一个为GrowthBook设计的薄MCP服务器,配备四个工具:

工具 目的
growthbook_list_skills 列出顶级技能入门点(姓名 + 描述)
growthbook_read_skill 返回列出的技能或合格子工作流程(feature-flags 或 feature-flags/references/flag-create)
growthbook_api_read 认证的GET直通到GrowthBook API
growthbook_api_write 认证的POST/PUT/PATCH/DELETE直通

能力存储在技能仓库中,并且在构建时捆绑完成。能力分为读写API工具(无每个端点的格式化工具),以便客户端正确遵守readOnlyHint / destructiveHint。

工具前缀为growthbook_,以便在客户端加载多个MCP服务器时保持清晰。

光标插件

从 Cursor Marketplace 安装 GrowthBook。该插件将 Cursor 连接到托管服务器 [https://mcp.growthbook.io/mcp;第一次工具调用会打开 GrowthBook 登录以授权。自架 GrowthBook 用户应按照下文描述手动配置服务器。

该插件由 .cursor-plugin/plugin.json 和 mcp.json 定义。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

GrowthBook MCP Thin

A thin MCP server for GrowthBook with four tools:

Tool Purpose
growthbook_list_skills List top-level skill entry points (name + description)
growthbook_read_skill Return a listed skill or qualified child workflow (feature-flags or feature-flags/references/flag-create)
growthbook_api_read Authenticated GET passthrough to the GrowthBook API
growthbook_api_write Authenticated POST/PUT/PATCH/DELETE passthrough

Competence lives in the skills repo and is bundled at build time. Capability is split into read vs write API tools (no per-endpoint formatters) so clients can honor readOnlyHint / destructiveHint correctly.

Tools are prefixed with growthbook_ so they stay unambiguous when a client has multiple MCP servers loaded.

Cursor plugin

Install GrowthBook from the Cursor Marketplace. The plugin connects Cursor to the hosted server at https://mcp.growthbook.io/mcp; the first tool call opens a GrowthBook sign-in to authorize it. Self-hosted GrowthBook users should configure the server manually as described below.

The plugin is defined by .cursor-plugin/plugin.json and mcp.json. To test changes locally, copy the repo into ~/.cursor/plugins/local/growthbook and run Developer: Reload Window.

Install / run

npm install
npm run build

Point your MCP client at the compiled entrypoint:

{
  "mcpServers": {
    "growthbook": {
      "command": "node",
      "args": ["/absolute/path/to/growthbook-mcp/server/index.js"],
      "env": {
        "GB_API_KEY": "your_api_key_or_pat",
        "GB_API_URL": "https://api.growthbook.io"
      }
    }
  }
}

Or run the published package:

npx @growthbook/mcp

Environment variables

Variable Required Default Purpose
GB_API_KEY Yes for stdio; optional for HTTP OAuth — GrowthBook API key or personal access token
GB_API_URL No https://api.growthbook.io API base URL (self-hosted) and default OAuth AS issuer
GB_MCP_TRANSPORT No stdio stdio or http
GB_MCP_PORT No 3333 HTTP listen port (when transport=http)
GB_MCP_HOST No 127.0.0.1 HTTP bind host
GB_MCP_URL Yes for HTTP — Public MCP base URL stamped into OAuth resource metadata (server refuses to start in HTTP mode without it)
GB_MCP_KEEP_ALIVE_TIMEOUT_MS No 90000 Idle keep-alive timeout in HTTP mode. Must exceed the idle timeout of any load balancer in front, or the LB can reuse a connection the server has already closed and the request fails with a 502
OPENAI_APPS_CHALLENGE_TOKEN No — Served as plain text at /.well-known/openai-apps-challenge for OpenAI plugin domain verification (HTTP mode); the route returns 404 when unset
在 GitHub 查看完整 README

安装

npx @growthbook/mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "growthbook": { "command": "node", "args": ["/absolute/path/to/growthbook-mcp/server/index.js"], "env": { "GB_API_KEY": "your_api_key_or_pat", "GB_API_URL": "https://api.growthbook.io" } } } }