Skip to content

chore: add docs on MCP server #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions docs/integration/mcp-server.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: Model Context Protocol (MCP) Server
description: Use Flipt's MCP server to enable AI assistants to interact with your feature flags
---

## Overview

The Model Context Protocol (MCP) 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.

Flipt's MCP server 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.

## Use Cases

### AI-Enabled IDEs

When using AI-enabled IDEs like Cursor that support MCP, your AI assistant can:

- Check feature flag states while reviewing code
- Help toggle features on/off during development
- Assist in creating and managing feature flags
- Evaluate flags for specific users/entities
- Help debug feature flag logic and rules

For example, you could ask your AI assistant:

- "What's the current state of the 'dark-mode' flag?"
- "Enable the 'beta-features' flag for all users in the 'internal' segment"
- "Create a new feature flag for our upcoming notification system"

### AI Agents and Workflows

The Flipt MCP server can be integrated into broader AI agent workflows to:

- Automate feature flag management based on system metrics
- Coordinate feature rollouts across multiple services
- Generate reports on feature usage and impact
- Manage complex feature flag rules and segments

## Getting Started

### Installation

You can run the Flipt MCP server using npm:

```bash
npm install -g @flipt-io/mcp-server-flipt
mcp-server-flipt
```

Or using Docker:

```bash
docker run -d --name mcp-server-flipt ghcr.io/flipt-io/mcp-server-flipt:latest
```

### Configuration

The server can be configured using environment variables:

```bash
# The URL of your Flipt instance
FLIPT_API_URL=http://localhost:8080

# Optional API key for authentication
FLIPT_API_KEY=<your-api-key>
```

## Available Operations

The Flipt MCP server provides tools for:

- **Namespace Management**: Create, list, update, and delete namespaces
- **Flag Operations**: Create, toggle, and manage feature flags
- **Segment Management**: Define and update user segments
- **Flag Evaluation**: Evaluate flags for specific entities
- **Constraints & Rules**: Manage targeting rules and constraints
- **Variants & Distributions**: Configure feature variants and rollout distributions

## Example Integration

Here's an example of how to use the Flipt MCP server with an AI assistant in Cursor:

1. Start the Flipt MCP server
2. Configure Cursor to use the MCP server
3. Ask your AI assistant questions about your feature flags:
Binary file added images/tooling/mcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@
},
{
"group": "Tooling",
"pages": ["tooling/github-actions"]
"pages": [
"tooling/github-actions",
"tooling/model-context-protocol"
]
},
{
"group": "Overview",
Expand Down
85 changes: 85 additions & 0 deletions tooling/model-context-protocol.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: Model Context Protocol (MCP)
description: Use Flipt's MCP server to enable AI assistants to interact with your feature flags
---

## Overview

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.

[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.

![MCP Server](/images/tooling/mcp.png)

## Use Cases

### AI-Enabled IDEs

When using AI-enabled IDEs like Cursor that support MCP, your AI assistant can:

- Check feature flag states while reviewing code
- Help toggle features on/off during development
- Assist in creating and managing feature flags
- Evaluate flags for specific users/entities
- Help debug feature flag logic and rules

For example, you could ask your AI assistant:

- "What's the current state of the 'dark-mode' flag?"
- "Enable the 'beta-features' flag for all users in the 'internal' segment"
- "Create a new feature flag for our upcoming notification system"

### AI Agents and Workflows

The Flipt MCP server can be integrated into broader AI agent workflows to:

- Automate feature flag management based on system metrics
- Coordinate feature rollouts across multiple services
- Generate reports on feature usage and impact
- Manage complex feature flag rules and segments

## Getting Started

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.

### Cursor

To use the Flipt MCP server with Cursor, you need to configure Cursor to use the MCP server.

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.

For Flipt, you can use the following configuration:

```json
{
"mcpServers": {
"flipt": {
"command": "npx",
"args": ["-y", "@flipt-io/mcp-server-flipt"]
}
}
}
```

### Configuration

The server can be configured using environment variables:

```bash
# The URL of your Flipt instance
FLIPT_API_URL=http://localhost:8080

# Optional API key for authentication
FLIPT_API_KEY=<your-api-key>
```

## Available Operations

The Flipt MCP server provides tools for:

- **Namespace Management**: Create, list, update, and delete namespaces
- **Flag Operations**: Create, toggle, and manage feature flags
- **Segment Management**: Define and update user segments
- **Flag Evaluation**: Evaluate flags for specific entities
- **Constraints & Rules**: Manage targeting rules and constraints
- **Variants & Distributions**: Configure feature variants and rollout distributions