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.
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
Bucket CLI
Command-line interface for interacting with Bucket services. The CLI allows you to manage apps, features, authentication, and generate TypeScript types for your Bucket features. With this tool, you can streamline your feature flagging workflow directly from your terminal.
Usage
Get started by installing the CLI locally in your project:
Then running the new
command from your project's root directory,
initializing the CLI, creating a feature, and generating the types all at once:
Individual commands
Instead of running new
you can call each step individually.
Configuration
The CLI creates a bucket.config.json
file in your project directory when you run bucket init
.
This file contains all the necessary settings for your Bucket integration.
Configuration File Structure
Here's a comprehensive list of configuration options available in the bucket.config.json
file:
Option | Description | Default |
---|---|---|
$schema | Autocompletion for the config. latest can be replaced with a specific version. | "https://unpkg.com/@bucketco/cli@latest/schema.json" |
baseUrl | Base URL for Bucket services. | "https://app.bucket.co" |
apiUrl | API URL for Bucket services (overrides baseUrl for API calls). | "https://app.bucket.co/api" |
appId | Your Bucket application ID. | Required |
typesOutput | Path(s) where TypeScript types will be generated. Can be a string or an array of objects with path and format properties. Available formats: react and node . | "gen/features.ts" with format "react" |
You can override these settings using command-line options for individual commands.
Commands
bucket init
Initialize a new Bucket configuration in your project.
This creates a bucket.config.json
file with your settings and prompts for any required information not provided via options.
Options:
--overwrite
: Overwrite existing configuration file if one exists.--app-id <id>
: Set the application ID.--key-format <format>
: Set the key format for features.
bucket new [featureName]
All-in-one command to get started quickly. This command combines init
, feature creation,
and type generation in a single step. Use this for the fastest way to get up and running with Bucket.
Options:
--key
: Specific key for the feature.--app-id
: App ID to use.--key-format
: Format for feature keys (custom, snake, camel, etc.).--out
: Path to generate TypeScript types.--format
: Format of the generated types (react or node).
If you prefer more control over each step, you can use the individual commands (init
, features create
, features types
) instead.
bucket login
Log in to your Bucket account. This will authenticate your CLI for subsequent operations and store credentials securely.
bucket logout
Log out from your Bucket account, removing stored credentials.
bucket features
Manage your Bucket features with the following subcommands.
bucket features create [featureName]
Create a new feature in your Bucket app. The command guides you through the feature creation process with interactive prompts if options are not provided.
Options:
--key
: Specific key for the feature.--app-id
: App ID to use.--key-format
: Format for feature keys.
bucket features list
List all features for the current app. This helps you visualize what features are available and their current configurations.
Options:
--app-id
: App ID to use.
bucket features types
Generate TypeScript types for your features. This ensures type safety when using Bucket features in your TypeScript/JavaScript applications.
Options:
--app-id
: App ID to use.--out
: Path to generate TypeScript types.--format
: Format of the generated types (react or node).
bucket companies
Commands for managing companies.
bucket companies list
List all companies in your app.
Options:
--filter
: Filter companies by name or ID.--app-id
: App ID to use.
The command outputs a table with the following columns:
id
: Company ID.name
: Company name (shows "(unnamed)" if not set).users
: Number of users in the company.lastSeen
: Date when the company was last active.
bucket companies features access
Grant or revoke access to specific features for companies, segments, and users. If no feature key is provided, you'll be prompted to select one from a list.
Arguments:
featureKey
: Key of the feature to grant/revoke access to (optional, interactive selection if omitted).
Options:
--enable
: Enable the feature for the specified targets.--disable
: Disable the feature for the specified targets.--users
: User IDs to target. Can be specified multiple times.--companies
: Company IDs to target. Can be specified multiple times.--segments
: Segment IDs to target. Can be specified multiple times.--app-id
: App ID to use.
At least one target (companies, segments, or users) must be specified. You must also specify either --enable
or --disable
, but not both.
Example:
bucket apps
Commands for managing Bucket apps.
Global Options
These options can be used with any command:
--debug
: Enable debug mode for verbose output.--base-url <url>
: Set the base URL for Bucket API.--api-url <url>
: Set the API URL directly (overrides base URL).--help
: Display help information for a command.
AI-Assisted Development
Bucket provides powerful AI-assisted development capabilities through rules and Model Context Protocol (MCP). These features help your AI development tools better understand your features and provide more accurate assistance.
Bucket Rules (Recommended)
The rules
command helps you set up AI-specific rules for your project. These rules enable AI tools to better understand how to work with Bucket and feature flags and how they should be used in your codebase.
Options:
--format
: Format to add rules in:cursor
: Adds rules to.cursor/rules/bucket.mdc
for Cursor IDE integration.copilot
: Adds rules to.github/copilot-instructions.md
for GitHub Copilot integration.
--yes
: Skip confirmation prompts and overwrite existing files without asking.
This command will add rules to your project that provide AI tools with context about how to setup and use Bucket feature flags. For the copilot format, the rules will be added to a dedicated section in the file, allowing you to maintain other copilot instructions alongside Bucket's rules.
Model Context Protocol
The Model Context Protocol (MCP) is an open protocol that provides a standardized way to connect AI models to different data sources and tools. In the context of Bucket, MCP enables your development environment to understand your feature flags, their states, and their relationships within your codebase. This creates a seamless bridge between your feature management workflow and AI-powered development tools. MCP is in a very early stage of development and changes are frequent, if something isn't working please check out the Model Context Protocol Website and open an issue ticket here.
Setting up MCP
MCP servers currently run locally on your machine. To start the MCP server run the CLI command from your Bucket initialized project directory:
Options:
--port
: Port to run the SSE server on (defaults to 8050, "auto" for random port).--app-id
: App ID to use.
This will start an SSE server at http://localhost:8050/sse
by default which you can connect to using your client of choice. Below are examples that work for Cursor IDE and Claude Desktop.
Server-Side Events (SSE)
STDIO Proxy
Some clients don't support SSE and can instead interface with the MCP server over a STDIO proxy.
Cursor IDE
To enable MCP features in Cursor IDE:
- Open Cursor IDE.
- Go to
Settings > MCP
. - Click
Add new global MCP server
and paste theSSE
config. - Save and go back to Cursor.
Claude Desktop
To enable MCP features in Claude Desktop:
- Open Claude Desktop.
- Go to
Settings > Developer
. - Click
Edit config
and paste theSTDIO
config. - Save and restart Claude Desktop.
Development
Requirements
- Node.js >=18.0.0
License
MIT License Copyright (c) 2025 Bucket ApS
This server cannot be installed
Flag features directly from chat in your code editor, including VS Code, Cursor, Windsurf, Claude Code—any IDE with MCP support.