Growthbook Mcp

io.github.growthbook由 GitHub 账号 growthbook 发布v2.2.0更新于 Oct 25, 2026

Thin MCP server for GrowthBook — skill loader + authenticated API passthrough

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

轻量的 GrowthBook MCP 服务器,让助手读取内置的 GrowthBook 技能,并通过认证调用 GrowthBook API 进行读取或写入。

可以做什么
列出并读取内置的 GrowthBook 技能,包括带限定路径的子工作流,例如创建功能开关的指南,内容随包本地提供。向任意 GrowthBook REST API 路径发送带认证的 GET 请求并返回原始响应体。发送带认证的 POST、PUT、PATCH 和 DELETE 请求,可附带 JSON 请求体,用于创建、修改或删除 GrowthBook 资源。对认证失败、自托管 404 和限流返回可操作的错误信息。可选以独立 HTTP 服务器运行,提供受 OAuth 保护的端点,其中一条仅暴露 API 工具的路径。
适用场景
当助手需要查看或修改 GrowthBook 账户中的项目、功能开关及其他 REST 资源,或按 GrowthBook 自带的工作流(例如创建功能开关)操作时使用。适用于云端和自托管的 GrowthBook,可通过 stdio 或 HTTP 连接。
运行要求
以 Node.js 本地进程运行,可用 npx 运行已发布的 npm 包,或从构建后的代码库启动。stdio 模式需要在 GB_API_KEY 中提供 GrowthBook API 密钥或个人访问令牌。GB_API_URL 可选,用于指向自托管实例,默认使用 GrowthBook 公共 API。HTTP 模式还需设置 GB_MCP_URL,并在 GrowthBook API 上启用 OAuth。需要能访问 GrowthBook API 的网络。
安装前请注意
服务器在 GB_API_KEY 中保存 GrowthBook API 密钥或个人访问令牌,应仅授予助手所需的最小权限。写入工具可创建、修改和删除 GrowthBook 资源(包括功能开关),并被标记为破坏性操作。API 路径为自由填写,因此令牌能访问的任何端点都可被调用。每次 API 调用都会向 GrowthBook 实例发送 MCP 使用情况请求头,除非后端关闭遥测,否则会被其产品遥测记录。HTTP 模式应仅在可信网络或回环地址上运行,公开部署需自行加网关和认证。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Growthbook Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

GrowthBook MCP Thin

A thin MCP server for GrowthBook with four tools:

ToolPurpose
growthbook_list_skillsList top-level skill entry points (name + description)
growthbook_read_skillReturn a listed skill or qualified child workflow (feature-flags or feature-flags/references/flag-create)
growthbook_api_readAuthenticated GET passthrough to the GrowthBook API
growthbook_api_writeAuthenticated 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

bash
npm installnpm run build

Point your MCP client at the compiled entrypoint:

json
{  "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:

bash
npx @growthbook/mcp

Environment variables

VariableRequiredDefaultPurpose
GB_API_KEYYes for stdio; optional for HTTP OAuth—GrowthBook API key or personal access token
GB_API_URLNohttps://api.growthbook.ioAPI base URL (self-hosted) and default OAuth AS issuer
GB_MCP_TRANSPORTNostdiostdio or http
GB_MCP_PORTNo3333HTTP listen port (when transport=http)
GB_MCP_HOSTNo127.0.0.1HTTP bind host
GB_MCP_URLYes 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_MSNo90000Idle 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_TOKENNo—Served as plain text at /.well-known/openai-apps-challenge for OpenAI plugin domain verification (HTTP mode); the route returns 404 when unset
GB_OAUTH_ISSUERNoGB_API_URLGrowthBook OAuth AS issuer URL
GB_HTTP_HEADER_*No—Extra request headers (e.g. GB_HTTP_HEADER_CF_ACCESS_TOKEN)
GB_SKILLS_ENABLEDNotrueSet to false / 0 to disable skill tools

HTTP + OAuth mode

bash
OAUTH_AS_ENABLED=1  # on the GrowthBook APIGB_MCP_TRANSPORT=http GB_API_URL=http://localhost:3100 GB_MCP_PORT=3333 npm start

Clients connect to:

  • http://127.0.0.1:3333/mcp — full (skills + API read/write)
  • http://127.0.0.1:3333/mcp/api — capability-only (growthbook_api_read + growthbook_api_write)

Unauthenticated requests receive 401 with WWW-Authenticate pointing at /.well-known/oauth-protected-resource, which advertises the GrowthBook Authorization Server.

Before handling MCP, the server probes GrowthBook REST (GET /api/v1/) with the bearer. A 401 from that probe (or later from an API tool) yields HTTP 401 with error="invalid_token" so the MCP client can refresh — instead of surfacing "This API key has expired" as a tool error. A 403 is treated as an accepted bearer (permission denied ≠ invalid token) so clients are not forced into a refresh loop.

Capability-only mode

HTTP (recommended for remote): point the client at /mcp/api instead of /mcp:

json
{  "mcpServers": {    "growthbook": {      "url": "http://127.0.0.1:3333/mcp/api"    }  }}
PathTools
/mcpgrowthbook_list_skills, growthbook_read_skill, growthbook_api_read, growthbook_api_write (unless GB_SKILLS_ENABLED=false)
/mcp/apigrowthbook_api_read, growthbook_api_write only

stdio / process-wide: set env so skills are never registered:

json
"env": {  "GB_API_KEY": "...",  "GB_SKILLS_ENABLED": "false"}

When skills are disabled, only the API read/write tools are registered. growthbook_list_skills and growthbook_read_skill are not exposed.

How skills are bundled

bash
npm run build   # tsc && bundle-skills

scripts/bundle-skills.mjs copies the top-level skill tree from the canonical skills checkout, preserving structure:

skills/<skill>/SKILL.md                   → server/skills/<skill>/SKILL.mdskills/<skill>/references/<workflow>.md   → server/skills/<skill>/references/<workflow>.md

Source path resolution:

  1. SKILLS_SRC env var (path to the skills repo root)
  2. agent-skills.local.json — { "path": "../skills" }, relative to the repo root. Gitignored; copy agent-skills.local.json.example
  3. skills-src/ — what CI and the Docker build vendor

There is no implicit sibling lookup. ../skills resolves to whatever happens to be at that path, which makes a local build silently disagree with the commit CI builds from.

CI, cloud deploys, and releases all read agent-skills.lock.json and check out that exact skills commit. To ship upstream skill changes, update the commit in the lock file. Local development can point at any checkout with agent-skills.local.json or SKILLS_SRC.

The skills repo stays the source of truth — this package does not maintain a fork of skill content. New skills flow through automatically, except those named in the small blocklist in bundle-skills.mjs. Currently only gb-setup is blocked because it configures the gb-call shell adapter rather than GrowthBook itself.

Per-skill scripts/ directories are not copied. Relative `references/foo.md` links are rewritten to qualified `feature-flags/references/foo` paths so growthbook_read_skill can resolve them.

Using skills with the API tools

Bundled skills still show workflows as:

bash
gb-call GET /api/v1/projectsgb-call POST /api/v2/features ./payload.json

This MCP server does not shell out to gb-call. Map GET → growthbook_api_read and POST/PUT/PATCH/DELETE → growthbook_api_write with the same path and optional JSON body string. Server instructions and growthbook_read_skill output include this bridge note.

Tools detail

growthbook_api_read / growthbook_api_write

json
{ "path": "/api/v1/projects" }{ "method": "POST", "path": "/api/v2/features", "body": "{\"id\":\"my-flag\",...}" }
  • Read: GET only (readOnlyHint: true)
  • Write: POST | PUT | PATCH | DELETE (destructiveHint: true)
  • Returns raw response body on 2xx
  • On non-2xx, returns an actionable error (isError: true) covering auth failures, self-hosted 404 hints, and rate limits
  • Freeform paths target the GrowthBook REST API
  • Each request carries MCP usage headers (see Usage telemetry)

growthbook_list_skills / growthbook_read_skill

Only registered when GB_SKILLS_ENABLED is not disabled.

  • growthbook_list_skills returns top-level skill entry points. An entry may contain a complete workflow or route to child workflows.
  • growthbook_read_skill accepts a listed top-level name or a qualified child path named by a loaded skill (feature-flags/references/flag-create) and returns the full markdown (workflow + guardrails).

Usage telemetry

This server never sends telemetry anywhere itself. Instead, every REST call made by growthbook_api_read / growthbook_api_write includes headers that tell the GrowthBook instance it's talking to that the call came from the MCP:

HeaderExampleContents
X-GB-MCP-Toolgrowthbook_api_readThe tool that made the call
X-GB-MCP-Version2.2.0This server's version
X-GB-MCP-Transportstdiostdio or http
X-GB-MCP-Clientcursor/1.2.3The MCP client's name/version from the initialize handshake, or its User-Agent in HTTP mode

GrowthBook records these through its existing product telemetry, so the same controls apply. On a self-hosted instance, setting DISABLE_TELEMETRY on the GrowthBook back-end turns this off along with the rest of GrowthBook's telemetry. Older GrowthBook versions ignore the headers. Skill tools (growthbook_list_skills / growthbook_read_skill) are served locally and make no requests, so they aren't tracked.

Development

bash
git clone [email protected]:growthbook/skills.git ../skillscp agent-skills.local.json.example agent-skills.local.json  # edit if not at ../skills
npm installnpm run buildnpm start

Standalone HTTP mode

By default the server runs over stdio. Set GB_MCP_TRANSPORT=http to run it as a standalone HTTP server that exposes MCP at /mcp (skills + API tools) and /mcp/api (capability-only), behind an OAuth 2.0 protected-resource surface (RFC 9728 metadata + RFC 6750 WWW-Authenticate).

  • GB_MCP_URL (required in HTTP mode) — the server's public base URL. It is stamped into the OAuth resource (audience) and the protected-resource metadata, so it is never derived from request headers. The server refuses to start without it.
  • GB_MCP_PORT (default 3333) and GB_MCP_HOST (default 127.0.0.1).
  • Incoming bearers are validated by probing the GrowthBook REST API; a rejected token gets HTTP 401 + WWW-Authenticate so the client can refresh.

Run it on a trusted network or bound to loopback. For a multi-tenant or public deployment, front it with your own gateway/auth.

Releases

Cutting a release is deliberate: bump the version in package.json, run npm run sync-version (updates manifest.json, server.json, and .cursor-plugin/plugin.json), then push a matching v* tag:

bash
git tag v2.0.0git push origin v2.0.0

That tagged commit (with skills frozen at cut time) publishes:

  • @growthbook/mcp to npm — prereleases (versions with a -, e.g. 2.0.0-beta.1) go under the beta dist-tag; stable versions become latest
  • a multi-arch (amd64 + arm64) image to ghcr.io/growthbook/growthbook-mcp (:<version>, plus :<major>, :<major>.<minor>, and :latest for stable releases)
  • an entry in the MCP registry
  • a GitHub Release

The Cursor plugin is not published by CI: Cursor re-reviews the plugin from the default branch after the version bump lands.

Install a release with npx @growthbook/mcp@<version> or pull ghcr.io/growthbook/growthbook-mcp:<version>.

来源:README.md,提交 847741a

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v2.2.0最新Oct 6, 2026
  2. v2.1.0Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分