Setup guide
Feature flags from your AI agent
Railflag's MCP server lets Claude Code, Cursor, VS Code and Windsurf create flags, change targeting, roll out to a percentage of users and migrate flags from other tools. Production changes still wait for a person.
The Model Context Protocol (MCP) is an open standard that lets AI agents call tools in other systems. Railflag runs a hosted MCP server at https://mcp.railflag.com/mcp, included on every plan.
What your agent can do
| Area | Tools | For example |
|---|---|---|
| Flags | list_flags, get_flag, create_flag, toggle_flag | "Create a flag for the new checkout and turn it on in Staging." |
| Targeting and rollouts | update_targeting, set_rollout, list_environments | "Roll new-checkout out to 10% of users in Production." |
| History and approvals | get_history, get_change_request | "Who changed the pricing flag last week, and why?" |
| Release Watch | suggest_watch_plan, get_watch, list_watches, stop_watch, monitoring_coverage, connect_monitoring | "What should we monitor while this rollout runs?" |
| Migration | connect_source, scan_source, plan_migration, apply_plan, get_code_guide and more | "Import our Unleash flags into Development, then update the SDK calls in this repo." |
Step 1: create an access token
In the dashboard, open Settings → Access tokens and create a token. Choose read only if the agent should look but not change anything. The token is shown once and starts with rf_pat_.
The dashboard also shows a ready-made Claude Code command with your token filled in.
Step 2: add the server to your tool
Claude Code
claude mcp add --transport http railflag https://mcp.railflag.com/mcp \
--header "Authorization: Bearer rf_pat_…"
Cursor
Add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project:
{
"mcpServers": {
"railflag": {
"url": "https://mcp.railflag.com/mcp",
"headers": { "Authorization": "Bearer rf_pat_…" }
}
}
}
VS Code (GitHub Copilot agent mode)
Add this to .vscode/mcp.json. VS Code asks for the token once and stores it securely, so it never lands in the repository:
{
"inputs": [
{ "type": "promptString", "id": "railflag-token", "description": "Railflag access token", "password": true }
],
"servers": {
"railflag": {
"type": "http",
"url": "https://mcp.railflag.com/mcp",
"headers": { "Authorization": "Bearer ${input:railflag-token}" }
}
}
}
Windsurf
Add this to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"railflag": {
"serverUrl": "https://mcp.railflag.com/mcp",
"headers": { "Authorization": "Bearer rf_pat_…" }
}
}
}
Other MCP clients work the same way: a remote server over Streamable HTTP at https://mcp.railflag.com/mcp, with the header Authorization: Bearer <token>.
Production stays under human review
- Approvals: in environments that require approval, usually Production, an agent's change becomes a change request. The agent gets a link and gives it to you; nothing changes until a person approves it.
- Audit log: every change records the agent and the person it acts for, for example "Claude Code via MCP for Maria K.".
- No lost edits: targeting changes carry the version they were based on, so an agent can't overwrite a change someone else made in the meantime.
- Read-only tokens for agents that should only answer questions.
- Read-only migrations: when importing from Unleash or AB Tasty, Railflag only reads from the other tool and never writes to it.
Prompts to try
- "List the flags that are on in Staging but off in Production."
- "Create a boolean flag
new-search, turn it on for users whose email ends in @ourcompany.com in Production." - "Roll
new-checkoutout to 25% of users, and suggest what to monitor while it runs." - "Connect our Unleash instance, scan it, and import everything into Development. Tell me about any rule that can't be translated."
- "Rewrite the Unleash SDK calls in this repository to OpenFeature with Railflag."
Frequently asked questions
- Can an AI agent change Production flags on its own?
- No. In environments that require approval, such as Production, a change from an agent becomes a change request with a link. It applies only after a person opens the link and approves it.
- Does the Railflag MCP server cost extra?
- No. The MCP server is included on every plan, including the free Starter plan.
- Which AI tools work with it?
- Any MCP client that supports remote servers over Streamable HTTP with a custom Authorization header, including Claude Code, Cursor, VS Code with GitHub Copilot and Windsurf.
- Can I give the agent read-only access?
- Yes. Create a read-only access token in the dashboard. The agent can then list flags, read targeting and history, but every change is refused.
Give your agent feature flags
Create a free account, make an access token, and paste one command. Approvals, the audit log and the MCP server are included on every plan.
Start for free