# Flipt MCP

> Flipt lets you manage feature flags and controlled rollouts by talking to your AI agent. Use this MCP to list namespaces, check flag statuses, define user segments, and create percentage-based distributions for progressive delivery.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** feature-flags, rollouts, targeting, ab-testing, configuration-management

## Description

Managing features isn't just about flipping a switch; it's about knowing exactly who sees what, and when. Connect your Flipt instance via Vinkius and let your AI agent handle the complex logic of progressive delivery. You can inspect feature flags across different namespaces to see your current setup. Need to target only internal QA users? The MCP lets you retrieve segments and define constraints for precise rollouts. Want to test a new UI with 5% of your user base? It handles creating distributions and rules for canary deployments. If you need to return two completely different values based on logic, create flag variants. This entire process—from auditing environment structures by listing namespaces to setting up complex rollout percentages—happens entirely through natural conversation with your agent.

## Tools

### create_constraint
Defines a specific rule or boundary for a user segment.

### create_distribution
Sets the percentage or scope for how widely a feature rollout is applied.

### create_variant
Creates a new, distinct value that a flag can return based on logic.

### list_flags
Retrieves a list of all feature flags within a specified namespace.

### list_namespaces
Lists every available operational partition or environment name in your Flipt instance.

### list_rollouts
Gets the current list of percentage-based rollouts applied to a specific flag.

### list_rules
Retrieves the logic rules that govern how flags are evaluated for a given feature.

### list_segments
Lists existing user groups or segments within your configured namespaces.

### list_tokens
Shows all stored authentication tokens, helping you understand the system's access levels.

## Prompt Examples

**Prompt:** 
```
List all namespaces in my Flipt instance.
```

**Response:** 
```
I've retrieved the namespaces. You currently have: 'default' (Global resources) and 'production-env' (Production flags). Which one would you like to explore?
```

**Prompt:** 
```
Show me all the feature flags in the 'default' namespace.
```

**Response:** 
```
Fetching flags for 'default'... I found 3 flags: 'new-onboarding-flow', 'dark-mode-beta', and 'api-v2-enabled'. Would you like to see the variants for any of these?
```

**Prompt:** 
```
Create a new variant called 'v2-test' for the 'header-experiment' flag in the 'default' namespace.
```

**Response:** 
```
Variant 'v2-test' has been successfully created for the 'header-experiment' flag. It is now available for use in your rules and distributions.
```

## Capabilities

### Audit environments and flags
List every available namespace and check the status of all feature flags within a given scope.

### Define user subsets for testing
Retrieve existing segments or create new constraints to limit who sees a specific feature, ensuring targeted rollouts.

### Control release percentages
Set up rules and distributions to manage controlled releases, like rolling out a feature to 1% before 20%.

### Manage flag variations
Create specific variants for flags so they can return different values based on defined evaluation logic.

### View system architecture details
List authentication tokens and namespaces to understand the entire environment's structure and access levels.

## Use Cases

### Verifying a controlled rollout for the new checkout flow
A product manager asks their agent: 'Show me the current rules for the checkout flag.' The agent calls list_rules and list_rollouts, confirming that the feature is correctly set to 5% distribution only for users in the QA segment.

### Onboarding a new environment partition
A DevOps engineer starts by calling list_namespaces. After seeing 'staging-v3' isn't listed, they ask the agent to check its structure, using list_flags and list_tokens to verify access is ready.

### Testing a new UI variant for a specific user group
A developer needs to test a different header layout. They use create_variant to define 'header-v2' and then call create_constraint, ensuring only users with the 'premium' segment can see it.

### Debugging unexpected feature behavior
A QA tester reports a bug in production. The agent uses list_rules to trace the flag logic, pinpointing that an incorrectly set distribution is causing some users to bypass the required checks.

## Benefits

- Audit your entire environment instantly. Use list_namespaces to see every partition, then list_flags to audit the status of features across all environments without clicking through a dashboard.
- Precision targeting saves time. Instead of broad changes, use list_segments and create_constraint to define rules that only apply to specific user subsets, like beta testers or internal staff.
- Control deployments with confidence. When you need controlled rollouts, the MCP lets you list_rollouts and create_distribution to manage percentage-based releases, ensuring minimal risk when deploying new code.
- Build complex logic easily. Use create_variant to define multiple possible outcomes for a single flag, allowing your application to behave differently based on user attributes or system rules.
- Keep track of access. If you're unsure about permissions, use list_tokens and list_namespaces to map out exactly what credentials exist and where they apply.

## How It Works

The bottom line is that your AI client translates complex feature management commands into simple natural language chat.

1. First, subscribe to this MCP and provide your Flipt URL along with a valid API token.
2. Next, tell your AI client what you need—for example, 'List the rules for the dark mode flag in production.'
3. Finally, the agent executes the tool calls, retrieving structured data about flags, rollouts, or segments that you can then act on conversationally.

## Frequently Asked Questions

**How do I see all the environments available in Flipt using the MCP?**
You call list_namespaces. This command pulls a complete inventory of every namespace your instance manages, helping you know exactly where to look for flags.

**Can Flipt help me test feature logic with different values?**
Yes, use create_variant. This allows you to define multiple potential outcomes for a single flag so your application can behave differently based on the rules.

**What is the difference between segments and namespaces in Flipt MCP?**
Namespaces define large partitions (like 'staging' or 'production'). Segments are smaller, targeted groups of users *within* a namespace, used for precise rollouts.

**How do I increase the rollout percentage safely with Flipt?**
To manage gradual increases, you call create_distribution. This allows you to adjust the specific rule's distribution from 1% up to 50%, controlling risk.

**Does Flipt MCP only work for simple on/off switches?**
No. It handles complex logic, allowing you to list_rules and define rules that depend on multiple user attributes or conditions.