Get started
Back to blog

Feature flags are one of the few places where developers still context-switch away from their editor — you type the flag name in code, then jump to a dashboard to flip it, or paste a CLI command from a README.

Today we’re shipping @flagify/mcp, a Model Context Protocol server that closes that gap. Any MCP-compatible host — Claude Desktop, Claude Code, Cursor, Zed, Windsurf — can read and change your Flagify flags in the same conversation where you’re writing the code behind them.

What changed

Until today, Flagify’s AI integration was static. The flagify ai-setup command writes CLAUDE.md, .cursorrules, and Copilot instructions so your editor’s agent understands your flag conventions when it generates code. That’s useful, but it’s one-way: the agent writes code, then you take over to actually flip the flag.

MCP adds the runtime layer. The same agent can now call list_flags, create_flag, toggle_flag, update_targeting_rules, and get_audit_log directly. No copy-paste. No tab switch.

The 12 tools

ToolWhat it does
list_flagsEvery flag in the current project with per-env state
get_flagOne flag in detail (fuzzy match on key or name)
list_environmentsEnvironment catalog for the project
list_segmentsReusable user cohorts
get_targeting_rulesOrdered rules for a flag in an environment
get_audit_logWorkspace audit stream with filters + cursor
create_flagNew flag (kebab-case key enforced)
update_flagName / description / default / off value
delete_flagArchive a flag (soft-delete)
toggle_flagEnable/disable, rollout %, value override
update_targeting_rulesReplace the full rule list for flag+env
pingHealth check

Mutations carry the MCP destructiveHint: true annotation, so hosts flag them in their consent prompt. Every change lands in your audit log with source: "mcp", so MCP-driven edits are one filter away from CLI or console ones.

Install in under a minute

The server reads your JWT from ~/.flagify/config.json. That’s the same file the Flagify CLI writes on flagify auth login, so if you’ve used the CLI, you’re already authenticated.

If you haven’t:

npm install -g @flagify/cli
flagify auth login
flagify projects pick

Then point your host at @flagify/mcp. For Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "flagify": {
      "command": "npx",
      "args": ["-y", "@flagify/mcp"]
    }
  }
}

Quit Claude Desktop (Cmd+Q) and reopen. That’s it — the flagify server shows up with 12 tools.

For other hosts (Claude Code, Cursor, Zed, Windsurf), the config shape is the same. Full per-host snippets are on the integration page.

What this feels like in practice

A few prompts that now work end-to-end:

  • “Create a boolean flag new-checkout-flow and turn it on in staging.”
    The agent calls create_flag, waits for your confirm, then toggle_flag. Reports back when both succeed.

  • “Which flags are still off in production?”
    list_flags → client-side filter → plain-text answer. No card UI, no dashboard.

  • “Something changed on payments-v2 last night — who did it?”
    get_audit_log with resource_type=flag and a time filter. The agent points at the exact event.

  • “Roll out dark-mode to 25% in prod.”
    One toggle_flag call. Host confirms because it’s destructive. Done.

Auth, tokens, and why API keys don’t work here

The MCP server only accepts JWTs. Flagify’s pk_* / sk_* API keys are rejected at startup — those are scoped to flag evaluation and can’t manage flags. The server catches them before the first tool call and tells you to run flagify auth login instead of producing a confusing 403 down the road.

When the access token expires, the server silently refreshes via /v1/auth/refresh, persists the rotated pair back to the config file, and retries. You don’t see a prompt; it just keeps going.

Why we built it

No other feature flag platform has an MCP server yet. LaunchDarkly, Statsig, Unleash, PostHog — all of them let you talk to their API, but none of them ship a stdio binary that Claude Desktop can plug into in one config line.

That gap won’t stay open for long. Shipping first matters for us because Flagify’s wedge has always been developer ergonomics — install in 2 minutes, not 2 weeks. Making the agent a first-class actor is the next step.

What’s next

V1 covers the tools a developer actually reaches for. V2 priorities, in rough order:

  • A login tool that triggers the browser-loopback flow on first use, for people who skip the CLI.
  • A batch archive_flags for cleanup sessions.
  • HTTP+SSE transport for remote MCP hosts (only ~10% of users today, but the curve is moving).
  • A Personal Access Token flow so CI jobs can use MCP without a browser.

If there’s an MCP tool you want that isn’t on that list, open an issue.

Try it

Pair it with flagify ai-setup for the static context, and your editor’s agent is now a first-class flag operator.