MCP Server for managing Flagr feature flags via Cursor IDE
npm install flagr-mcpA Model Context Protocol (MCP) server for managing Flagr feature flags via Cursor IDE.
- List and inspect flags - View all flags, filter by key/tags/enabled status
- Create flags - Create new feature flags with descriptions and tags
- Manage segments - Add segments with rollout percentages
- Add constraints - Target specific users by role, userId, environment, etc.
- Set distributions - Configure A/B test percentages
Add to your ~/.cursor/mcp.json:
``json`
{
"mcpServers": {
"flagr": {
"command": "npx",
"args": ["-y", "flagr-mcp"],
"env": {
"FLAGR_URL": "https://your-flagr-instance.com"
}
}
}
}
Replace https://your-flagr-instance.com with your Flagr API URL.
| Tool | Description |
|------|-------------|
| list_flags | List all flags with optional filters (enabled, key, tags) |get_flag
| | Get detailed info about a specific flag |create_flag
| | Create a new feature flag |update_flag
| | Update flag properties (enable/disable, description) |delete_flag
| | Delete a feature flag |create_segment
| | Add a segment to a flag |update_segment
| | Update segment properties |delete_segment
| | Remove a segment |create_constraint
| | Add a constraint to a segment |delete_constraint
| | Remove a constraint |create_variant
| | Add a variant to a flag |delete_variant
| | Remove a variant |set_distribution
| | Set variant distribution percentages |
Once configured, you can ask Cursor things like:
- "List all feature flags"
- "Create a flag called NewFeature with description 'My new feature'"
- "Add a segment to NewFeature for admin users with 100% rollout"
- "Enable flag NewFeature"
| Operator | Description | Example |
|----------|-------------|---------|
| EQ | Equals | role EQ "admin" |NEQ
| | Not equals | environment NEQ "production" |IN
| | In list | userId IN "123,456,789" |NOTIN
| | Not in list | userId NOTIN "123" |CONTAINS
| | Contains substring | email CONTAINS "@example" |EREG
| | Regex match | userId EREG "^user_.*" |GT
| , GTE, LT, LTE | Numeric comparisons | priority GTE "2" |
| Variable | Required | Description |
|----------|----------|-------------|
| FLAGR_URL | Yes | Flagr API base URL (e.g., https://flagr.example.com`) |
MIT