LaunchDarkly Feature Flags
Is the new checkout flag on in production, and who flipped it last night? Look up LaunchDarkly flags per project and environment, read their status, create a flag, toggle or retarget it with a JSON patch, and trace changes in the audit log.
Connect this API to an AI agent Browse all specs
What you can do with LaunchDarkly Feature Flags via MCP
Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.
| Method | Path | Operation | Description |
|---|---|---|---|
| GET | /api/v2/projects |
listProjects | List the projects in the LaunchDarkly account |
| GET | /api/v2/projects/{projectKey}/environments |
listEnvironments | List the environments (production, staging, ...) of a project |
| GET | /api/v2/flags/{projectKey} |
listFeatureFlags | List or search feature flags in a project |
| POST | /api/v2/flags/{projectKey} |
createFeatureFlag | Create a feature flag in a project |
| GET | /api/v2/flags/{projectKey}/{featureFlagKey} |
getFeatureFlag | Get one flag with its variations and per-environment targeting |
| PATCH | /api/v2/flags/{projectKey}/{featureFlagKey} |
updateFeatureFlag | Update a flag with a JSON patch (turn it on/off, change targeting or name) |
| GET | /api/v2/flag-statuses/{projectKey}/{environmentKey} |
listFlagStatuses | List flag statuses (new, active, inactive, launched) in an environment |
| GET | /api/v2/flag-status/{projectKey}/{featureFlagKey} |
getFlagStatusAcrossEnvironments | See a flag's status in every environment |
| GET | /api/v2/auditlog |
listAuditLogEntries | List audit log entries: who changed which flag and when |
Authentication
ApiKey
API key — sent as the Authorization header
LaunchDarkly API access token, sent as the raw value of the Authorization header (no Bearer prefix).
How to get a credential
- Sign in to LaunchDarkly and open Organization settings > Authorization.
- Under Access tokens, click Create token.
- Give it a name and a role: Reader for read-only use, Writer if the agent should create or update flags.
- Copy the token (it starts with
api-); it is shown only once.
Permissions used
| Role / action | Operations |
|---|---|
| Reader | listProjects, listEnvironments, listFeatureFlags, getFeatureFlag, listFlagStatuses, getFlagStatusAcrossEnvironments, listAuditLogEntries |
Writer (createFlag, updateOn, updateTargets, ...) |
createFeatureFlag, updateFeatureFlag |
Common errors
- 401 Unauthorized: the token is wrong or was revoked; paste it again without a
Bearerprefix. - 403 Forbidden: the token's role cannot do this (a Reader token tried to write, or a custom role denies the project/environment).
- 400 Bad Request: invalid patch body or flag key; check the JSON pointer paths such as
/environments/production/on. - 409 Conflict: a pending approval or scheduled change conflicts; retry with
ignoreConflicts=trueonly if the user agrees. - 429 Too Many Requests: rate limit hit; wait for the
X-Ratelimit-Resettime.
Store the token as a VX Agents credential for this spec; never paste it into chat.
Usage guide
Setup
- Credential: a LaunchDarkly API access token (Organization settings > Authorization > Access tokens). Reader role for read-only agents, Writer to create or change flags. It goes in the
Authorizationheader as-is, withoutBearer. - Worth pinning:
projectKey(oftendefault) and, for status checks,environmentKey(e.g.production).
Check and change a flag
listProjects, thenlistEnvironmentsto learn the project and environment keys.listFeatureFlagswithfilter=query:checkout(orsummary=truefor a short list) to find the flag key.getFeatureFlagto read variations and, underenvironments.<key>, whether it isonand how it targets.getFlagStatusAcrossEnvironmentsorlistFlagStatusesto see if a flag isnew,active,inactiveorlaunched(handy for clean-up).- To change it, call
updateFeatureFlagwith a body like{"comment": "Enable for launch", "patch": [{"op": "replace", "path": "/environments/production/on", "value": true}]}. PassdryRun=truefirst to preview the result. listAuditLogEntrieswithspec=proj/<project>:env/<env>:flag/<flag>to see who changed it and when.
Confirm with the user before createFeatureFlag or updateFeatureFlag: a change in a production environment affects live customers immediately.
Good to know
- Flag, project and environment keys are lower-case slugs; they are not the display names.
createFeatureFlagneedsnameandkey;variationsdefault to boolean true/false. New flags start off in every environment.- Patch paths are JSON pointers into the flag (
/name,/environments/<env>/on,/environments/<env>/fallthrough/variation). Usetestops to guard against concurrent edits. - Audit log
before/aftertake Unix milliseconds and it returns at most 20 entries per call (limit), so narrow the time window. Flag lists page withlimitandoffset. - 409 means a pending approval or scheduled change blocks the patch; only add
ignoreConflicts=trueif the user agrees. - Federal customers use
https://app.launchdarkly.usinstead of the default host.
Source: LaunchDarkly API reference (https://launchdarkly.com/docs/api), checked 2026-10-21.
How to use this spec
- Create a free VX Agents account (sandbox tools included).
- Open the marketplace and connect “LaunchDarkly Feature Flags” to an agent.
- Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.