The Unleash MCP server connects Cursor to your Unleash instance, enabling AI-assisted feature flag management. You can evaluate code changes, create flags, generate wrapping code, manage rollouts, and clean up flags from within Cursor’s AI-first development environment.
Cursor supports MCP across two interfaces:
agent commandCursor’s IDE-native primitives create a layered automation system for feature flags: Rules encode your team’s conventions, Hooks validate MCP operations before they execute, Skills orchestrate multi-step workflows, and Plugins bundle everything for team distribution.
Before you begin, make sure you have the following:
The Unleash MCP server runs as a local stdio process. Configuration differs between the IDE and CLI, but both use the same npm package and credentials.
First, create a credentials file:
Now configure your preferred interface:
Requirements: Cursor installed.
You can add the Unleash MCP server with a one-click install from cursor.directory or by creating the configuration file manually.
The Unleash MCP server is listed on cursor.directory.
Click Add to Cursor on the listing page, or open this link directly.
Cursor opens and pre-fills the MCP server configuration. The installer prompts you for your UNLEASH_BASE_URL and UNLEASH_PAT values.
The one-click flow writes credentials directly into .cursor/mcp.json. This is fine for personal use, but for team projects you should replace the inline values with an envFile reference so the configuration file is safe to commit. See the “Create file manually” tab for details.
Configuration scopes:
Both are merged; project takes precedence on conflict. For team collaboration, use the project-level file.
Cursor uses its own .cursor/mcp.json location with the "mcpServers" root key. This differs from VS Code’s .vscode/mcp.json with a "servers" root key. If you are migrating from VS Code, update the file location and root key.
The Unleash MCP server exposes the following tools.
| Tool | Description | When to use |
|---|---|---|
evaluate_change | Analyzes a code change and determines whether it should be behind a feature flag. | Before implementing risky changes |
detect_flag | Searches for existing flags that match a description to prevent duplicates. | Before creating new flags |
create_flag | Creates a new feature flag with proper naming, typing, and metadata. | When no suitable flag exists |
wrap_change | Generates framework-specific code to guard a feature behind a flag. | After creating a flag |
list_projects | Lists Unleash projects available to the configured token, with optional pagination. | Discovering available projects |
list_flags | Lists feature flags in a project (active by default; set archived=true for archived flags). | Auditing flag inventory; discovering existing flags before creating new ones |
get_flag_state | Returns the current state, strategies, and metadata for a flag. | Debugging, status checks |
set_flag_rollout | Configures rollout percentages and activation strategies. | Gradual releases |
toggle_flag_environment | Enables or disables a flag in a specific environment. | Testing, staged rollouts |
remove_flag_strategy | Deletes a rollout strategy from a flag. | Simplifying flag configuration |
cleanup_flag | Returns file locations and instructions for removing a flag after rollout. | After full rollout |
The Unleash MCP server supports these core workflows: evaluate and wrap code in feature flags, discover and audit flags, manage rollouts across environments, and clean up after rollout. Cursor adds another workflow unique to its architecture: Rules-guided flag evaluation.
Use this workflow when implementing a change that might affect production stability, such as a payment integration, authentication flow, or external API call.
Tell the agent what you are working on:
The agent calls evaluate_change and returns a recommendation with a suggested flag name.
The agent automatically calls detect_flag to search for existing flags.
If a suitable flag exists, the agent suggests reusing it instead of creating a duplicate.
Use this workflow to automate flag evaluation based on encoded policies. When a glob-scoped Rule targets a high-risk directory, the agent evaluates risk without the developer explicitly asking.
Create a glob-scoped Rule targeting your high-risk domain (see Rule templates below for a complete example):
Save as .cursor/rules/payments-flags.mdc with a glob pattern like src/payments/**/*.ts.
Rules-guided evaluation catches risk during implementation rather than during code review. The flag becomes part of the development flow, not an afterthought.
Use this workflow to enable a flag in staging for testing while keeping it disabled in production.
The agent calls get_flag_state and returns the flag metadata, enabled environments, and active strategies.
AI assistants can make mistakes and toggle the wrong flag. Enable change requests on production environments to require human approval before changes take effect. See the MCP server documentation for details.
Use this workflow when a feature has been fully rolled out and the flag is no longer needed.
The agent calls cleanup_flag and returns:
Review the list, remove the conditional branches, and delete the flag from Unleash.
Feature flags should be temporary. Regularly clean up flags after successful rollouts to prevent technical debt.
Use this workflow to take inventory of existing flags before creating new ones, or to run a periodic audit for cleanup candidates.
If you don’t already know the target project, the agent calls list_projects to enumerate projects the configured token can access. Skip this step if UNLEASH_DEFAULT_PROJECT is set.
The agent calls list_flags with the target projectId. The default response returns active (non-archived) flags only.
For a full audit, the agent calls list_flags a second time with archived=true. Active and archived flags are disjoint result sets in Unleash; both calls are needed for complete inventory.
The agent compares the returned flags against references in your code. Flags present in Unleash but unused in code (especially archived ones) are cleanup candidates — chain into the Clean up after rollout workflow to remove them safely.
Cursor Rules encode your team’s FeatureOps policies, so the agent considers feature flags automatically.
Store them in .cursor/rules/ as .mdc files with YAML frontmatter.
For more details on Rules, see the Cursor Rules documentation.
This Rule loads into every agent session. Use it for organization-wide flag standards.
This Rule loads only when the agent works with files matching the glob pattern. Use it for high-risk domains that always require flags.
This Rule loads automatically when the agent detects the conversation is about rollout strategies.
Hooks automate validation and auditing of MCP operations.
Store them in .cursor/hooks.json at your project root.
For more details on hooks, see the Cursor Hooks documentation.
This hook fires before any Unleash MCP tool call. If the tool is create_flag, it checks the flag name against your naming convention and blocks requests that violate it.
Hooks can return allow, deny, or ask to control flow. They default to fail-open but can be configured with failClosed: true for strict enforcement. Enterprise teams can distribute hooks via the web dashboard; they sync to all team members automatically.
This hook fires after every Unleash MCP tool call and logs the operation for audit purposes.
A plugin bundles MCP tools, Rules, Skills, and Hooks into a single installable package. The Unleash plugin is the recommended way to distribute the integration across teams and projects.
Skills are invoked with /skill-name in chat or discovered automatically by the agent when the context is relevant.
~/.cursor/plugins/local/unleash-featureops:For more details on creating and distributing plugins, see the Cursor Plugins documentation.
The following prompt patterns help you use the MCP tools effectively.
Intent: Determine if a change requires a feature flag, then create and wrap it.
Prompt:
Expected behavior: The agent calls evaluate_change, then detect_flag, create_flag, and wrap_change as needed.
Intent: Avoid duplicate flags when similar functionality exists.
Prompt:
Expected behavior: The agent calls detect_flag and presents matches with confidence levels.
Intent: Enable, disable, or query a flag in a specific environment.
Prompts:
Expected behavior: The agent calls toggle_flag_environment or get_flag_state.
Intent: Safely remove flagged code and delete unused flags.
Prompts:
Expected behavior: The agent calls cleanup_flag and provides removal instructions.
Intent: Automatically evaluate code changes based on encoded policies.
Trigger: A glob-scoped Rule (e.g., targeting src/payments/**) loads when the agent works with matching files.
Expected behavior: The Rule instructs the agent to call evaluate_change whenever it modifies files in the target domain. If a flag is needed, the agent notifies you and offers to create it.
Intent: Run a multi-step FeatureOps workflow using a skill.
Prompt:
Expected behavior: The skill orchestrates the full workflow: evaluate the current changes, check for duplicates, create the flag if needed, wrap the code, and suggest a rollout strategy. Each step calls the appropriate MCP tool.
Intent: Evaluate and flag changes from the terminal.
Prompts:
Expected behavior: The CLI agent uses the same MCP tools as the IDE. In non-interactive mode (-p), the agent outputs results and exits.
Cursor provides enterprise controls relevant to MCP server deployment.
For MCP server governance, commit .cursor/mcp.json and .cursor/hooks.json to version control. This ensures all team members use the same MCP servers with the same validation rules.
Use tool approval prompts for write operations like create_flag and toggle_flag_environment.
Auto-run is appropriate for read-only operations like get_flag_state, detect_flag, and evaluate_change.
.cursor/mcp.json for syntax errors.cursor/${env:NAME} syntax (not ${NAME} or ${VAR})echo $UNLEASH_BASE_URLenvFile, verify the file path is correct and the file existsUNLEASH_BASE_URL does not include /api at the endcurl -H "Authorization: $UNLEASH_PAT" "$UNLEASH_BASE_URL/api/admin/projects".cursor/hooks.json exists and contains valid JSONmatcher pattern matches the expected tool (e.g., MCP:unleash)chmod +x .cursor/hooks/validate-flag-name.shLocal servers using npx require Node.js 18+. Verify with node --version. If Node.js is installed but not found by Cursor, check that the IDE inherits your shell PATH.
By default, the agent requests approval before executing MCP tools. Configure auto-run in Settings or use ~/.cursor/permissions.json for granular control. In the CLI, use --approve-mcps.
agent mcp list may show “not loaded (needs approval)” even after running agent mcp enable. This is expected. MCP servers are lazy-loaded and only start when an agent session begins. Start an interactive session with agent --approve-mcps to auto-approve, or approve the server when prompted during your first session. Once approved, subsequent sessions load the server automatically.
Cloud Agents access MCP servers configured for the team. Ensure the Unleash MCP server is configured at the team level and credentials are set in the Cloud Agent Secrets tab.
Use envFile for simplicity. Use ${env:NAME} interpolation if you need per-variable control or mixing environment sources. Don’t use both for the same variable.
Follow these guidelines for effective feature flag management with Cursor.
While the MCP server can automate flag creation, high-risk changes should involve human review. Use tool approval prompts for flag creation, rollout plans, and cleanup decisions.
Establish organization-wide standards for flag names (e.g., domain-feature-variant) and types. Encode these in Rules so the agent applies them automatically.
Always use detect_flag before creating new flags. This keeps naming consistent and reduces fragmentation across services.
Feature flags should be removed after successful rollouts. Use cleanup_flag regularly to prevent technical debt.
Configure MCP servers at project scope (.cursor/mcp.json) and commit to version control. All team members get the same configuration.
Write your feature flag guidelines in Rules with appropriate application modes. The agent reads these Rules and applies the guidance automatically based on context.