Developer Tools

LaunchDarkly MCP

LaunchDarkly MCP lets agents manage feature flags, segments, experiments, releases, AI configs and observability data (logs, traces, errors, sessions) through LaunchDarkly's hosted MCP server.

Tools

This is a reference catalogue. Tools cannot be configured or run from this page.

  • Search aggregations

    Compute time-bucketed aggregates (counts, sums, averages, percentiles) for a product type; prefer it to raw queries for trends, group comparisons, or windows over 24 hours; for services ranked by error rate, request count or p95, or one service's health by endpoint, use search-service-map with include health. Pass expressions or the functionType and column shorthand, not both. Use column, not functionColumn: value for metrics, duration in nanoseconds for traces. Filter metrics with metric_name=<name>, not key=<name>. Each expression is labelled with the aggregator the backend ran; check it. If estimated is true, values are sampled (see sampling); set exact for exact values, and heed low_sample: a sampled percentile over few rows is noise. For a monotonic counter, Sum over the window is its increase. For counts per hour or per day, set bucketCount to the number of hours or days; rate is only for per-second style rates. Ratios: series and formulas (exact is ignored with series; see warnings); period-over-period: compareTo; is it abnormal: anomaly; metric to trace: exemplars; dropped at ingest: includeIngest. populationFunctionType aggregates twice, per groupBy value then across values, e.g. the Max of each pod's Avg. QUERY SYNTAX (summary; full grammar: load-skill observability/querying-patterns): a filter only, no pipes, SELECT or aggregation; empty matches everything in the window. - key=value with = != < <= > >= EXISTS NOT EXISTS. Adjacent terms are AND; NOT binds tightest, then AND, then OR; parentheses group; service_name=(api OR worker) groups values (no implicit AND). - = is exact and case-sensitive. A * makes an unanchored, case-insensitive contains match; anchor with a regex: span_name=/^gorm\./. - A bare term searches the default key (log message, span name, error event), no regex: letters and digits match a whole word (error is not errors); other characters or quotes make a slower substring scan. - Quote a value containing spaces or = > < : ! ( ): url.query="*utm_source=newsletter*". - Durations: 500ms, 2s, 24h (whole numbers, no d) become traces duration (ns) and sessions length units, ns on other keys. - Keys are case-sensitive snake_case; confirm with get-keys search=<name>, values with get-keys key=<name>. BAD CLAUSES (key!value, key=, unknown units) never error: they are dropped and results get WIDER; only a malformed span(...)/THEN chain errors. query_problems names them and filter values with no data; fix those and retry before trusting the rows. SCOPE: for logs, traces and metrics, pass environments and services; not services for CloudWatch metrics (amazonaws.com/..., no service_name). One system may report under several service_name values (prod-api, prod-api-worker); before trusting a count, list them with get-keys key=service_name search=<name> and pass them all in services. A * wildcard also pulls in sibling services.

  • Search change history

    Query the audit log to find what changed in a LaunchDarkly account. Returns changes newest first with who made each change and what they did. Filter by project, environment, resource kind or key, tags, text, and dates. startDate and endDate each take an ISO 8601 time with a timezone (2024-01-15T10:00:00Z), a date (2024-01-15, UTC), a time relative to now (now, now-15m, now-1h, now-7d; units s, m, h, d, w), or Unix epoch seconds or milliseconds; for example startDate now-7d covers the last week. resourceKey requires resourceKind, the resource type such as flag, segment, view, or member; use the kind the request names, and if it names a key without its kind, ask which kind it is instead of omitting it. When hasMore is true, use nextBefore as endDate for the next page. Timestamps in the result are UTC.

  • Search contexts

    Search for stored LaunchDarkly contexts in an environment by kind, key, or attribute value. Returns context records including their stored attributes (e.g., merchantCountryCode, disbursementRail) and when the context was last seen. Kind keys and attribute names differ per project: find them with get-context-kinds and get-context-attributes instead of guessing. Convenience param: - `kind`: filter to a specific context kind (e.g. `Merchant`, `user`, `organization`). Emitted as the filter clause `kind equals "<kind>"`. Raw filter syntax (passed in `filter`) uses `field operator value` clauses. Operators: `equals`, `notEquals`, `anyOf`, `startsWith`, `exists`, `before`, `after`; `contains` and `notContains` are not supported. Every clause needs a value: `exists` takes `true` or `false` (`user.email exists true`), and values containing spaces must be quoted. Write `kind equals "user"`, not `kind:user`. Combine clauses with `,` (AND) or `|` (OR), not the words and/or; group with `()`. Supported fields: `kind`, `key`, `kindKey`, `applicationId`, `q`, `<kind>.<attribute>` for one kind's attribute, `*.<attribute>` for any kind, and bare `name` for `*.name`. Attribute rules: only top-level attributes can be filtered, and the name must start with a letter or underscore followed by letters, digits, `_` or `-`. Nested paths such as `user.address.city` and JSON pointers are rejected; find those contexts by kind or key and read their attributes with get-context-instances. A filter may hold at most 10 attribute clauses. `startsWith` is case-sensitive. `q` takes only `equals` with one non-empty string and prefix-matches the context key and the `name`, `firstName`, `lastName`, and `email` attributes. Examples: - `kind equals "Merchant"` — contexts of a specific kind - `Merchant.merchantCountryCode equals "US"` — Merchant contexts whose attribute matches - `key startsWith "merchant-"` — contexts whose key has a prefix - `applicationId equals "GoSDK/1.2"` — contexts reported by a specific SDK/application Example combining both params: set `kind=Merchant` and `filter=Merchant.disbursementRail equals "PIX"` to find Merchant contexts on the PIX rail. Note: the contexts API cannot filter by which flag a context evaluated; there is no `flagEvaluated` field. Filter by kind, key, applicationId, or attribute values instead. Ordering is fixed by the API; there is no sort parameter, and contexts cannot be filtered by lastSeen. Pagination: responses include `totalCount`. When hasMore is true, pass continuationToken from the response to get the next page.

  • Search docs

    Search LaunchDarkly documentation to retrieve authoritative reference material for flags, targeting rules, experiments, segments, AgentControl configs, SDKs, API fields, rollouts, metrics, and more. Forwards the query to the LaunchDarkly docs site's own search, which matches page content. Returns up to 10 results, each with a title, a link and matching content. Links can end in a `#section` anchor. Use `get-doc` to fetch the full markdown for a page. Examples: - query: `targeting rules clauses` — finds flag targeting configuration docs - query: `experiment audience allocation` — finds experiment setup docs - query: `how do I roll back a flag` — natural-language questions work too

  • Search error groups

    Query error groups whose occurrences match a filter in a time window. Only OPEN groups unless state says otherwise. Each group's in_window block covers only matching occurrences; its event, serviceName, and environments are first-seen values, and a group can hold unrelated messages. Filter on exception.message; event and bare terms match only the original title. For one session's groups, query secure_session_id=<id> or use get-session-details. For one group's occurrences, trace_id and session, use get-error-group.

  • Search flag evaluations

    Query flag evaluations the observability plugin records on spans. For whether a flag is still used, call get-flag-status-across-envs. With sessionSecureId: that session's evaluations (distinct: one row per flag with values and counts); set startDate to its created_at and endDate three hours later. Without it: counts across the project per flag, value and environment for flagKey (or a query), to see who was served what; include error_groups (needs variation) adds error groups sessions hit after being served that value; include sessions adds sessions served it. Pass only extra filters in query.

  • Search log patterns

    Cluster the logs matching a filter into message templates, with ids, numbers and other variable parts masked, each with its count and the newest example. Use it to find the distinct shapes of an error or a noisy message in one call instead of paging search-logs; set patternKeys to ["error.message"] to template an attribute instead of the message. The log level key is level (level=error), not severity. It scans at most the newest 100,000 matching logs: when truncated is true, narrow the window or the filter for complete counts. Pass environments and services as arguments, not query.

  • Search logs

    Query raw log entries (timestamp, level, message, service, attributes) in a time window. An error-level log that recorded an error carries error_group_secure_id for get-error-group. Long values such as stack traces are shortened; to read one in full, repeat the query with fullAttributes, e.g. ["code.stacktrace"]. fields picks attributes; maxTokens bounds the response. To scope to a session, query secure_session_id=<id> with startDate at the session's created_at and endDate three hours later. Use search-aggregations for counts or trends. Pass environments and services as arguments, not query.

  • Search members

    Search account members by name or exact emails.

  • Search service map

    Services from trace data in a window. include picks the parts (default dependencies). dependencies: without service, services and {source, target} pairs where source calls target, narrowed with search; with service, its upstream callers and downstream callees with calls, errors and latency. health: requests, errors, error_rate and p50/p95/p99 latency per service, ranked with sortBy (e.g. error_rate); with service, also per http.route.

  • Search sessions

    Query sessions in a time window; set detailed for replay, privacy, and billing fields. length and active_length are in milliseconds. To fetch one session, query secure_session_id=<id> with a wide window and count 1. The same secure_session_id=<id> filter scopes logs, traces, errors and metrics (web vitals) to the session; session_id attributes are app data, not that link. For the longest or shortest sessions, set sortField to length (total duration), not active_length. When you reference sessions from this tool, wrap each session ID in <session-id></session-id> so the UI can link it.

  • Search stale flags

    Find cleanup candidates, prioritized as never requested, inactive beyond the threshold, or launched without recent changes. Timestamps in the result are UTC.

  • Search timeline events

    Query timeline indicator events for one session (clicks, navigations, track and identify calls, focus and tab changes) in time order. Filter with types, startTime and endTime, and page with limit and offset. Errors, network requests and flag evaluations are not timeline events; use get-session-details and search-flag-evaluations for those.

  • Search traces

    Query raw spans in a window of up to 24 hours; use search-aggregations for longer windows. view=traces returns one row per trace, to find slow or failing requests. Long values are shortened; fullAttributes reads them whole, fields picks attributes. For the slowest spans, set sortColumn=duration and sortDirection=DESC; duration is in nanoseconds. It reads a sample; for the true slowest, get search-aggregations Max(duration) with exact set to true, then search duration>=it. For one session, query secure_session_id=<id> from its created_at to three hours later. Pass environments and services.

  • Start experiment iteration

    Start an experiment iteration and allocate live end-user traffic. Requires explicit user confirmation and must not automatically follow creation or update. Timestamps in the result are UTC.

  • Start guarded rollout

    Before calling this tool, call load-skill for the `feature-flags/launchdarkly-guarded-rollout` guide without asking the user, since loading is read-only; it covers stage design and metric choice, which this tool does not validate. Start a guarded rollout on an enabled flag. Omit ruleId to use the default rule, or set ruleId to an existing targeting rule's _id. Each metric needs key; set isGroup for a metric group and autoRollback on an individual metric to roll back when it regresses. Do not send regressionThreshold or onRegression: LaunchDarkly rolls back on any regression it is statistically confident about. autoRollback cannot be set on a metric group. updateDefaultRuleOnCompletion is only for a rule target: completing the rollout deletes that rule and serves the test variation from the default rule. Stage weights are integer basis points and cannot exceed 50000 (50%). Success is returned only when LaunchDarkly's response shows an active measured rollout on that same target, and the result's target is {kind: fallthrough} or {kind: rule, ruleId}. Approval-required environments return instructions for create-approval-request.

  • Stop experiment iteration

    Stop the currently running experiment iteration with a required winning treatment. Timestamps in the result are UTC.

  • Stop guarded rollout

    Stop an active guarded rollout. Omit ruleId to stop the rollout on the default rule, or set ruleId to stop the rollout on that targeting rule. The tool finds the active release itself and stops it through the environment-releases API. outcome rollBack serves the control variation and rollForward serves the test variation; omit outcome to roll back. A rollForward stop can fail if that phase has already ended. Success is returned only when the flag read-back shows the rollout is gone. The result includes target, outcome, and releaseId. Approval-required environments return instructions for create-approval-request.

  • Toggle alert

    Enable or disable an observability alert without changing its configuration. Use this to silence a noisy alert during an incident or maintenance window, and to turn it back on afterwards. The alert's query, threshold, and destinations are untouched. Set disabledUntil to mute it for a window: it re-enables itself then. Mute windows are off for most projects; when the backend rejects one, the alert is not changed and you can disable it without disabledUntil instead. Takes alertId (from get-alerts) and enabled (true enables, false disables); disabledUntil (ISO 8601 or now+2h) works with enabled false. Returns alert_id, enabled, updated (true once reading the alert back shows the new state) and disabled_until. Example - mute alert 42 for two hours: {"projectKey": "default", "alertId": 42, "enabled": false, "disabledUntil": "now+2h"}

  • Toggle flag

    Turn a feature flag's targeting on or off in a specific environment.

PreviousPage 7 / 9Next