LaunchDarkly hosted MCP server

This topic describes 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

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

Quick configuration

If you’re using an AI client, like Claude or Cursor, the install page connects to it without requiring you to manually edit a configuration file. Open the install page, select your AI client, and follow the prompts to authorize and connect.

If the LaunchDarkly server does not appear in your client’s list of MCP servers after you add it, close and reopen the client.

Manual configuration

If you prefer to configure your AI client manually, read the instructions in this section. Here, we show examples for Cursor, Claude Code, Windsurf, and GitHub Copilot.

Cursor supports two methods for adding the MCP server.

To add the server through Cursor Settings:

  1. In Cursor, navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools.
  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:

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

    Cursor
    1{
    2 "mcpServers": {
    3 "launchdarkly": {
    4 "url": "https://mcp.launchdarkly.com/mcp/launchdarkly",
    5 "headers": {}
    6 }
    7 }
    8}
  2. Close and reopen Cursor to prompt the appearance of the LaunchDarkly server.

  3. In Cursor, navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools.

  4. Toggle on the LaunchDarkly server.

  5. Click Connect to authorize with your LaunchDarkly account.

To manually configure the MCP server in Claude Code, add the server to your Claude Code MCP configuration:

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

Then, exit and restart Claude Code. A running session does not pick up the new server.

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:

    Windsurf
    1{
    2 "mcpServers": {
    3 "launchdarkly": {
    4 "serverUrl": "https://mcp.launchdarkly.com/mcp/launchdarkly"
    5 }
    6 }
    7}
  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. Under the MCP configuration section, add the following .json configuration:

    GitHub Copilot
    1{
    2 "mcpServers": {
    3 "launchdarkly": {
    4 "url": "https://mcp.launchdarkly.com/mcp/launchdarkly",
    5 "headers": {}
    6 }
    7 }
    8}
  4. Click Save.

Migrate to the hosted server

If you used an earlier version of the local npx-based server, migrate to the hosted server using these steps:

  1. Replace your old server configuration. Your old configuration looks like this:

    Old configuration to remove
    1{
    2 "mcpServers": {
    3 "LaunchDarkly": {
    4 "command": "npx",
    5 "args": [
    6 "-y", "--package", "@launchdarkly/mcp-server",
    7 "--", "mcp", "start",
    8 "--api-key", "api-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    9 ]
    10 }
    11 }
    12}

    and should be replaced with this:

    New configuration to add
    1{
    2 "mcpServers": {
    3 "launchdarkly": {
    4 "type": "http",
    5 "url": "https://mcp.launchdarkly.com/mcp/launchdarkly"
    6 }
    7 }
    8}
  2. Remove any environment variables for the local server, such as LD_ACCESS_TOKEN. Instead, OAuth now handles authentication.

  3. Close and reopen your AI client.

  4. (Cursor only) If you are using Cursor, authorize your LaunchDarkly account:

    • Navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools.
    • Toggle on the LaunchDarkly server.
    • Click connect.

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 that occurs after completing the OAuth consent screen usually indicates 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. If you can create your own roles, verify that 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. To reconnect in Cursor, follow the steps in Manual configuration, then click Connect again to complete the consent screen.

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