Skip to content

Latest commit

 

History

History
119 lines (88 loc) · 3.05 KB

File metadata and controls

119 lines (88 loc) · 3.05 KB
title MCP Server Setup
description Guide the user through installing and configuring the LaunchDarkly MCP server for enhanced agent workflows

MCP Server Setup

After the SDK is integrated and the first flag is working, offer to set up the LaunchDarkly MCP server. This enables richer agent-driven workflows like flag management, targeting, and experimentation directly from the editor.

Step 1: Check if MCP Server is Already Installed

Look for @launchdarkly/mcp-server in the user's MCP configuration:

  • Cursor: Check .cursor/mcp.json or the Cursor settings UI
  • VS Code / Copilot: Check .vscode/mcp.json or the MCP settings
  • Claude Desktop: Check claude_desktop_config.json
  • Other agents: Check the agent's MCP server configuration

If already installed, skip this step and congratulate the user — they're all set.

Step 2: Ask the User

If the MCP server is not installed, ask:

"Would you like to install the LaunchDarkly MCP server? It lets your AI agent create and manage feature flags, set up targeting rules, and more — all without leaving your editor."

If the user declines, skip to the end. The SDK integration is complete without it.

Step 3: Install the MCP Server

For Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "launchdarkly": {
      "command": "npx",
      "args": ["-y", "@launchdarkly/mcp-server"],
      "env": {
        "LAUNCHDARKLY_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
      }
    }
  }
}

For Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "launchdarkly": {
      "command": "npx",
      "args": ["-y", "@launchdarkly/mcp-server"],
      "env": {
        "LAUNCHDARKLY_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
      }
    }
  }
}

For VS Code / Copilot

Add to .vscode/mcp.json:

{
  "servers": {
    "launchdarkly": {
      "command": "npx",
      "args": ["-y", "@launchdarkly/mcp-server"],
      "env": {
        "LAUNCHDARKLY_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
      }
    }
  }
}

Replace YOUR_ACCESS_TOKEN with the user's LaunchDarkly API access token. If they already used one during the onboarding flow, suggest reusing it.

Step 4: Verify the MCP Server

After configuring:

  1. Restart the editor or reload the MCP configuration
  2. Ask the user to try a command like "list my feature flags" to verify the MCP server is connected
  3. If it works, the setup is complete

What the MCP Server Enables

With the MCP server installed, agents can:

  • Create and manage feature flags
  • Configure targeting rules and percentage rollouts
  • Toggle flags on/off across environments
  • View flag status and evaluation insights
  • Manage AI configs and experiments

Status

[STATUS] Checking for existing MCP server installation
[STATUS] Offering MCP server setup
[STATUS] Configuring MCP server
[STATUS] Verifying MCP server connection

Onboarding complete! The user now has:

  1. A LaunchDarkly SDK integrated into their project
  2. A working feature flag they can toggle
  3. (Optionally) The MCP server for ongoing flag management