Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/cli-mcp-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@reflag/cli": patch
---

Correct the MCP section of the README: the CLI writes the Reflag MCP URL directly (no mcp-remote), `--editor` accepts `cursor` or `vscode`, and Claude Code setup is shown first.
33 changes: 14 additions & 19 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,35 +227,30 @@ This command adds rules to your project that provide AI tools with context about

## Model Context Protocol

The Model Context Protocol (MCP) is an open protocol that provides a standardized way to connect AI models to different data sources and tools. In the context of Reflag, MCP enables your code editor to understand your flags, their states, and their relationships within your codebase. This creates a seamless bridge between your flag management workflow and AI-powered development tools. The MCP server is hosted by Reflag, making it easy to get started.
Reflag hosts an MCP server at `https://app.reflag.com/api/mcp`. Connect your coding agent to it to create and manage flags from your editor or terminal. You sign in with your Reflag account, so you don't need an API key.

_\*\*Note: The Reflag `mcp` CLI command was previously used for a \_local_ server. However, in recent versions of the Reflag CLI, the `mcp` command has been repurposed to help you connect to the new remote MCP server.\*\*\_
To add it to Claude Code, run:

### Setting up MCP
```bash
claude mcp add --transport http Reflag https://app.reflag.com/api/mcp
```

Then start `claude` and run `/mcp` to sign in. For other clients, see the [MCP docs](https://docs.reflag.com/api/mcp).

The `mcp` command helps you configure your editor or AI client to connect with Reflag's remote MCP server. This allows your AI tools to understand your flags and provide more contextual assistance.
### Setting up MCP with the CLI

The `mcp` command adds the Reflag MCP server to your editor's MCP configuration file.

```bash
npx reflag mcp [--editor <editor>] [--scope <local|global>]
npx reflag mcp [--editor <cursor|vscode>] [--scope <local|global>]
```

Options:

- `--editor`: The editor/client to configure:
- `cursor`: [Cursor IDE](https://www.cursor.com/)
- `vscode`: [Visual Studio Code](https://code.visualstudio.com/)
- `claude`: [Claude Desktop](https://claude.ai/download)
- `windsurf`: [Windsurf](https://windsurf.com/editor)
- `--scope`: Whether to configure settings globally or locally for the project.

The command will guide you through:

1. Selecting which editor/client to configure.
2. Choosing which Reflag app to connect to.
3. Deciding between global or project-local configuration.
4. Setting up the appropriate configuration file for your chosen editor .
- `--editor`: The editor to configure: `cursor` ([Cursor](https://www.cursor.com/)) or `vscode` ([Visual Studio Code](https://code.visualstudio.com/)). Leave it out to choose interactively.
- `--scope`: `local` adds the server to your project (`.cursor/mcp.json` or `.vscode/mcp.json`). `global` adds it to your user configuration.

_**Note: The setup uses [mcp-remote](https://github.com/geelen/mcp-remote) as a compatibility layer allowing the remote hosted Reflag MCP server to work with all editors/clients that support MCP STDIO servers. If your editor/client supports HTTP Streaming with OAuth you can connect to the Reflag MCP server directly.**_
The command asks which Reflag app to connect to, then writes the configuration. Restart your editor to load the server.

## Using in CI/CD Pipelines

Expand Down
Loading