Bucket Feature Flags MCP Server

Official
by bucketco
MIT License
1,726
10

Integrations

  • Provides integration with Node.js applications, allowing feature flag management and TypeScript type generation for Node.js projects

  • Provides CLI commands that can be executed via npm, supporting installation and execution of Bucket features

  • Offers feature flag management specifically tailored for React applications, including TypeScript type generation with React-specific formats

バケット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 types

構成

CLIは、 bucket initを実行すると、プロジェクトディレクトリに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" } ] }
オプション説明デフォルト
$schema構成の自動補完。 latestを特定のバージョンに置き換えることができます。https://unpkg.com/@bucketco/cli@latest/schema.json
baseUrlバケット サービスのベース URL。https://app.bucket.co
apiUrlバケット サービスの API URL (API 呼び出しの baseUrl をオーバーライドします)。https://app.bucket.co/api
appIdバケット アプリケーション ID。必須
typesOutputTypeScript型が生成されるパス。文字列、またはpathformatプロパティを持つオブジェクトの配列を指定できます。使用可能な形式はreactnodeです。「react」形式の「gen/features.ts」

個々のコマンドのコマンドライン オプションを使用して、これらの設定を上書きできます。

コマンド

bucket init

プロジェクトで新しいバケット設定を初期化します。これにより、設定内容が含まれたbucket.config.jsonファイルが作成され、オプションで指定されていない必要な情報の入力が求められます。

npx bucket init [--overwrite]

オプション:

  • --overwrite : 既存の設定ファイルが存在する場合は上書きします。
  • --app-id <id> : アプリケーション ID を設定します。
  • --key-format <format> : 機能のキー形式を設定します。

bucket new [featureName]

すぐに使い始めるためのオールインワンコマンド。このコマンドは、 init 、特徴量の作成、型生成を1つのステップにまとめています。Bucketを最も早く使い始めるには、これを使うのが一番です。

npx bucket new "My Feature" [--key my-feature] [--app-id ap123456789] [--key-format custom] [--out gen/features.ts] [--format react]

オプション:

  • --key : 機能の特定のキー。
  • --app-id : 使用するアプリ ID。
  • --key-format : 機能キーの形式 (カスタム、スネーク、キャメルなど)。
  • --out : TypeScript 型を生成するパス。
  • --format : 生成されるタイプの形式 (react または node)。

各ステップをより細かく制御したい場合は、代わりに個別のコマンド ( initfeatures createfeatures types ) を使用できます。

bucket login

Bucketアカウントにログインしてください。これにより、以降の操作でCLIが認証され、認証情報が安全に保存されます。

npx bucket login

bucket logout

Bucket アカウントからログアウトし、保存されている資格情報を削除します。

npx bucket logout

bucket features

次のサブコマンドを使用して、Bucket 機能を管理します。

bucket features create [featureName]

Bucketアプリで新しい機能を作成します。オプションが指定されていない場合は、コマンドが対話型プロンプトで機能の作成プロセスをガイドします。

npx bucket features create "My Feature" [--key my-feature] [--app-id ap123456789] [--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 : 会社名(設定されていない場合は「(unnamed)」と表示されます)。
  • users : 社内のユーザー数。
  • lastSeen : 会社が最後にアクティブになった日付。

bucket companies features access

企業、セグメント、ユーザーに対して、特定の機能へのアクセスを許可または取り消します。機能キーが指定されていない場合は、リストから選択するよう求められます。

npx bucket companies features access [featureKey] [--enable|--disable] [--companies <id...>] [--segments <id...>] [--users <id...>] [--app-id ap123456789]

引数:

  • featureKey : アクセスを許可/取り消す機能のキー (オプション、省略した場合は対話型選択)。

オプション:

  • --enable : 指定されたターゲットに対して機能を有効にします。
  • --disable : 指定されたターゲットの機能を無効にします。
  • --users : 対象とするユーザーID。複数回指定できます。
  • --companies : 対象とする企業ID。複数回指定できます。
  • --segments : ターゲットとするセグメントID。複数回指定できます。
  • --app-id : 使用するアプリ ID。

少なくとも1つのターゲット(企業、セグメント、またはユーザー)を指定する必要があります。また、 --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_789

bucket apps

Bucket アプリを管理するためのコマンド。

グローバルオプション

これらのオプションはどのコマンドでも使用できます。

  • --debug : 詳細出力のデバッグ モードを有効にします。
  • --base-url <url> : Bucket API のベース URL を設定します。
  • --api-url <url> : API URL を直接設定します (ベース URL をオーバーライドします)。
  • --help : コマンドのヘルプ情報を表示します。

AI支援開発

Bucketは、ルールとモデルコンテキストプロトコル(MCP)を通じて、強力なAI支援開発機能を提供します。これらの機能により、AI開発ツールは開発機能をより深く理解し、より正確な支援を提供できるようになります。

バケットルール(推奨)

rulesコマンドは、プロジェクトにAI固有のルールを設定するのに役立ちます。これらのルールにより、AIツールはBucketと機能フラグの使い方、そしてコードベースでそれらをどのように使用すべきかをより適切に理解できるようになります。

npx bucket rules [--format cursor|copilot] [--yes]

オプション:

  • --format : ルールを追加する形式:
    • cursor : Cursor IDE 統合のために.cursor/rules/bucket.mdcにルールを追加します。
    • copilot : GitHub Copilot 統合のために.github/copilot-instructions.mdにルールを追加します。
  • --yes : 確認プロンプトをスキップし、確認せずに既存のファイルを上書きします。

このコマンドは、プロジェクトにルールを追加します。このルールは、AIツールにBucket機能フラグの設定方法と使用方法に関するコンテキストを提供します。Copilot形式の場合、ルールはファイル内の専用セクションに追加されるため、Bucketのルールと並行して他のCopilot指示を管理できます。

モデルコンテキストプロトコル

モデルコンテキストプロトコル(MCP)は、AIモデルをさまざまなデータソースやツールに接続するための標準化された方法を提供するオープンプロトコルです。Bucketのコンテキストでは、MCPは開発環境が機能フラグ、その状態、そしてコードベース内での関係性を理解することを可能にします。これにより、機能管理ワークフローとAIを活用した開発ツールの間にシームレスな橋渡しが実現します。MCPはまだ開発の初期段階にあり、頻繁に変更が行われています。何か問題が発生した場合は、モデルコンテキストプロトコルのウェブサイトをご覧いただき、こちらから問題チケットを作成してください。

MCPの設定

MCPサーバーは現在、お使いのマシン上でローカルに実行されています。MCPサーバーを起動するには、Bucketで初期化されたプロジェクトディレクトリから以下のCLIコマンドを実行してください。

npx bucket mcp [--port <number|"auto">] [--app-id ap123456789]

オプション:

  • --port : SSE サーバーを実行するポート (デフォルトは 8050、ランダム ポートの場合は "auto")。
  • --app-id : 使用するアプリ ID。

これにより、デフォルトでhttp://localhost:8050/sseにSSEサーバーが起動し、任意のクライアントから接続できるようになります。以下は、Cursor IDEClaude Desktopで動作する例です。

サーバー側イベント (SSE)
{ "mcpServers": { "Bucket": { "url": "http://localhost:8050/sse" } } }
STDIOプロキシ

一部のクライアントは SSE をサポートしておらず、代わりに STDIO プロキシ経由で MCP サーバーとインターフェースできます。

{ "mcpServers": { "Bucket": { "command": "npx", "args": ["-y", "supergateway", "--sse", "http://localhost:8050/sse"] } } }

カーソルIDE

カーソル IDEで MCP 機能を有効にするには:

  1. カーソル IDE を開きます。
  2. Settings > MCPに移動します。
  3. Add new global MCP serverをクリックし、 SSE構成を貼り付けます。
  4. 保存してカーソルに戻ります。

クロードデスクトップ

Claude Desktopで MCP 機能を有効にするには:

  1. Claude Desktop を開きます。
  2. Settings > Developerに移動します。
  3. Edit configをクリックし、 STDIO設定を貼り付けます。
  4. 保存してClaude Desktopを再起動します。

発達

# 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ライセンス Copyright (c) 2025 Bucket ApS

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

VS Code、Cursor、Windsurf、Claude Code など、MCP をサポートするあらゆる IDE のコード エディターのチャットから直接機能にフラグを付けます。

  1. Usage
    1. Individual commands
  2. Configuration
    1. Configuration File Structure
  3. Commands
    1. bucket init
    2. bucket new [featureName]
    3. bucket login
    4. bucket logout
    5. bucket features
    6. bucket companies
    7. bucket companies features access
    8. bucket apps
  4. Global Options
    1. AI-Assisted Development
      1. Bucket Rules (Recommended)
    2. Model Context Protocol
      1. Setting up MCP
      2. Cursor IDE
      3. Claude Desktop
    3. Development
      1. Requirements
        1. License

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            TypeScript-based MCP server designed to enhance code editing experiences by providing features such as hover information, code completion, and diagnostics.
            Last updated -
            3
            13
            MIT License
            • Apple
          • -
            security
            A
            license
            -
            quality
            A VS Code extension provides a MCP server that exposes Roslyn language features. It enables tools like find usages, go to definition, quick info, etc.
            Last updated -
            81
            TypeScript
            AGPL 3.0
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            An MCP server that provides detailed information about your development environment to the Cursor code editor, enabling more context-aware assistance.
            Last updated -
            1
            Python
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            An MCP server that allows AI assistants to programmatically manage Unleash feature flags through natural language, enabling operations like creating, updating, and retrieving feature flags across projects.
            Last updated -
            5
            2
            TypeScript

          View all related MCP servers

          ID: h3p2ndqmat