Skip to main content

flagsmith-mcp

flagsmith-mcp adds Experimentation-focused tools missing from Flagsmith’s official MCP server: A/B experiment creation, Bayesian win probability calculation, and automatic winner shipping — plus a Flutter demo kit for mobile developers.

While Flagsmith offers an official MCP server for fundamental flag administration, flagsmith-mcp is purpose-built for closed-loop autonomous experimentation:

  • Spin up A/B testing experiments measuring conversion metrics
  • Analyze Bayesian win probabilities (Beta-binomial Monte Carlo simulation)
  • Automatically ship winning variants by re-allocating 100% traffic
  • Create and toggle multivariate feature flags in Flagsmith

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

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.1
File Size Uploaded Provenance Actions
flagsmith_mcp-0.1.1.tar.gz 8.3 kB Without provenance Details for flagsmith_mcp-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 19.4 kB

Release files / flagsmith_mcp-0.1.1.tar.gz

Download URL flagsmith_mcp-0.1.1.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
121519a167213829a859ef3c80ed5c37625d2b5c985016353ab8164bd817bea1
BLAKE2b-256 checksum
How to use checksums
f2c3759c78a21edf20ffa37fd1aef48421a8fcaf1b7932d8dfcdc885b75d0bf4
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.1-py3-none-any.whl

Download URL flagsmith_mcp-0.1.1-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2a528e1a973fedb6562f8871b3c7f8dc4b2f5f39a5cc87c303c81012ace3c98
BLAKE2b-256 checksum
How to use checksums
fd904db2e4cc5d888ed419103392e1850d4611e651f1f6ee3bb39aaf049ae307
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.1

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