MCP Server
The Flagsmith MCP Server gives AI assistants and agents programmatic access to the Flagsmith Admin API through the Model Context Protocol. Your assistant can manage feature flags, segments, multivariate options, and release workflows on your behalf — in a human-in-the-loop IDE session, or fully automated in a CI/CD pipeline.
It works with any MCP client that supports remote (Streamable HTTP) servers, including Claude Code, Claude Desktop, Cursor, and Codex.
Connecting to the server
The server is reachable over HTTP and you connect your client directly to it — there is nothing to install or run yourself.
| Deployment | MCP URL |
|---|---|
| Flagsmith SaaS (cloud) | https://mcp.flagsmith.com |
| Self-hosted / private cloud | Your MCP server base URL |
For self-hosted instances the MCP server is part of your Flagsmith deployment; use your MCP server base URL wherever the examples below use the SaaS URL.
Authentication
The server supports two authentication methods. Use whichever suits your client; both work side by side.
OAuth (interactive clients)
For interactive clients — IDEs, desktop apps, CLIs you drive by hand — OAuth is the simplest option, with no API keys to manage. The client discovers the OAuth configuration automatically from the MCP URL: on first connection it opens your browser, you log in to Flagsmith and authorise access, and the client stores the resulting token.
API key (CI and non-interactive agents)
For automation — CI jobs, headless agents — authenticate with an
Organisation API key by sending it in the
Authorization header:
Authorization: Api-Key <your-api-key>
The Api-Key prefix is required. The header value should look like Api-Key ser.abc123…, not the key on its own.
Installing in your client
The examples below use the SaaS URL. For self-hosted, substitute your MCP server base URL.
- Claude Code
- Cursor
- Claude Desktop
- Codex CLI
- Windsurf
- Gemini CLI
- VS Code
- Other clients
claude mcp add --transport http flagsmith https://mcp.flagsmith.com
Then run /mcp in Claude Code to complete the OAuth login. For non-interactive use, pass the API key as a header
instead:
claude mcp add --transport http flagsmith https://mcp.flagsmith.com \
--header "Authorization: Api-Key <your-api-key>"
Add the server to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):
{
"mcpServers": {
"flagsmith": {
"url": "https://mcp.flagsmith.com"
}
}
}
To use an API key instead of OAuth, add a headers block:
{
"mcpServers": {
"flagsmith": {
"url": "https://mcp.flagsmith.com",
"headers": { "Authorization": "Api-Key <your-api-key>" }
}
}
}
Open Settings → Connectors → Add custom connector, give it the name Flagsmith and the URL
https://mcp.flagsmith.com, then connect and complete the OAuth login.
Add the server to ~/.codex/config.toml:
[mcp_servers.flagsmith]
url = "https://mcp.flagsmith.com"
Add the server to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"flagsmith": {
"serverUrl": "https://mcp.flagsmith.com"
}
}
}
For an API key instead of OAuth, add "headers": { "Authorization": "Api-Key <your-api-key>" } to the server entry.
Add the server to ~/.gemini/settings.json:
{
"mcpServers": {
"flagsmith": {
"httpUrl": "https://mcp.flagsmith.com"
}
}
}
For an API key instead of OAuth, add "headers": { "Authorization": "Api-Key <your-api-key>" } to the server entry.
Add the server to .vscode/mcp.json (workspace) or your user mcp.json:
{
"servers": {
"flagsmith": {
"type": "http",
"url": "https://mcp.flagsmith.com"
}
}
}
For an API key instead of OAuth, add "headers": { "Authorization": "Api-Key <your-api-key>" } to the server entry.
Any other client that supports remote (Streamable HTTP) MCP servers can connect by pointing it at the MCP URL above and
using either OAuth or the Authorization: Api-Key header.
Available tools
The tools available to your assistant depend on what your Flagsmith deployment has installed. The core tools below are available on every deployment. The enterprise tools require a paid SaaS plan or a self-hosted Enterprise deployment, and only appear when those features are present.
Core tools
| Tool | Description |
|---|---|
create_environment_feature_version | Creates a new version for a feature flag in a specific environment. Applies to environments with v2 feature versioning (use_v2_feature_versioning: true). |
create_environment_feature_version_state | Creates a new feature state for a specific version in an environment. Applies to environments with v2 feature versioning (use_v2_feature_versioning: true). |
create_feature | Creates a new feature flag in the specified project with default settings. |
create_feature_multivariate_option | Creates a new multivariate option for a feature flag. |
create_organization_invite | Send an invitation to join the organisation with specified role and permissions. |
create_project_segment | Creates a new user segment for audience targeting within the project. |
create_segment_override | Creates a segment override for a feature in an environment in a single call, setting both the segment binding and its value. Applies to environments without v2 feature versioning (use_v2_feature_versioning: false). |
delete_feature_multivariate_option | Deletes a multivariate option. |
delete_feature_segment | Deletes a segment override. Applies to environments without v2 feature versioning (use_v2_feature_versioning: false). |
get_environment_feature_version_states | Retrieves feature state information for a specific version in an environment. Applies to environments with v2 feature versioning (use_v2_feature_versioning: true). |
get_environment_feature_versions | Retrieves version information for a feature flag in a specific environment. Applies to environments with v2 feature versioning (use_v2_feature_versioning: true). |
get_feature_code_references | Retrieves code references and usage information for the feature flag. |
get_feature_evaluation_data | Retrieves evaluation data and analytics for a specific feature flag. |
get_feature_external_resources | Retrieves external resources linked to the feature flag. |
get_feature_flag | Retrieves detailed information about a specific feature flag. |
get_feature_health_events | Retrieves feature health monitoring events and metrics for the project. |
get_project | Retrieves comprehensive information about a specific project including configuration and statistics. |
get_project_segment | Retrieves detailed information about a specific user segment. |
list_environments | Lists all environments the user has access to |
list_feature_multivariate_options | Retrieves all multivariate options for a feature flag. |
list_feature_segments | Lists segment overrides for a feature in an environment. |
list_organization_groups | Retrieves all permission groups within the organisation. |
list_organization_invites | Retrieves all pending invitations for the organisation. |
list_organizations | Lists all organisations accessible with the provided user API key. |
list_project_environments | Retrieves all environments configured for the specified project. |
list_project_features | Lists a project's feature flags (paginated). Pass environment=<id> to also get each feature's live state for that environment in environment_feature_state, along with override counts. Works for both v1 and v2 versioned environments. |
list_project_segments | Retrieves all user segments defined for audience targeting within the project. |
list_projects_in_organization | Retrieves all projects within a specified organisation. |
publish_environment_feature_version | Publishes a feature version to make it live in the environment. Applies to environments with v2 feature versioning (use_v2_feature_versioning: true). |
update_environment_feature_state | Updates a feature state in an environment, including enabled status and value. Applies to environments without v2 feature versioning (use_v2_feature_versioning: false). |
update_environment_feature_version_state | Updates an existing feature state for a specific version in an environment. Applies to environments with v2 feature versioning (use_v2_feature_versioning: true). |
update_feature | Updates feature flag properties such as name and description. |
update_feature_multivariate_option | Updates an existing multivariate option. |
update_feature_state | Updates a feature state, including its enabled status and value. Also updates a segment override's value for environments without v2 feature versioning (use_v2_feature_versioning: false). |
update_project | Updates project configuration settings such as the project name and feature visibility. |
update_project_segment | Updates an existing user segment's properties and rules. |
Enterprise tools
Available on paid SaaS plans and self-hosted Enterprise deployments.
| Tool | Description |
|---|---|
add_feature_to_release_pipeline | Adds a feature flag to a release pipeline for staged rollout. |
create_environment_feature_change_request | Creates a new change request for feature flag modifications in an environment. |
get_release_pipeline | Retrieves detailed information about a specific release pipeline. |
list_environment_change_requests | Retrieves all change requests for an environment. |
list_organization_roles | Retrieves all custom roles defined within the organisation. |
list_project_change_requests | Retrieves all change requests for a project. |
list_project_release_pipelines | Retrieves all release pipelines configured for the specified project. |
Migrating from the Gram-hosted server
The previous MCP server was hosted on Gram at https://app.getgram.ai/mcp/flagsmith-mcp. It is deprecated and will be
shut down on 30 June 2026.
Point your client at https://mcp.flagsmith.com instead. Tool names are unchanged, so no other changes to your prompts
or automations are needed. If you authenticated with a custom Mcp-Flagsmith-Token-Auth header, switch to the standard
Authorization: Api-Key <key> header (or OAuth).
Example prompts
For developers:
- "Create a feature flag called
new_checkout_flowand turn it on in the staging environment." - "What segments exist in the mobile-app project?"
- "Add a multivariate option to the
button_colorflag."
For release managers:
- "Show me all pending change requests for the production environment."
- "Add the
premium_featuresflag to the Q1 release pipeline."
For DevOps and automation:
- Build agents that create kill switches for new deployments.
- Integrate flag validation and management into your CI/CD pipelines.
- Automate segment updates based on external analytics data.
Early Access — We Want Your Feedback! 🚀
This is an early release, and we're actively developing it alongside customers like you. Things might be rough around the edges, but that's where you come in.
Found a bug? Have an idea? Something confusing?
We'd love to hear from you — drop our support team a message at support@flagsmith.com.
Your feedback directly shapes what we build next. Let's make this awesome together.