|
| 1 | +--- |
| 2 | +title: Model Context Protocol (MCP) |
| 3 | +description: Use Flipt's MCP server to enable AI assistants to interact with your feature flags |
| 4 | +--- |
| 5 | + |
| 6 | +## Overview |
| 7 | + |
| 8 | +The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). Think of MCP like a USB-C port for AI applications - it provides a standardized way to connect AI models to different data sources and tools. |
| 9 | + |
| 10 | +[Flipt's MCP server](https://github.com/flipt-io/mcp-server-flipt) allows AI assistants and LLMs to directly interact with your feature flags, segments, and evaluations through a standardized interface. This enables powerful AI-driven workflows and integrations with tools that support the MCP protocol. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +## Use Cases |
| 15 | + |
| 16 | +### AI-Enabled IDEs |
| 17 | + |
| 18 | +When using AI-enabled IDEs like Cursor that support MCP, your AI assistant can: |
| 19 | + |
| 20 | +- Check feature flag states while reviewing code |
| 21 | +- Help toggle features on/off during development |
| 22 | +- Assist in creating and managing feature flags |
| 23 | +- Evaluate flags for specific users/entities |
| 24 | +- Help debug feature flag logic and rules |
| 25 | + |
| 26 | +For example, you could ask your AI assistant: |
| 27 | + |
| 28 | +- "What's the current state of the 'dark-mode' flag?" |
| 29 | +- "Enable the 'beta-features' flag for all users in the 'internal' segment" |
| 30 | +- "Create a new feature flag for our upcoming notification system" |
| 31 | + |
| 32 | +### AI Agents and Workflows |
| 33 | + |
| 34 | +The Flipt MCP server can be integrated into broader AI agent workflows to: |
| 35 | + |
| 36 | +- Automate feature flag management based on system metrics |
| 37 | +- Coordinate feature rollouts across multiple services |
| 38 | +- Generate reports on feature usage and impact |
| 39 | +- Manage complex feature flag rules and segments |
| 40 | + |
| 41 | +## Getting Started |
| 42 | + |
| 43 | +Check out the [Flipt MCP server repository](https://github.com/flipt-io/mcp-server-flipt) for the most up to date information on how to use the MCP server. |
| 44 | + |
| 45 | +### Cursor |
| 46 | + |
| 47 | +To use the Flipt MCP server with Cursor, you need to configure Cursor to use the MCP server. |
| 48 | + |
| 49 | +The Cursor docs have a [guide on how to configure Cursor](https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers) to use a MCP server. |
| 50 | + |
| 51 | +For Flipt, you can use the following configuration: |
| 52 | + |
| 53 | +```json |
| 54 | +{ |
| 55 | + "mcpServers": { |
| 56 | + "flipt": { |
| 57 | + "command": "npx", |
| 58 | + "args": ["-y", "@flipt-io/mcp-server-flipt"] |
| 59 | + } |
| 60 | + } |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +### Configuration |
| 65 | + |
| 66 | +The server can be configured using environment variables: |
| 67 | + |
| 68 | +```bash |
| 69 | +# The URL of your Flipt instance |
| 70 | +FLIPT_API_URL=http://localhost:8080 |
| 71 | + |
| 72 | +# Optional API key for authentication |
| 73 | +FLIPT_API_KEY=<your-api-key> |
| 74 | +``` |
| 75 | + |
| 76 | +## Available Operations |
| 77 | + |
| 78 | +The Flipt MCP server provides tools for: |
| 79 | + |
| 80 | +- **Namespace Management**: Create, list, update, and delete namespaces |
| 81 | +- **Flag Operations**: Create, toggle, and manage feature flags |
| 82 | +- **Segment Management**: Define and update user segments |
| 83 | +- **Flag Evaluation**: Evaluate flags for specific entities |
| 84 | +- **Constraints & Rules**: Manage targeting rules and constraints |
| 85 | +- **Variants & Distributions**: Configure feature variants and rollout distributions |
0 commit comments