> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LaunchDarkly hosted MCP server

<View title="Developer" />

<View title="Federal docs">
  <Danger>
    **The hosted Model Context Protocol (MCP) server is not available in federal environments**

    For accounts that use a federal environment, use the <a href="/docs/home/getting-started/mcp-local">local MCP server</a> instead.

    To learn more, read <a href="/docs/home/infrastructure/federal">LaunchDarkly in federal environments</a>.
  </Danger>
</View>

<View title="EU docs">
  <Danger>
    **The hosted Model Context Protocol (MCP) server is not available in the European Union (EU) instance**

    For accounts that use the European Union (EU) instance, use the <a href="/docs/home/getting-started/mcp-local">local MCP server</a> instead.

    To learn more, read <a href="/docs/home/infrastructure/eu">LaunchDarkly in the European Union</a>.
  </Danger>
</View>

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](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](https://mcp.launchdarkly.com/mcp/launchdarkly/install).
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.

<AccordionGroup>
  <Accordion title="Expand Cursor installation instructions">
    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:

           <CodeGroup>
             ```json title="Cursor" lines wrap theme={null}
             {
               "mcpServers": {
                 "launchdarkly": {
                   "url": "https://mcp.launchdarkly.com/mcp/launchdarkly",
                   "headers": {}
                 }
               }
             }
             ```
           </CodeGroup>

    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.
  </Accordion>

  <Accordion title="Expand Claude Code installation instructions">
    To manually configure the MCP server in Claude Code:

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

           <CodeGroup>
             ```bash title="Claude Code" lines wrap theme={null}
             claude mcp add --transport http "launchdarkly" \
                 "https://mcp.launchdarkly.com/mcp/launchdarkly"
             ```
           </CodeGroup>
  </Accordion>

  <Accordion title="Expand Windsurf installation instructions">
    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:

           <CodeGroup>
             ```json title="Windsurf" lines wrap theme={null}
             {
               "mcpServers": {
                 "launchdarkly": {
                   "serverUrl": "https://mcp.launchdarkly.com/mcp/launchdarkly"
                 }
               }
             }
             ```
           </CodeGroup>

    4. Save the file and restart Windsurf.
  </Accordion>

  <Accordion title="Expand GitHub Copilot installation instructions">
    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:

           <CodeGroup>
             ```json title="GitHub Copilot" lines wrap theme={null}
             {
               "mcpServers": {
                 "launchdarkly": {
                   "url": "https://mcp.launchdarkly.com/mcp/launchdarkly",
                   "headers": {}
                 }
               }
             }
             ```
           </CodeGroup>

    4. Click **Save**.
  </Accordion>
</AccordionGroup>

## 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:

   <CodeGroup>
     ```json title="Existing configuration to remove" lines wrap theme={null}
     {
       "mcpServers": {
         "LaunchDarkly": {
           "command": "npx",
           "args": [
             "-y", "--package", "@launchdarkly/mcp-server",
             "--", "mcp", "start",
             "--api-key", "api-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
           ]
         }
       }
     }
     ```
   </CodeGroup>

   Here is an example of a configuration to add:

   <CodeGroup>
     ```json title="New configuration to add" lines wrap theme={null}
     {
       "mcpServers": {
         "launchdarkly": {
           "type": "http",
           "url": "https://mcp.launchdarkly.com/mcp/launchdarkly"
         }
       }
     }
     ```
   </CodeGroup>

   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](/docs/home/getting-started/mcp#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](/docs/home/account/roles/role-concepts#base-roles), a LaunchDarkly Developer [preset role](/docs/home/account/roles/role-concepts#preset-roles), or another role that provides this access.
2. For accounts with [custom role creation](/docs/home/account/roles/role-create), 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](https://support.launchdarkly.com).
