Integrate Unleash with Kiro
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 IDE — The primary interface, built on Code OSS with specs, steering files, hooks, and Powers
- Kiro CLI — Interactive terminal-based chat (successor to Amazon Q Developer CLI)
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.
Prerequisites
Before you begin, make sure you have the following:
- Node.js 18 or later: The MCP server is distributed as an npm package
- Kiro: IDE or CLI installed
- An Unleash instance: Cloud or self-hosted, with API access enabled
- A personal access token (PAT): With permissions to create and manage feature flags
Install the MCP server
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:
Kiro IDE
Kiro CLI
Requirements: Kiro IDE installed.
Enable MCP support (one-time step):
MCP is disabled by default. Before configuring any MCP servers, enable it:
- Open Settings (
Cmd+,on macOS,Ctrl+,on Windows/Linux) - Search for MCP
- Enable the Kiro: MCP setting
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.
Command Palette
Create file manually
Open the MCP configuration
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.
Add the Unleash server
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.
ConfigureautoApprove 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, and evaluate_change.
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.
Tool reference
The Unleash MCP server exposes nine tools. The following table summarizes each tool and when to use it.
| 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 |
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 |
Workflows
This section describes common workflows for using the Unleash MCP server with Kiro.
Evaluate and wrap a risky change
Use this workflow when implementing a change that might affect production stability, such as a payment integration, authentication flow, or external API call.
Evaluate the change
Tell Kiro what you are working on:
Kiro calls evaluate_change and returns a recommendation with a suggested flag name.
Check for duplicates
Kiro automatically calls detect_flag to search for existing flags.
If a suitable flag exists, Kiro suggests reusing it instead of creating a duplicate.
Spec-driven flag creation
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
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.
Manage rollouts across environments
Use this workflow to enable a flag in staging for testing while keeping it disabled in production.
Check flag state
Enable in staging
Kiro calls get_flag_state and returns the flag metadata, enabled environments, and active strategies.
Clean up after rollout
Use this workflow when a feature has been fully rolled out and the flag is no longer needed.
Kiro calls cleanup_flag and returns:
- All files and line numbers where the flag is used
- Which code path to preserve (the “enabled” branch)
- Suggestions for tests to run after removal
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.
Steering file templates
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.
Always-included: universal conventions
This file loads into every Kiro interaction. Use it for organization-wide flag standards.
fileMatch: domain-specific policies
This file loads only when the conversation involves files matching the glob pattern. Use it for high-risk domains that always require flags.
Auto-included: rollout guidance
This file loads automatically when Kiro detects the conversation is about rollout strategies.
Hook examples
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.
Evaluate on file save
This hook fires whenever a file in the payments domain is saved. Kiro automatically evaluates whether the change needs a flag.
Manual trigger for flag audit
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/**).
Unleash Power
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.
Directory structure
POWER.md
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.
mcp.json
Steering files
steering/feature-flag-conventions.md
steering/rollout-guidance.md
steering/cleanup-cadence.md
Install the Power
You can install the Unleash Power from a local path or from GitHub:
- From local path: Open the Powers panel, select “Add power from Local Path,” and choose the
power-unleash/directory. - From GitHub: Open the Powers panel, select “Add power from GitHub,” and enter the repository URL.
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.
Prompt patterns
The following prompt patterns help you use the MCP tools effectively.
Evaluate and create a flag
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.
Detect and reuse existing flags
Intent: Avoid duplicate flags when similar functionality exists.
Prompt:
Expected behavior: Kiro calls detect_flag and presents matches with confidence levels.
Toggle or check flag state
Intent: Enable, disable, or query a flag in a specific environment.
Prompts:
Expected behavior: Kiro calls toggle_flag_environment or get_flag_state.
Clean up a flag
Intent: Safely remove flagged code and delete unused flags.
Prompts:
Expected behavior: Kiro calls cleanup_flag and provides removal instructions.
Spec-triggered flag evaluation
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.
Hook-triggered automatic evaluation
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.
Enterprise governance
Kiro provides enterprise controls through AWS IAM Identity Center (which can federate to external identity providers such as Okta and Microsoft Entra ID).
- Extension registry governance — Point the IDE at a curated extension registry to control which extensions are available
- Web tools toggle — Enable or disable web search and fetch per organization policy
- Supervised mode enforcement — Require supervised mode for all users, preventing autonomous agent actions
- Trusted commands list — Define which shell commands the agent can execute
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.
Troubleshooting
MCP server not appearing in Kiro
- Check
.kiro/settings/mcp.jsonfor syntax errors - Verify the file is in the correct location (workspace root under
.kiro/settings/) - Restart Kiro after making changes
- Right-click the server in the MCP Servers tab and select Show MCP Logs
Unapproved environment variables
If you see “Found unapproved environment variables in MCP config,” Kiro requires explicit approval before expanding variables.
- When you first save the config, click Allow on the popup to approve the listed variables
- Or open Settings, search for Mcp Approved Env Vars, and add
UNLEASH_BASE_URL,UNLEASH_PAT, andUNLEASH_DEFAULT_PROJECT - After approving, restart Kiro or reload the window
Environment variables not expanding
- Restart your terminal or IDE after modifying your shell profile
- Run
source ~/.zshrcto reload - Kiro inherits environment variables from the shell that launched it
- Verify variables are exported:
echo $UNLEASH_BASE_URL - Verify the variables are approved in Settings → Mcp Approved Env Vars
Authentication failed
- Confirm your Unleash PAT is valid and has not expired
- Check that the PAT has permissions to create and manage feature flags
- Verify that
UNLEASH_BASE_URLincludes/apiat the end - Test directly:
curl -H "Authorization: $UNLEASH_PAT" "$UNLEASH_BASE_URL/admin/projects"
Hook not firing
- Verify the hook file is in
.kiro/hooks/and has the.kiro.hookextension - Check that
enabledistruein the hook JSON - Verify the
filePatternmatches the saved file’s path - For hooks documentation, see Kiro hook types
Power not activating
- Check that keywords in the
POWER.mdfrontmatter match what you are saying in chat - Powers activate on keyword matches — use terms like “feature flag,” “rollout,” or “unleash”
- Verify the Power is installed in the Powers panel
autoApprove not working
- The
autoApprovearray must use exact tool names - Use
"*"to approve all tools, or list specific names like["get_flag_state", "detect_flag"] - Verify the property is inside the server configuration object, not at the root level
Workspace vs user config conflict
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.
Best practices
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.