LaunchDarkly hosted MCP server

This topic explains how to connect your AI client to the LaunchDarkly hosted Model Context Protocol (MCP) server. To use the hosted MCP server, you must have an AI client that supports MCP, such as Cursor, Claude Code, VS Code with Copilot, or Windsurf.

Configure the MCP server

Configure the hosted MCP server so you can manage feature flags and AgentControl configs, and view observability data, directly from your AI client.

The hosted MCP server is available at https://mcp.launchdarkly.com/mcp/launchdarkly. It connects your AI client to LaunchDarkly using OAuth, and supports feature flag management, AgentControl configs, and observability.

Configure using the install page

Accounts that use an AI client, such as Claude or Cursor, can connect directly through the install page. You do not need to edit a configuration file to use this method.

To configure the server using the install page:

  1. Open the install page.
  2. Choose your AI client.
  3. Follow the prompts to authorize and connect.

Configure manually

To configure your AI client manually, expand the instructions for your client below. This section includes examples for Cursor, Claude Code, Windsurf, and GitHub Copilot.

Cursor supports two methods to add the MCP server.

To add the server through Cursor Settings:

  1. Navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools in Cursor.

  2. Click Add Custom MCP. An “Install MCP Server?” dialog appears.

  3. Enter the following values:

    • Name: LaunchDarkly
    • Type: streamableHttp
    • URL: https://mcp.launchdarkly.com/mcp/launchdarkly
  4. Click Install.

To edit the configuration file directly in Cursor:

  1. Create or update .cursor/mcp.json in your project root with the following:

    Cursor
    {
    "mcpServers": {
    "launchdarkly": {
    "url": "https://mcp.launchdarkly.com/mcp/launchdarkly",
    "headers": {}
    }
    }
    }
  2. Navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools.

  3. Toggle on the LaunchDarkly server.

  4. Click Connect to authorize with your LaunchDarkly account.

To manually configure the MCP server in Claude Code:

  1. Add the server to your Claude Code MCP configuration with the following:

    Claude Code
    claude mcp add --transport http "launchdarkly" \
    "https://mcp.launchdarkly.com/mcp/launchdarkly"

To manually configure the MCP server in Windsurf:

  1. Open Windsurf Settings and navigate to Cascade.

  2. Click View raw config. This opens mcp_config.json. You can also open this file directly:

    • macOS: ~/.codeium/windsurf/mcp_config.json
    • Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
  3. Add the LaunchDarkly server to the mcpServers object with the following:

    Windsurf
    {
    "mcpServers": {
    "launchdarkly": {
    "serverUrl": "https://mcp.launchdarkly.com/mcp/launchdarkly"
    }
    }
    }
  4. Save the file and restart Windsurf.

To manually configure the MCP server with GitHub Copilot, add the server to the MCP configuration for a target GitHub repo:

  1. Navigate to a target repository on GitHub.

  2. Select Settings > Code and automation > Copilot > Coding agent.

  3. Navigate to the “MCP configuration” section and add the following JSON configuration:

    GitHub Copilot
    {
    "mcpServers": {
    "launchdarkly": {
    "url": "https://mcp.launchdarkly.com/mcp/launchdarkly",
    "headers": {}
    }
    }
    }
  4. Click Save.

Migrate to the hosted server

Migrate to the hosted server if you used an earlier version of the local npx-based server. Here’s how:

  1. Replace your existing server configuration. Here is an example of a configuration to remove:

    Existing configuration to remove
    {
    "mcpServers": {
    "LaunchDarkly": {
    "command": "npx",
    "args": [
    "-y", "--package", "@launchdarkly/mcp-server",
    "--", "mcp", "start",
    "--api-key", "api-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
    }
    }
    }

    Here is an example of a configuration to add:

    New configuration to add
    {
    "mcpServers": {
    "launchdarkly": {
    "type": "http",
    "url": "https://mcp.launchdarkly.com/mcp/launchdarkly"
    }
    }
    }

    Remove any hardcoded API keys or environment variables used by the local server, such as the --api-key argument or LD_ACCESS_TOKEN. OAuth now handles authentication instead.

  2. Close and reopen your AI client.

  3. Disconnect and reconnect the server to restart the OAuth flow.

  4. For Cursor, navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools, then click Connect. Claude Code, Windsurf, and GitHub Copilot do not require any additional action.

To learn how to use the MCP server in your AI client, read Use the MCP server.

Resolve a 403 error after OAuth

A 403 error after completing the OAuth consent screen often results from a permissions issue with the account you used, not an OAuth failure.

To resolve a 403 error:

  1. Confirm that the account you authorized has sufficient permissions. The MCP server needs permission to create, read, update, and delete flags and AgentControl configs in the projects you want to use. We recommend a Writer base role, a LaunchDarkly Developer preset role, or another role that provides this access.
  2. For accounts with custom role creation, confirm your custom role includes access to the project and environment you want to use through MCP tools.
  3. Disconnect and reconnect the server to restart the OAuth flow.
  4. For Cursor, navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools, then click Connect. Claude Code, Windsurf, and GitHub Copilot do not require any additional action.

If the error continues after you verify your permissions, contact LaunchDarkly Support.