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
10.2K downloads
10 stars

Bucket CLI is a command-line interface tool for managing feature flags and interacting with Bucket services. It allows you to create, manage, and implement feature flags directly from your terminal while providing TypeScript type generation to ensure type safety in your applications.

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 using the new command from your project's root directory. This initializes the CLI, creates a feature, and generates types all at once:

# npm
npx bucket new

# yarn
yarn bucket new

Configuration

The CLI creates a bucket.config.json file in your project when you run bucket init. This file contains all necessary settings for your Bucket integration.

Configuration Options

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

Basic Commands

Initialization

npx bucket init [--overwrite]

Options:

  • --overwrite: Overwrite existing configuration file
  • --app-id <id>: Set the application ID
  • --key-format <format>: Set the key format for features

Authentication

# Login to your Bucket account
npx bucket login

# Logout from your Bucket account
npx bucket logout

Feature Management

Create a Feature

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

List Features

npx bucket features list [--app-id ap123456789]

Generate Types

npx bucket features types [--app-id ap123456789] [--out gen/features.ts] [--format react]

Company Management

List Companies

npx bucket companies list [--filter <text>] [--app-id ap123456789]

Manage Feature Access

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

Example:

# Enable feature for multiple companies and users
npx bucket companies features access my-feature --enable --companies comp_123 --companies comp_456 --users user_789

Model Context Protocol (MCP)

The Model Context Protocol provides a way to connect AI models with your feature flags for enhanced AI-assisted development.

Starting the MCP Server

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

Options:

  • --port: Port to run the SSE server on (defaults to 8050, "auto" for random port)
  • --app-id: App ID to use

Connecting to MCP

Server-Side Events (SSE) Configuration

{
  "mcpServers": {
    "Bucket": {
      "url": "http://localhost:8050/sse"
    }
  }
}

STDIO Proxy Configuration

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

Cursor IDE Integration

  1. Open Cursor IDE
  2. Go to Settings > MCP
  3. Click Add new global MCP server and paste the SSE config
  4. Save and go back to Cursor

Claude Desktop Integration

  1. Open Claude Desktop
  2. Go to Settings > Developer
  3. Click Edit config and paste the STDIO config
  4. Save and restart Claude Desktop

AI-Assisted Development

Set up AI-specific rules for your project with:

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

Options:

  • --format: Format to add rules in (cursor or copilot)
  • --yes: Skip confirmation prompts

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