Documentation
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.
You'll need a Flagdeck API key.
bash
claude mcp add --transport stdio flagdeck \
--env FLAGDECK_API_KEY=your-api-key \
-- npx -y @flagdeck/mcp-server
Add to claude_desktop_config.json:
json
{
"mcpServers": {
"flagdeck": {
"command": "npx",
"args": ["-y", "@flagdeck/mcp-server"],
"env": {
"FLAGDECK_API_KEY": "your-api-key"
}
}
}
}
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"
}
}
}
}
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"
}
}
}
}
}
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).
The server provides 23 tools across four categories:
| Tool | Description |
|---|---|
list_projects | List all projects accessible to your API key |
get_project | Get details of a specific project |
list_environments | List all environments in a project |
| Tool | Description |
|---|---|
list_flags | List flags, optionally filtered by status or search term |
get_flag | Get details of a specific flag by ID or key |
create_flag | Create a new feature flag |
update_flag | Update an existing flag |
delete_flag | Permanently delete a flag |
toggle_flag | Toggle a flag between active and inactive |
archive_flag | Archive a flag (soft delete) |
| Tool | Description |
|---|---|
evaluate_flag | Evaluate a flag for a specific user/context |
evaluate_batch | Evaluate multiple flags at once |
| Tool | Description |
|---|---|
get_flag_code_references | List where a flag is referenced in code, with a per-branch breakdown |
report_code_references | Report scan results for a repository and branch (used by the CLI and the GitHub Action) |
get_flag_health | Lifecycle 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.
| Variable | Required | Default | Description |
|---|---|---|---|
FLAGDECK_API_KEY | Yes | - | Your Flagdeck API key (resolves the project and environment) |
"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.