Unleash MCP Server
OfficialThis server lets AI agents manage Unleash feature flags and integrate flag-aware workflows into code changes.
Discover and inspect flags, projects, segments, context fields, tags, environments, exposure metrics, audit history, and Unleash documentation.
Create, configure, enable/disable, roll out, experiment with, kill-switch, archive/revive, and otherwise manage feature flags, including change requests where required.
Evaluate whether code changes need flags, detect existing flags, generate flag-wrapping guidance across languages/frameworks, and clean up flags while preserving the chosen code path.
Manage rollout strategies and variants, list flags/projects, read flag state, remove strategies, configure contexts/segments/tags/templates/projects, and send optional feedback.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Unleash MCP Server create a new feature flag for the dark mode rollout"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Unleash MCP server
An MCP server that lets AI agents work with Unleash the way you'd work in the Unleash UI: find flags, roll them out, check who gets them, and see what changed. It's in alpha and isn't published to npm, so you run it from source.
Tools
Tool | Description | Example prompt |
| Find projects, flags, segments, context fields, tags, tag types, flag creators, release templates, event types and environments by name. | "Which flags in the checkout project are tagged team:payments?" |
| Read a project, flag, context field or segment in full, or a flag's exposure metrics in an environment. | "Show me everything about the new-checkout flag." |
| Tell whether a flag is enabled, disabled or unknown for a context in an environment. | "Does user 42 get new-checkout in production?" |
| Turn a flag on for audiences, split by value or through a release template, or turn it off. Creates the flag if it doesn't exist. Opens a change request where the environment requires one. | "Roll out new-checkout to 10% of users in production." |
| Turn a permanent kill switch on or off, for everyone or chosen audiences. Creates the switch if it doesn't exist. Opens a change request where the environment requires one. | "Turn off payments in production." |
| Run an A/B test: give audiences values such as control and treatment, by share or one each, or stop it. Creates a missing flag. Opens a change request where the environment requires one. | "Split checkout 50/50 between control and the new flow." |
| Define flags, set a parent dependency, mark flags completed, archive and revive them. Doesn't delete flags. | "Archive the old-banner flag." |
| Change context fields and their legal values, segments, tag types and tags, release templates and projects. | "Create a beta-testers segment for userId 1, 2 and 3." |
| Read what changed, who changed it and when, over at most 31 days. | "What changed in production yesterday?" |
| Answer questions about feature flag practices and Unleash itself from the current Unleash documentation. | "How should I clean up old flags?" |
| Report to Unleash where the server fell short. Asks you first, unless | None: the agent calls it on its own. |
Related MCP server: OpenFeature MCP Server
Install locally
You need Node 24 or later and pnpm.
Clone the repository and switch to the
v2branch:git clone https://github.com/Unleash/unleash-mcp.git cd unleash-mcp git checkout v2This gets you the v2 source.
Install the dependencies:
pnpm installNode runs the TypeScript source directly, so there's no build step.
In Unleash, create a personal access token under Profile > Personal API tokens. The server acts with that user's permissions.
Register the server with your MCP client. For Claude Code:
claude mcp add unleash \ -e UNLEASH_BASE_URL=https://your-instance.getunleash.io \ -e UNLEASH_PAT=user:your-personal-access-token \ -- node /absolute/path/to/unleash-mcp/src/index.tsThis adds a stdio server named
unleashto Claude Code. For clients configured with JSON, such as Claude Desktop, Cursor or VS Code, add this to their MCP servers:{ "mcpServers": { "unleash": { "command": "node", "args": ["/absolute/path/to/unleash-mcp/src/index.ts"], "env": { "UNLEASH_BASE_URL": "https://your-instance.getunleash.io", "UNLEASH_PAT": "user:your-personal-access-token" } } } }Ask your agent "List my Unleash projects". If it answers with your projects, the server is running.
Configure the local server
Variable | Required | Description |
| Yes | URL of your Unleash instance, such as |
| Yes | Personal access token the server calls Unleash with. |
| No |
|
| No | Unleash instance that receives |
| No | Directory that keeps your answer, |
send_feedback sends anonymous reports to Unleash when the server fell short: a tool error, a request no tool supports, or a wrong result. A report names the tool, the error and the MCP client the agent runs in. Say yes to help us fix what doesn't work for you.
Nothing is sent until you agree. The first report asks you through your MCP client, and your answer is kept in feedback_consent.json, so you're asked once. The file sits in an unleash-mcp directory under $XDG_CONFIG_HOME when it's set, otherwise under ~/Library/Application Support on macOS, %APPDATA% on Windows and ~/.config on Linux. Delete it to be asked again.
If you dismiss the question, or your client can't show it, feedback stays off until the next session. OpenCode, Gemini and Antigravity never show it, so there feedback stays off unless UNLEASH_MCP_SEND_FEEDBACK is true.
To keep secrets out of your client config, copy .env.example to .env, fill it in, and start the server with node --env-file=.env /absolute/path/to/unleash-mcp/src/index.ts.
Connect to the remote server
Unleash Enterprise hosts this server, over Streamable HTTP, so nothing runs on your machine. An admin turns it on under Admin > Remote MCP Server; send_feedback reports are sent unless the admin turns them off there.
Register the server with your MCP client. For Claude Code:
claude mcp add unleash https://your-instance.getunleash.io/api/admin/mcp --transport httpFor Codex, add the server and then log in:
codex mcp add unleash --url https://your-instance.getunleash.io/api/admin/mcp
codex mcp login unleashThe login opens your browser to log in to Unleash; Claude Code does the same on first use. Unleash then creates a personal access token for the client, valid for 24 hours, and the server acts with your permissions.
Where a browser login isn't possible, such as in CI, send a personal access token of your own instead and no login happens:
claude mcp add unleash https://your-instance.getunleash.io/api/admin/mcp \
--transport http \
--header "Authorization: Bearer user:your-personal-access-token"Codex takes the token from an environment variable named in its config.toml, as bearer_token_env_var under [mcp_servers.unleash].
Development
Development setup: running tests and the dev server in Claude Code.
Decisions: why the server works the way it does.
Available Tools
11 toolscleanup_flagA
Remove a feature flag from the codebase while preserving the desired code path.
This tool provides comprehensive step-by-step instructions for safely removing feature flag code. It guides you through:
Finding all flag occurrences using Grep
Identifying different flag usage patterns (if-else, ternary, guards, etc.)
Removing flag checks while preserving the correct code path
Cleaning up unused imports and dead code
Verifying and testing the changes
When to use this tool:
After a feature flag has been rolled out to 100% and is no longer needed
When deprecating an experimental feature (preserve disabled path)
When cleaning up technical debt from old flags
After a kill switch is no longer necessary
Preserve Path Options:
"enabled": Keep code that runs when flag is true (most common for successful feature rollouts)
"disabled": Keep code that runs when flag is false (for removed experiments or kill switches)
If not provided: You will be instructed to ask the user which path to preserve
Workflow:
Call this tool with the flag name (optionally specify which path to preserve)
If preservePath not provided, you'll be instructed to ask the user via AskUserQuestion tool
Follow the returned instructions to search and remove flag code
Clean up imports and test the changes
Report summary of changes
Safety Features:
Comprehensive pattern identification (handles if-else, ternary, guards, etc.)
Language-agnostic guidance
Post-cleanup verification steps
Test execution reminders
Import cleanup guidance
This tool is inspired by the Unleash AI flag cleanup workflow used in production. See: https://github.com/Unleash/unleash/blob/main/.github/workflows/ai-flag-cleanup-pr.yml
Inputs: flagName (required), files, language, preservePath.
create_flagA
Create a new feature flag in Unleash.
This tool creates a feature flag with the specified configuration. Choose the appropriate flag type:
release: For gradual feature rollouts to users
experiment: For A/B tests and experiments
operational: For system behavior and operational toggles
kill-switch: For emergency shutdowns or circuit breakers
permission: For role-based access control
Best practices:
Use clear, descriptive names (e.g., "new-checkout-flow" not "flag1")
Write comprehensive descriptions explaining the flag's purpose
Choose the right type to signal intent and lifecycle
Plan for flag removal after successful rollout
See: https://docs.getunleash.io/topics/feature-flags/best-practices-using-feature-flags-at-scale
Inputs: name (required), type (required), description (required), projectId, +1 more.
detect_flagA
Discover existing feature flags in the codebase to prevent duplicates and encourage reuse.
This tool provides comprehensive search instructions for finding existing flags through multiple detection strategies:
File-based detection: Search in files being modified
Git history analysis: Find recently added flags
Semantic name matching: Match description to flag names
Code context analysis: Find flags near modification point
Use this tool when:
About to create a new feature flag
Evaluating whether a flag is needed
Want to check if similar functionality is already flagged
The tool returns detailed search instructions that guide you through:
Executing searches using Bash and Grep tools
Scoring candidates from multiple detection methods
Combining results to find the best match
Returning a confidence-scored recommendation
Workflow Integration: This tool is automatically called by 'evaluate_change' before recommending 'create_flag'. You can also call it directly when you want to search for existing flags.
Output: Returns markdown guidance with:
Step-by-step search instructions for each detection method
Scoring criteria and weight calculations
Expected JSON response format
Confidence level interpretation
After following the instructions and finding results, you should return a JSON object indicating whether a flag was found and, if so, its details with a confidence score.
Inputs: description (required), files, codeContext.
evaluate_changeA
Provides comprehensive guidance for evaluating whether code changes require feature flags.
This tool returns detailed evaluation guidelines including:
Workflow for systematic evaluation
Parent flag detection patterns (avoid nesting)
Risk assessment criteria
Code type evaluation (test, config, feature, etc.)
Decision tree logic
Best practices from Unleash documentation
MANDATORY next action instructions: Explicit tool call sequence (create_flag → wrap_change → implement)
Use this tool when:
Starting work on a new feature or change
Unsure if a feature flag is needed
Want guidance on rollout strategy
Need help choosing flag type
IMPORTANT WORKFLOW: When this tool determines a flag is needed, it provides explicit instructions to:
Call 'create_flag' tool to create the feature flag in Unleash
Call 'wrap_change' tool to get code wrapping guidance
Implement the wrapped code following the patterns
The tool returns markdown-formatted guidance that helps you make informed decisions and take the correct next actions.
Inputs: files, branch, riskLevel, repository, +2 more.
get_flag_stateB
Fetch the current feature flag metadata and environment strategies from the Unleash Admin API.
Inputs: featureName (required), projectId, environment.
list_flagsA
List feature flags in an Unleash project, with optional pagination and sort order. By default returns active flags only; set archived=true to list archived flags instead (active and archived flags are disjoint result sets in Unleash and cannot be combined in one response). Use this to discover flags before creating new ones, audit flag inventory for cleanup (call twice — once for active, once for archived), or scope a workflow to a specific project. Returns name, type, description, archived status, and URL for each flag.
Inputs: limit, order, offset, archived, +1 more.
list_projectsA
List Unleash projects available to the configured token, with optional pagination. Use this for discovery before scoping flag operations to a specific project. Returns project id, name, description, mode, creation time, and URL.
Inputs: limit, order, offset.
remove_flag_strategyA
Delete a strategy configuration from a feature flag environment. Use get_flag_state to discover strategy IDs before removal.
Inputs: strategyId (required), environment (required), featureName (required), projectId.
set_flag_rolloutA
Configure or update a flexibleRollout strategy for a feature flag environment with an optional rollout percentage and variants. This does NOT enable the feature; call toggle_flag_environment to turn environments on or off.
Inputs: environment (required), featureName (required), rolloutPercentage (required), title, +5 more.
toggle_flag_environmentA
Enable or disable a feature flag in a specific environment using the Unleash Admin API. For gradual rollouts, configure a flexibleRollout strategy first via set_flag_rollout.
Inputs: enabled (required), environment (required), featureName (required), projectId.
wrap_changeA
Generate code snippets and guidance for wrapping changes with feature flags.
⚠️ CRITICAL: This tool enforces RUNTIME-CONTROLLABLE feature flags. You MUST place flag checks INSIDE execution paths (handlers, functions), NOT wrapping route registrations, middleware mounting, or controller registration.
This tool provides language-specific templates and instructions for protecting code changes with feature flags. It helps you:
Find existing feature flag patterns in your codebase
Match detected conventions (imports, method names, wrapping styles)
Generate appropriate code snippets for your language/framework
Follow Unleash SDK best practices
Ensure flags are runtime controllable (toggle without redeploy)
Supported languages:
TypeScript/JavaScript (Node, React, Vue, Angular)
Python (FastAPI, Django, Flask)
Go
Ruby (Rails)
PHP
C# (.NET)
Java (Spring Boot)
Rust
The tool uses a prompt-based approach: it provides detailed instructions for searching your codebase for existing patterns and matching their conventions. If no patterns are found, it provides sensible defaults based on Unleash SDK documentation.
Usage:
Call this tool with the flag name after creating a flag
Follow the search instructions to find existing patterns
Use the recommended template or match detected patterns
Test your implementation
Best suited for use after evaluate_change recommends a flag and create_flag creates it.
Inputs: flagName (required), fileName, language, codeContext, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool serves a unique and clearly defined purpose in the feature flag lifecycle (creation, evaluation, detection, state, listing, strategy, toggling, cleanup, wrapping), with no overlapping functionality.
All tool names follow a consistent verb_noun snake_case pattern (e.g., cleanup_flag, create_flag, toggle_flag_environment), making predictions easy.
With 11 tools, the server covers the full lifecycle of feature flag management without being bloated; each tool is justified and valuable.
Covers almost all aspects: evaluation, detection, creation, state, listing, rollout, toggling, strategy removal, code wrapping, and cleanup. Missing explicit flag deletion from the admin API, but cleanup may subsume that.
Maintenance
Related MCP Connectors
Evaluate and inspect your Hypertune feature flags from your AI assistant.
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Connect AI agents to CloudBees Unify: feature flags, CI/CD, release orchestration, and security
Run accessibility, contrast, and design token audits and file QA issues from your AI coding tool.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables interaction with LaunchDarkly's feature flag platform through AI clients. Supports managing feature flags, AI configs, and their variations with operations like create, update, delete, and targeting configuration.134,364 npm27MIT
- AlicenseNot gradedqualityBmaintenanceProvides OpenFeature SDK installation guidance for various programming languages and enables feature flag evaluation through the OpenFeature Remote Evaluation Protocol (OFREP). Supports multiple AI clients and can connect to any OFREP-compatible feature flag service.194 npm3Apache 2.0
- AlicenseAqualityDmaintenanceEnables AI assistants to manage Featureflow feature flags, including creating and updating features, controlling feature states across environments, and managing projects, environments, and targeting rules through natural language.226 npmMIT
- AlicenseCqualityDmaintenanceEnables AI-powered automated testing, security scanning, code review, and maintenance tasks directly within Claude Code or desktop.1252 PyPI4MIT