API
AI assistants (MCP)
Ask Claude, Cursor or another MCP client about results, and let it manage flags.
The LiftCanary MCP server lets Claude, Cursor and other AI assistants that speak the Model Context Protocol read your experiment results and manage feature flags. Ask in plain words:
- “How is the one-page checkout test doing? Can we ship it?”
- “Which experiments are running in production, and which are winning?”
- “Is the new checkout better on mobile?”
- “Turn off
new_checkoutin production.” - “Who changed the pricing flag yesterday?”
Results reach the assistant with their lift, confidence interval, significance and verdict, plus warnings such as a sample ratio mismatch, and the server tells it never to call a winner from an inconclusive result.
Set up#
Create an API token under Settings → API tokens. A viewer token can only read, which is all most people need; use an editor token if the assistant may switch flags and stop experiments. Then add the server to your client:
claude mcp add --transport stdio liftcanary --env LIFTCANARY_API_TOKEN=sk_... -- npx -y @liftcanary/mcpClaude Desktop reads claude_desktop_config.json (Settings → Developer → Edit config); Cursor reads ~/.cursor/mcp.json or a project's .cursor/mcp.json; VS Code reads .vscode/mcp.json and asks for the token instead of storing it. The server needs Node.js 18 or later.
Settings#
| Variable | What it does |
|---|---|
LIFTCANARY_API_TOKEN | Required. An API token (sk_…); the server can do what its role allows. |
LIFTCANARY_PROJECT | Project key used when a request names none. Not needed when the organization has a single project. |
LIFTCANARY_READ_ONLY | 1 offers only the tools that read, whatever the token's role. |
LIFTCANARY_API_URL | Default https://api.liftcanary.com; your own address when self-hosting. |
Tools#
| Tool | What it does |
|---|---|
list_projects | Projects and their environments. |
list_flags | Flags with their kind and whether each environment has them on; optional search. |
get_flag | One flag: variations, variables and targeting in every environment. |
list_experiments | Experiments, newest first, with the headline result on the primary goal; optional status filter. |
get_experiment_results | Every goal with values, lift, interval, significance and verdict; guardrails, the funnel and warnings. |
get_experiment_breakdown | One goal split by an attribute such as device or country, tested at a stricter level per segment. |
list_goals | Goals with recent event counts, and tracked events without a goal. |
list_audiences | Saved audiences and their conditions. |
get_usage | Tested visitors this month against the plan. |
get_audit_log | Recent changes: who changed what, and when. |
set_flag_enabled | The kill switch: a flag on or off in one environment, keeping its rules. |
create_flag | A boolean or multivariate flag, off everywhere. |
create_goal | A goal for an event, with its type and whether more or less is better. |
start_experiment | Starts a draft. |
stop_experiment | Ends a running experiment, optionally giving everyone in its audience one variation. |
The last five change your configuration: MCP clients ask before running them, stop_experiment is marked as destructive, and LIFTCANARY_READ_ONLY=1 leaves them out. Experiments can be named (“the checkout test”) instead of passing their id; when a name matches several, the assistant is told which. The review_experiment prompt (in Claude Code, /mcp__liftcanary__review_experiment) reads an experiment's results and recommends shipping, continuing or stopping.
Try it without a client#
The MCP Inspector lists the tools and lets you call them by hand:
LIFTCANARY_API_TOKEN=sk_... npx @modelcontextprotocol/inspector npx -y @liftcanary/mcp