FlagdeckFlagdeck
Pricing
Docs
Get Started

Documentation

MCP Server

The Flagdeck MCP (Model Context Protocol) server lets AI coding assistants, including Claude, Cursor, VS Code, and more, manage your feature flags using natural language, directly from your editor.

Install in Cursor

Install in VS Code

Quick Start

You'll need a Flagdeck API key.

Claude Code (CLI)

bash

claude mcp add --transport stdio flagdeck \
  --env FLAGDECK_API_KEY=your-api-key \
  -- npx -y @flagdeck/mcp-server

Claude Desktop

Add to claude_desktop_config.json:

json

{
  "mcpServers": {
    "flagdeck": {
      "command": "npx",
      "args": ["-y", "@flagdeck/mcp-server"],
      "env": {
        "FLAGDECK_API_KEY": "your-api-key"
      }
    }
  }
}

Cursor IDE

Click the Install in Cursor button above, or add manually to .cursor/mcp.json:

json

{
  "mcpServers": {
    "flagdeck": {
      "command": "npx",
      "args": ["-y", "@flagdeck/mcp-server"],
      "env": {
        "FLAGDECK_API_KEY": "your-api-key"
      }
    }
  }
}

VS Code

Click the Install in VS Code button above. VS Code will prompt you for your API key.

Or add manually to your MCP config:

json

{
  "mcp": {
    "servers": {
      "flagdeck": {
        "command": "npx",
        "args": ["-y", "@flagdeck/mcp-server"],
        "env": {
          "FLAGDECK_API_KEY": "your-api-key"
        }
      }
    }
  }
}

Example Usage

Once installed, just talk to your AI assistant:

code

You: "Create a dark mode feature flag"
AI: Done! I've created the dark-mode flag (boolean, default false).

You: "Roll it out to 25% of users"
AI: Updated! dark-mode now has a 25% rollout.

You: "Check if it's enabled for [email protected]"
AI: Yes, dark-mode is enabled for that user (matched rollout).

Available Tools

The server provides 23 tools across four categories:

Project & Environment Management

ToolDescription
list_projectsList all projects accessible to your API key
get_projectGet details of a specific project
list_environmentsList all environments in a project

Flag Management

ToolDescription
list_flagsList flags, optionally filtered by status or search term
get_flagGet details of a specific flag by ID or key
create_flagCreate a new feature flag
update_flagUpdate an existing flag
delete_flagPermanently delete a flag
toggle_flagToggle a flag between active and inactive
archive_flagArchive a flag (soft delete)

Flag Evaluation

ToolDescription
evaluate_flagEvaluate a flag for a specific user/context
evaluate_batchEvaluate multiple flags at once

Code References & Cleanup

ToolDescription
get_flag_code_referencesList where a flag is referenced in code, with a per-branch breakdown
report_code_referencesReport scan results for a repository and branch (used by the CLI and the GitHub Action)
get_flag_healthLifecycle health for every flag: active, stale, inactive, new, or safe to remove

See Code references for how scanning and the "safe to remove" verdict work.

Configuration

VariableRequiredDefaultDescription
FLAGDECK_API_KEYYes-Your Flagdeck API key (resolves the project and environment)

Troubleshooting

"FLAGDECK_API_KEY is required": Set your API key in the MCP server env config.

"projectId is required": The API key context could not be resolved at startup. Check that FLAGDECK_API_KEY is valid. To act on a different project, name it per-request: "List flags in project proj-123".

Connection errors: Verify the Flagdeck API is reachable (curl https://api.flagdeck.com/health) and that your network allows outbound HTTPS.

Tool not found: Ensure you're using a compatible MCP client and the server started successfully. Check your client's MCP logs.