C

Connected Launchdarkly

Boost productivity using this official, launchdarkly, server, feature. Includes structured workflows, validation checks, and reusable patterns for devtools.

MCPClipticsdevtoolsv1.0.0MIT
0 views0 copies

Connected LaunchDarkly

Connect Claude Code to LaunchDarkly for managing feature flags, targeting rules, AI configurations, and gradual rollouts through the Model Context Protocol.

When to Use This MCP Server

Connect this server when you need to:

  • Create, modify, and manage feature flags and their targeting rules directly from Claude Code while implementing the features they control
  • Configure gradual rollouts, percentage-based targeting, and user segment rules for new features as part of your development and release workflow
  • Review flag states across environments (dev, staging, production) to verify feature availability before deploying code changes

Consider alternatives when:

  • You need complex audit trail analysis or flag dependency visualization, which the LaunchDarkly web dashboard provides with richer visual tools
  • Your feature flagging needs are limited to simple boolean toggles that can be managed through environment variables or config files

Quick Start

Configuration

name: connected-launchdarkly type: mcp category: devtools

Example Connection

claude mcp:connect connected-launchdarkly

Available Tools

list-flags:          List all feature flags in a project with their current states per environment
get-flag:            Retrieve detailed flag configuration including variations and targeting rules
create-flag:         Create a new feature flag with variations, tags, and default targeting
update-targeting:    Modify flag targeting rules, segments, and percentage rollouts
toggle-flag:         Enable or disable a feature flag in a specific environment

Core Concepts

LaunchDarkly MCP Integration Overview

AspectDetails
Transportstdio-based process via npx running @launchdarkly/mcp-server package
AuthenticationLaunchDarkly API key with project and environment access permissions
Flag TypesBoolean, multivariate string, number, and JSON flag variations
TargetingUser-level, segment-based, percentage rollout, and custom rule targeting
EnvironmentsFull support for managing flags across dev, staging, production, and custom

LaunchDarkly Flag Management Architecture

Claude Code IDE
    |
    v
[MCP Client] --stdio--> [LaunchDarkly MCP Server]
                              |
                              v
                     [LaunchDarkly REST API v2]
                              |
                    +---------+---------+
                    |         |         |
                    v         v         v
              [Flags &   [Targeting [Segments
              Variations] Rules]    & Users]
                    \         |         /
                     [LaunchDarkly Platform]
                   Projects | Environments | Audit

Configuration

ParameterTypeDefaultDescription
LD_API_KEYstringrequiredLaunchDarkly API access key (starts with api-) for REST API access
default_projectstringdefaultDefault LaunchDarkly project key for flag operations
default_environmentstringproductionDefault environment key for flag state queries and toggles
include_archivedbooleanfalseInclude archived flags in listing and search results
confirm_productionbooleantrueRequire confirmation before modifying flags in production environment

Best Practices

  1. Create Flags Before Writing Feature Code - Create the feature flag in LaunchDarkly before implementing the feature. This establishes the flag key in your codebase and ensures the flag exists in all environments before any code references it.

  2. Use Descriptive Flag Keys and Tags - Name flags with clear, descriptive keys (e.g., enable-new-checkout-flow) and add tags for categorization. Good naming makes flags discoverable and helps team members understand flag purpose without reading code.

  3. Start with Percentage Rollouts - Use update-targeting to configure gradual rollouts starting at a small percentage. This reduces risk by exposing new features to a limited audience before full availability, allowing you to monitor for issues.

  4. Verify Flag States Across Environments - Before deploying code that references a flag, use get-flag to verify the flag exists and has appropriate states in all target environments. Missing flags in production cause runtime errors.

  5. Clean Up Completed Flags - After a feature is fully rolled out and stable, archive the feature flag. Accumulated technical debt from unused flags makes the flag management interface harder to navigate and increases evaluation overhead.

Common Issues

  1. API Key Returns 401 Unauthorized - LaunchDarkly API keys are project-scoped. Verify the key has access to the project specified in default_project. API keys from different projects cannot access other projects' flags.

  2. Flag Not Found in Environment - Flags exist at the project level but may not have targeting rules configured for every environment. Use list-flags to verify the flag exists, then check its configuration in the target environment.

  3. Targeting Rule Changes Not Taking Effect - LaunchDarkly SDK clients cache flag evaluations. Changes made through the MCP server are immediately reflected in the API but may take a few seconds to propagate to SDK clients depending on their polling interval.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates