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

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.2
File Size Uploaded Provenance Actions
flagsmith_mcp-0.1.2.tar.gz 9.0 kB Without provenance Details for flagsmith_mcp-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 20.8 kB

Release files / flagsmith_mcp-0.1.2.tar.gz

Download URL flagsmith_mcp-0.1.2.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5524a0827e0df4eff64c45456bf510067a92538a20020a0324e4fee6e885a733
BLAKE2b-256 checksum
How to use checksums
e505159240be91c15ee0141766abb40c3771feaf0b6a786cb61fda7b9af904c8
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.2-py3-none-any.whl

Download URL flagsmith_mcp-0.1.2-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ab58e7169e9655ff1cb72049ee20286a7a20d0f90439270790a2a5ecd169a01
BLAKE2b-256 checksum
How to use checksums
3a7b0bda9b3e18a4e7666a475173f1f35a99fad8d8db3cdd41f2f661f70e02fb
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.2

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