Bucket Feature Flags MCP Server
Official存储桶 CLI
用于与 Bucket 服务交互的命令行界面。CLI 允许您管理应用、功能、身份验证,并为 Bucket 功能生成 TypeScript 类型。使用此工具,您可以直接从终端简化功能标记工作流程。
用法
首先在您的项目中本地安装 CLI:
# npm
npm install --save-dev @bucketco/cli
# yarn
yarn add --dev @bucketco/cli然后从项目的根目录运行new命令,初始化 CLI,创建功能,并一次性生成类型:
# npm
npx bucket new
# yarn
yarn bucket new单独的命令
您可以单独调用每个步骤,而不必运行new步骤。
# Initialize Bucket in your project (if not already setup)
npx bucket init
# Create a new feature
npx bucket features create "My Feature"
# Generate TypeScript types for your features
npx bucket features typesRelated MCP server: decisionnode/DecisionNode
配置
运行bucket init时,CLI 会在项目目录中创建一个bucket.config.json文件。此文件包含 Bucket 集成所需的所有设置。
配置文件结构
以下是bucket.config.json文件中可用的配置选项的完整列表:
{
"$schema": "https://unpkg.com/@bucketco/cli@latest/schema.json",
"baseUrl": "https://app.bucket.co",
"apiUrl": "https://app.bucket.co/api",
"appId": "ap123456789",
"typesOutput": [
{
"path": "gen/features.d.ts",
"format": "react"
}
]
}选项 | 描述 | 默认 |
| 配置的自动完成功能。 | |
| Bucket 服务的基本 URL。 | |
| Bucket 服务的 API URL(覆盖 API 调用的 baseUrl)。 | |
| 您的 Bucket 应用程序 ID。 | 必需的 |
| TypeScript 类型生成路径。可以是字符串,也可以是包含 | “gen/features.ts” 格式为“react” |
您可以使用单个命令的命令行选项覆盖这些设置。
命令
bucket init
在您的项目中初始化一个新的 Bucket 配置。这将创建一个bucket.config.json文件,其中包含您的设置,并提示您输入任何未通过选项提供的必需信息。
npx bucket init [--overwrite]选项:
--overwrite:如果存在,则覆盖现有配置文件。--app-id <id>:设置应用程序 ID。--key-format <format>:设置功能的密钥格式。
bucket new [featureName]
一体化命令,快速上手。此命令将init 、特性创建和类型生成功能集成到单个步骤中。使用此命令可以最快地启动并运行 Bucket。
npx bucket new "My Feature" [--app-id ap123456789] [--key my-feature] [--key-format custom] [--out gen/features.ts] [--format react]选项:
--key:该功能的特定键。--app-id:要使用的应用程序 ID。--key-format:功能键的格式(自定义、蛇形、骆驼等)。--out:生成 TypeScript 类型的路径。--format:生成类型的格式(react 或 node)。
如果您希望对每个步骤进行更多控制,则可以使用单独的命令( init 、 features create 、 features types )。
bucket login
登录您的 Bucket 帐户。这将验证您的 CLI 以进行后续操作,并安全地存储凭据。
npx bucket loginbucket logout
从您的 Bucket 帐户注销,删除存储的凭据。
npx bucket logoutbucket features
使用以下子命令管理您的 Bucket 功能。
bucket features create [featureName]
在您的 Bucket 应用中创建一个新功能。如果未提供选项,该命令将通过交互式提示引导您完成功能创建过程。
npx bucket features create "My Feature" [--app-id ap123456789] [--key my-feature] [--key-format custom]选项:
--key:该功能的特定键。--app-id:要使用的应用程序 ID。--key-format:功能键的格式。
bucket features list
列出当前应用的所有功能。这有助于您直观地了解可用的功能及其当前配置。
npx bucket features list [--app-id ap123456789]选项:
--app-id:要使用的应用程序 ID。
bucket features types
为您的功能生成 TypeScript 类型。这可确保在 TypeScript/JavaScript 应用程序中使用 Bucket 功能时的类型安全。
npx bucket features types [--app-id ap123456789] [--out gen/features.ts] [--format react]选项:
--app-id:要使用的应用程序 ID。--out:生成 TypeScript 类型的路径。--format:生成类型的格式(react 或 node)。
bucket companies
用于管理公司的命令。
bucket companies list
列出您的应用中的所有公司。
npx bucket companies list [--filter <text>] [--app-id ap123456789]选项:
--filter:按名称或 ID 过滤公司。--app-id:要使用的应用程序 ID。
该命令输出一个包含以下列的表:
id:公司 ID。name:公司名称(如果未设置则显示“(未命名)”)。users:公司内的用户数量。lastSeen:公司最后活跃的日期。
bucket companies features access
授予或撤销公司、部门和用户对特定功能的访问权限。如果未提供功能密钥,系统将提示您从列表中选择一个。
npx bucket companies features access [--app-id ap123456789] [featureKey] [--enable|--disable] [--companies <id...>] [--segments <id...>] [--users <id...>]参数:
featureKey:授予/撤销访问权限的功能的键(可选,如果省略则进行交互式选择)。
选项:
--enable:为指定目标启用该功能。--disable:禁用指定目标的功能。--users:目标用户 ID。可以多次指定。--companies:目标公司 ID。可多次指定。--segments:目标段 ID。可以多次指定。--app-id:要使用的应用程序 ID。
必须指定至少一个目标(公司、细分或用户)。您还必须指定--enable或--disable ,但不能同时指定两者。
例子:
# Enable feature for multiple companies and users
npx bucket companies features access my-feature --enable --companies comp_123 --companies comp_456 --users user_789bucket apps
用于管理 Bucket 应用程序的命令。
全局选项
这些选项可以与任何命令一起使用:
--debug:启用调试模式以获得详细输出。--base-url <url>:设置 Bucket API 的基本 URL。--api-url <url>:直接设置 API URL(覆盖基本 URL)。--help:显示命令的帮助信息。
人工智能辅助开发
Bucket 通过规则和模型上下文协议 (MCP) 提供强大的 AI 辅助开发能力,帮助您的 AI 开发工具更好地理解您的特征,从而提供更精准的辅助。
存储桶规则(推荐)
rules命令可帮助您为项目设置 AI 专用规则。这些规则使 AI 工具能够更好地理解如何使用 Bucket 和功能开关,以及如何在代码库中使用它们。
npx bucket rules [--format <cursor|copilot>] [--yes]选项:
--format:添加规则的格式:cursor:向.cursor/rules/bucket.mdc添加规则,用于 Cursor IDE 集成。copilot:向.github/copilot-instructions.md添加规则以用于 GitHub Copilot 集成。
--yes:跳过确认提示并覆盖现有文件而不询问。
此命令将向您的项目添加规则,为 AI 工具提供有关如何设置和使用 Bucket 功能标志的上下文。对于 Copilot 格式,规则将添加到文件中的专用部分,以便您在维护 Bucket 规则的同时,还能维护其他 Copilot 指令。
模型上下文协议
模型上下文协议 (MCP) 是一种开放协议,它提供了一种标准化的方式将 AI 模型连接到不同的数据源和工具。在 Bucket 上下文中,MCP 使您的代码编辑器能够理解您的功能开关、它们的状态以及它们在代码库中的关系。这在您的功能管理工作流程和 AI 驱动的开发工具之间建立了无缝的桥梁。MCP 服务器由 Bucket 托管,因此非常易于上手。
**注意:Bucket 的mcp CLI 命令之前用于本地服务器。不过,在 Bucket CLI 的最新版本中, mcp命令已被重新设计,可帮助您连接到新的远程 MCP 服务器。**_
设置 MCP
mcp命令可帮助您配置编辑器或 AI 客户端,以连接到 Bucket 的远程 MCP 服务器。这使您的 AI 工具能够理解您的功能开关并提供更多上下文帮助。
npx bucket mcp [--app-id <id>] [--editor <editor>] [--scope <local|global>]选项:
--app-id:用于 MCP 连接的应用程序 ID。--editor:要配置的编辑器/客户端:cursor: IDE 光标vscode: Visual Studio 代码claude:克劳德桌面windsurf:风帆冲浪
--scope:是否为项目全局或本地配置设置。
该命令将指导您完成:
选择要配置的编辑器/客户端。
选择要连接的 Bucket 应用程序。
决定全局配置还是项目本地配置。
为您选择的编辑器设置适当的配置文件。
注意:此设置使用mcp-remote作为兼容层,允许远程托管的 Bucket MCP 服务器与所有支持 MCP STDIO 服务器的编辑器/客户端兼容。如果您的编辑器/客户端支持基于 OAuth 的 HTTP 流式传输,则可以直接连接到 Bucket MCP 服务器。
发展
# Build the CLI
yarn build
# Run the CLI locally
yarn bucket [command]
# Lint and format code
yarn lint
yarn format要求
Node.js >=18.0.0
执照
MIT 许可证版权所有 (c) 2025 Bucket ApS
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
AI code review for GitHub PRs with an MCP autofix loop for Claude Code and Cursor
Portable memory for AI agents: capture once, recall across Claude, Cursor, and any MCP client.
One shared context your team's AI tools read & write over MCP. No re-explaining. Free.
MCP-native notes and memory for ChatGPT, Claude, and other AI tools.
Related MCP Servers
- AlicenseAqualityCmaintenancePersistent cloud memory for AI coding assistants. 28 MCP tools for semantic search, auto-learning, task tracking, correction patterns, knowledge graphs, and session replay across Claude Code, Cursor, Windsurf, Cline, and any MCP client. Encrypted at rest. Team shared memory with author attribution.352547MIT
- AlicenseAqualityCmaintenanceRecord development decisions as structured JSON, embed them as vectors via Gemini, and search semantically over MCP. Works with Claude Code, Cursor, Windsurf, and any MCP client.91283MIT
- AlicenseAqualityCmaintenanceEnables real-time code analysis for JavaScript, TypeScript, and Python through Claude Desktop and other MCP clients, detecting bugs, code smells, and security vulnerabilities with automated quick fixes.72994MIT
- AlicenseAqualityAmaintenanceAI-powered codebase health analysis — detects dead code, circular dependencies, coupling issues, and architectural drift. 6 MCP tools for Claude Desktop, Cursor, Windsurf, and Slack.6179MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/reflagcom/javascript'
If you have feedback or need assistance with the MCP directory API, please join our Discord server