The Unleash MCP server connects Kiro 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 Kiro’s spec-driven development workflow.
Kiro supports MCP across two interfaces:
Kiro’s structured primitives create a natural pipeline for feature flags: specs surface risk at the requirements stage, steering files encode your team’s conventions, hooks automate evaluation on file events, and Powers bundle everything into a shareable package.
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.
Kiro uses ${VAR} expansion for environment variables. Create a credentials file and source it from your shell profile:
Now configure your preferred interface:
Requirements: Kiro IDE installed.
Enable MCP support (one-time step):
MCP is disabled by default. Before configuring any MCP servers, enable it:
Cmd+, on macOS, Ctrl+, on Windows/Linux)Without this setting enabled, MCP servers will not connect and tools will not appear. This only needs to be done once.
You can add the Unleash MCP server using the Command Palette or by creating the configuration file manually.
Open the Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux) and run Kiro: Open workspace MCP config (JSON).
This opens .kiro/settings/mcp.json in your workspace.
For user-scoped (global) configuration, run Kiro: Open user MCP config (JSON) instead. This opens ~/.kiro/settings/mcp.json.
Paste the following configuration:
When you save this file, Kiro displays a popup listing unapproved environment variables.
Click Allow to approve UNLEASH_BASE_URL, UNLEASH_PAT, and UNLEASH_DEFAULT_PROJECT.
You can also manage approved variables later in Settings under Mcp Approved Env Vars.
autoApprove and disabledTools**Kiro supports two MCP configuration properties for controlling tool approval:
Example with auto-approval for read-only tools:
Use autoApprove for read-only tools like get_flag_state, detect_flag, evaluate_change, list_projects, and list_flags.
Keep write operations like create_flag and toggle_flag_environment behind manual approval for safety.
Configuration scopes:
Both are merged; workspace takes precedence on conflict. For team collaboration, use the workspace-level file.
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 three use cases: evaluate and wrap code in feature flags, manage rollouts across environments, and clean up after rollout.
Use this workflow when implementing a change that might affect production stability, such as a payment integration, authentication flow, or external API call.
Tell Kiro what you are working on:
Kiro calls evaluate_change and returns a recommendation with a suggested flag name.
Kiro automatically calls detect_flag to search for existing flags.
If a suitable flag exists, Kiro suggests reusing it instead of creating a duplicate.
Use this workflow when a Kiro spec identifies a high-risk task during the design phase. Instead of flagging code after implementation, the spec surfaces risk before a single line is written.
Create a spec for your feature (for example, “Integrate Stripe payment processing”). During the Design phase, Kiro identifies the payment integration as high-risk based on the architectural analysis.
Spec-driven flag creation catches risk at the requirements stage rather than during code review. The flag becomes part of the implementation plan, not an afterthought.
Use this workflow to enable a flag in staging for testing while keeping it disabled in production.
Kiro 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.
Kiro 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, Kiro calls list_projects to enumerate projects the configured token can access. Skip this step if UNLEASH_DEFAULT_PROJECT is set.
Kiro calls list_flags with the target projectId. The default response returns active (non-archived) flags only.
For a full audit, Kiro 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.
Kiro 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.
A spec-driven flag audit can be triggered manually from a Kiro hook. See the flag-audit.kiro.hook template in the Unleash Kiro Power for an example that calls list_flags for both active and archived inventory.
Steering files encode your team’s FeatureOps policies, so Kiro considers feature flags automatically.
Store them in .kiro/steering/ and choose the inclusion mode that matches the policy’s scope.
For more details on steering files, see the Kiro steering file documentation.
This file loads into every Kiro interaction. Use it for organization-wide flag standards.
This file loads only when the conversation involves files matching the glob pattern. Use it for high-risk domains that always require flags.
This file loads automatically when Kiro detects the conversation is about rollout strategies.
Hooks automate feature flag evaluation based on IDE events.
Store them as .kiro.hook files in .kiro/hooks/.
For more details on hooks, see the Kiro hooks documentation.
This hook fires whenever a file in the payments domain is saved. Kiro automatically evaluates whether the change needs a flag.
This hook runs on demand when triggered by the user. It audits all flags in the project and generates a cleanup report.
Adjust the filePattern in the File Save hook to match your project’s high-risk directories.
You can create multiple hooks targeting different domains (e.g., src/auth/**, src/api/**).
A Power bundles MCP tools, steering files, and hook definitions into a single installable package. The Unleash Power is the recommended way to distribute the integration across teams and projects, and is published as a public repository at github.com/Unleash/unleash-kiro-power. The example structure and files below mirror that repository; install it directly from GitHub or fork it to customize for your team.
The POWER.md file defines activation keywords and onboarding instructions.
When a developer mentions “feature flag,” “rollout,” or “unleash” in chat, Kiro loads the Power’s tools and steering files into context.
You can install the Unleash Power from a local path or from GitHub:
power-unleash/ directory.https://github.com/Unleash/unleash-kiro-power. If your team forked the repo to customize it, use your fork’s URL instead.When installed, the Power’s MCP server is auto-registered in ~/.kiro/settings/mcp.json under the “Powers” section with a namespaced server name (e.g., power-unleash-unleash).
For more details on creating and distributing Powers, see the Kiro Powers 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: Kiro calls evaluate_change, then detect_flag, create_flag, and wrap_change as needed.
Intent: Avoid duplicate flags when similar functionality exists.
Prompt:
Expected behavior: Kiro calls detect_flag and presents matches with confidence levels.
Intent: Enable, disable, or query a flag in a specific environment.
Prompts:
Expected behavior: Kiro calls toggle_flag_environment or get_flag_state.
Intent: Safely remove flagged code and delete unused flags.
Prompts:
Expected behavior: Kiro calls cleanup_flag and provides removal instructions.
Intent: Evaluate flag requirements as part of spec-driven task implementation.
Prompt:
Expected behavior: Kiro reads the spec tasks, identifies high-risk ones based on steering file rules, and calls evaluate_change for each. Flags are created and wrapping code is generated as part of the task implementation.
Intent: Automatically evaluate code changes when files are saved.
Trigger: A File Save hook fires when source files in a target directory are saved.
Expected behavior: The hook sends an agent prompt that calls evaluate_change with the saved file’s context. If a flag is needed, Kiro notifies you and offers to create it. In Supervised mode, you approve each step. In Autopilot mode, the flag is created automatically.
Kiro provides enterprise controls through AWS IAM Identity Center (which can federate to external identity providers such as Okta and Microsoft Entra ID).
For MCP server governance, commit .kiro/settings/mcp.json to version control. This ensures all team members use the same MCP servers with the same settings.
Use Supervised mode for high-risk flag operations (creation, rollout configuration, cleanup). Autopilot mode works well for read-only operations like checking flag state and evaluating changes.
.kiro/settings/mcp.json for syntax errors.kiro/settings/)If you see “Found unapproved environment variables in MCP config,” Kiro requires explicit approval before expanding variables.
UNLEASH_BASE_URL, UNLEASH_PAT, and UNLEASH_DEFAULT_PROJECTsource ~/.zshrc to reloadecho $UNLEASH_BASE_URLUNLEASH_BASE_URL does not include /api at the endcurl -H "Authorization: $UNLEASH_PAT" "$UNLEASH_BASE_URL/api/admin/projects".kiro/hooks/ and has the .kiro.hook extensionenabled is true in the hook JSONfilePattern matches the saved file’s pathPOWER.md frontmatter match what you are saying in chatautoApprove array must use exact tool names"*" to approve all tools, or list specific names like ["get_flag_state", "detect_flag"]Workspace configuration (.kiro/settings/mcp.json) takes precedence over user configuration (~/.kiro/settings/mcp.json). If a server is disabled in workspace config, it remains disabled even if enabled in user config.
Follow these guidelines for effective feature flag management with Kiro.
While the MCP server can automate flag creation, high-risk changes should involve human review. Use Supervised mode 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 steering files so Kiro 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. Set up a Manual Trigger hook for periodic audits.
Configure MCP servers at workspace scope (.kiro/settings/mcp.json) and commit to version control. All team members get the same configuration.
Write your feature flag guidelines in steering files with appropriate inclusion modes. Kiro reads these files and applies the guidance automatically based on context.