Bucket (Feature Flagging) MCP server

Flag features directly from chat in your code editor, including VS Code, Cursor, Windsurf, Claude Code - any IDE with MCP support.
Back to servers
Provider
Bucket
Release date
Apr 07, 2025
Language
TypeScript
Package
Stats
14.9K downloads
10 stars

This command-line tool provides a convenient interface for managing Bucket feature flags and related services directly from your terminal. It helps you create and manage features, configure access controls, and generate TypeScript types for your projects.

Installation

Install the CLI locally in your project:

# npm
npm install --save-dev @bucketco/cli

# yarn
yarn add --dev @bucketco/cli

Quick Start

The fastest way to get started is with the new command, which initializes everything at once:

# npm
npx bucket new

# yarn
yarn bucket new

Basic Commands

If you prefer more control, you can use the individual commands:

# Initialize Bucket in your project
npx bucket init

# Create a new feature
npx bucket features create "My Feature"

# Generate TypeScript types for your features
npx bucket features types

Configuration

The CLI creates a bucket.config.json file in your project directory when you run bucket init. Here's the structure:

{
  "$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"
    }
  ]
}

Configuration Options

  • $schema: Autocompletion for the config (can use a specific version instead of latest)
  • baseUrl: Base URL for Bucket services
  • apiUrl: API URL for Bucket services (overrides baseUrl for API calls)
  • 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

Detailed Command Reference

Initialization and Setup

# Initialize a new Bucket configuration
npx bucket init [--overwrite] [--app-id <id>] [--key-format <format>]

# Quick start command that combines init, feature creation, and type generation
npx bucket new "My Feature" [--app-id ap123456789] [--key my-feature] [--key-format custom] [--out gen/features.ts] [--format react]

# Log in to your Bucket account
npx bucket login

# Log out from your Bucket account
npx bucket logout

Feature Management

# Create a new feature
npx bucket features create "My Feature" [--app-id ap123456789] [--key my-feature] [--key-format custom]

# List all features for the current app
npx bucket features list [--app-id ap123456789]

# Generate TypeScript types for your features
npx bucket features types [--app-id ap123456789] [--out gen/features.ts] [--format react]

Company Management

# List all companies in your app
npx bucket companies list [--filter <text>] [--app-id ap123456789]

# Grant or revoke feature access for companies, segments, and users
npx bucket companies features access [--app-id ap123456789] [featureKey] [--enable|--disable] [--companies <id...>] [--segments <id...>] [--users <id...>]

AI Integration

Adding AI Rules

Setup rules to help AI tools understand your Bucket feature flags:

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

Model Context Protocol Setup

Configure your editor or AI client to connect with Bucket's remote MCP server:

npx bucket mcp [--app-id <id>] [--editor <editor>] [--scope <local|global>]

Supported editors/clients:

  • Cursor IDE
  • Visual Studio Code
  • Claude Desktop
  • Windsurf

The command guides you through selecting which editor to configure, which app to connect to, and whether to use global or project-local configuration.

Global Options

These options work with all commands:

  • --debug: Enable 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

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later