Skip to main content

flagsmith-mcp

Model Context Protocol (MCP) server for Flagsmith feature flagging and experimentation.

Empowers AI coding assistants (such as Claude Code, Cursor, and Antigravity) to:

  • Create multivariate feature flags in Flagsmith
  • Toggle feature flags across environments
  • Inspect flags and traffic splits
  • Spin up A/B testing experiments measuring conversion metrics
  • Analyze Bayesian win probabilities
  • Automatically ship winning variants by re-allocating 100% traffic

Installation

pip install flagsmith-mcp

Or install in editable mode:

git clone https://github.com/your-org/flagforge.git
cd flagforge/flagsmith-mcp
pip install -e .

Configuration

Set the following environment variables (or place them in a .env file):

FLAGSMITH_BASE_URL=http://localhost:8000
FLAGSMITH_API_KEY=your_flagsmith_master_api_key_or_token
FLAGSMITH_ENVIRONMENT_KEY=ser.your_environment_key # or client-side key
FLAGSMITH_PROJECT_ID=1

Running the Server

Run directly with Python:

python -m flagsmith_mcp

Or run via the CLI entrypoint:

flagsmith-mcp

MCP Tools Reference

Tool Inputs Description
create_flag name (str), description (str), variants (list[str]) Creates a multivariate feature flag with equal traffic splits.
toggle_flag flag_name (str), enabled (bool) Enables or disables a flag in the default environment.
list_flags (none) Returns all flags in the project with their current state and variants.
set_traffic_split flag_name (str), splits (dict[str, float]) Updates the multivariate percentage weights for a flag.
create_experiment name (str), flag_name (str), metric_event (str), hypothesis (str) Sets up an experiment tied to a multivariate flag and success event.
get_experiment_results experiment_id (str) Computes conversion rates and Bayesian win probabilities for all variants.
ship_winner experiment_id (str) Identifies the winning variant from Bayesian results and allocates 100% traffic.

Claude Code & Cursor Integration

Add to your mcp.json or Claude Desktop configuration:

{
  "mcpServers": {
    "flagsmith": {
      "command": "python",
      "args": ["-m", "flagsmith_mcp"],
      "env": {
        "FLAGSMITH_BASE_URL": "http://localhost:8000",
        "FLAGSMITH_API_KEY": "your_api_key",
        "FLAGSMITH_ENVIRONMENT_KEY": "your_environment_key"
      }
    }
  }
}

Metadata

Release files for flagsmith-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flagsmith-mcp 0.1.0
File Size Uploaded Provenance Actions
flagsmith_mcp-0.1.0.tar.gz 8.2 kB Without provenance Details for flagsmith_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flagsmith-mcp 0.1.0
File Interpreter ABI Platform Actions
flagsmith_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for flagsmith_mcp-0.1.0-py3-none-any.whl

Total release size: 19.2 kB

Release files / flagsmith_mcp-0.1.0.tar.gz

Download URL flagsmith_mcp-0.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0b0ea7e24a98e3eb04133001ea8d87f761574f3fc1f42e6570d456384368d13b
BLAKE2b-256 checksum
How to use checksums
2667db53c0b34cab61485ddef619953b523c162e6a852cf8a22beedec024e549
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc3

Release files / flagsmith_mcp-0.1.0-py3-none-any.whl

Download URL flagsmith_mcp-0.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30ffdbbcfc169544450c6344d0aeab49dc5f4ac720e6736c93467dad20b519ac
BLAKE2b-256 checksum
How to use checksums
b6e10388fa62b0e5fea0efca05704d4590abf044cd462a4b24f6ac1a22d03e4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc3

Security for flagsmith-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page