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 athttps://mcp.launchdarkly.com/mcp. LaunchDarkly runs the server. The server connects your AI client to LaunchDarkly using OAuth and supports feature flag management, AgentControl configs, experimentation, and observability.
The hosted MCP server accepts only OAuth access tokens. It rejects personal and service API access tokens. Don’t add an API access token to your AI client’s configuration.
Access tokens for the MCP server last two hours, and your AI client refreshes them automatically. You must authorize the connection again every 90 days. If someone removes you from your LaunchDarkly account, the connection ends. Changes to your role apply immediately.
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:- Open the install page.
- (Optional) In the “Connection settings” section, choose the toolsets and the level of write access your AI client has. To learn more, read Scope the tools available to your AI client.
- Choose your AI client.
- 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.Expand Cursor installation instructions
Expand Cursor installation instructions
Cursor supports three methods to add the MCP server: through the LaunchDarkly plugin, through Cursor’s settings, and through the Cursor configuration file.The LaunchDarkly plugin for Cursor adds the hosted MCP server and the LaunchDarkly agent skills.To add the server with the LaunchDarkly plugin:
- Open the LaunchDarkly plugin in the Cursor Marketplace.
- Click Sign In To Add and follow the prompts. Alternatively, enter
/add-plugin launchdarklyin the Cursor chat.
- Navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools in Cursor.
- Click Add Custom MCP. An “Install MCP Server?” dialog appears.
-
Enter the following values:
- Name:
LaunchDarkly - Type:
streamableHttp - URL:
https://mcp.launchdarkly.com/mcp
- Name:
- Click Install.
-
Create or update
.cursor/mcp.jsonin your project root with the following: - Navigate to Settings > Cursor Settings > Tools & Integrations > MCP Tools.
- Toggle on the LaunchDarkly server.
- Click Connect to authorize with your LaunchDarkly account.
Expand Claude Code installation instructions
Expand Claude Code installation instructions
To manually configure the MCP server in Claude Code:
-
Add the server to your Claude Code MCP configuration with the following:
Expand Windsurf installation instructions
Expand Windsurf installation instructions
To manually configure the MCP server in Windsurf:
- Open Windsurf Settings and navigate to Cascade.
-
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
- macOS:
-
Add the LaunchDarkly server to the
mcpServersobject with the following: - Save the file and restart Windsurf.
Expand GitHub Copilot installation instructions
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:
- Navigate to a target repository on GitHub.
- Select Settings > Code and automation > Copilot > Coding agent.
-
Navigate to the “MCP configuration” section and add the following JSON configuration:
- Click Save.
Scope the tools available to your AI client
By default, the hosted MCP server makes every tool available to your AI client. To narrow this list, addtoolsets and writes query parameters to the server URL. A smaller list of tools can help your AI client choose the right tool and keep a read-only workflow from offering tools that change data.
The toolsets parameter takes a comma-separated list of toolset names. For the current list of toolsets and their tools, open the install page. The toolsets include:
flags: Feature flag inventory, configuration, targeting, and cleanup, and the segments and contexts that flags target.approvals: Flag, segment, and AgentControl config approval workflows.agent-control: AgentControl configs, variations, tools, skills, model configs, graphs, targeting, prompts, datasets, evaluations, and playgrounds.experiments: Experiments and metrics.account: Projects, environments, SDK keys, members, views, change history, SDK activity, and service connection usage.observability: Logs, traces, sessions, funnels, dashboards, graphs, and alerts.releases: Release Autopilot, guarded rollouts, release plans and policies, and rollout completeness.guides: Documentation and agent skills.
writes parameter sets the level of write access the tools provide:
none: Only tools that read data.additive: Tools that read data, and tools that create or add data without overwriting or deleting anything.destructive: All tools, including tools that update or delete data. This is the default.
Data sharing and prompt injection
When your AI client calls an MCP tool, the client sends the tool’s result to the AI model it uses. This means the LaunchDarkly data that MCP tools return leaves LaunchDarkly and goes to your AI model provider. LaunchDarkly doesn’t control your AI client or your model provider.Data that can leave LaunchDarkly
Depending on which tools your AI client calls, the data sent to your model provider can include:- Flag, segment, and AgentControl config details, such as names, descriptions, targeting rules, and variations.
- Change history and approval requests, including their descriptions.
- Contexts and their attributes, which can include personal data about your end users.
- Observability data, such as logs, traces, errors, and session details.
- The names and email addresses of members in your LaunchDarkly account.
- Server-side SDK keys, if your AI client calls the tool that returns them.
Prompt injection
Some of the data that MCP tools return is written by people other than you. Members of your account write flag descriptions, segment names, and approval request descriptions. Your applications and your end users produce logs, errors, session details, and context attributes. The model reads this content as part of the tool result, and it might follow instructions hidden in that content. This is called prompt injection. This means that anyone who can write data that MCP tools return can try to give instructions to the model that you connect. The model acts with the access you authorized. Here is an example of a flag description that contains an injected instruction:Reduce the risk
To reduce the risk of data sharing:- Connect as a member whose role grants only the access your work needs. The MCP server acts with the permissions of the member who authorized it. For example, if you only need to read flags, connect as a member with a Reader base role.
- Keep connections short-lived. Disconnect the MCP server in your AI client when you finish your work. When you no longer need it, revoke its access in LaunchDarkly. To learn how to revoke access, read Disconnect an OAuth app.
- Review tool calls before your AI client runs them, especially calls that change or delete data. Don’t set your AI client to approve these calls automatically.
- Scope the tools your AI client sees with the
toolsetsandwritesURL parameters. For example, addwrites=nonefor a read-only workflow. These parameters keep tools you don’t need out of the connection, but they don’t replace a limited role. To learn more about limiting access, read Reduce the risk.
Migrate to the hosted server
To update a connection to an earlier version of the hosted MCP server, read Update an earlier hosted server connection. To migrate from the localnpx-based server, read Migrate from the local server.
Update an earlier hosted server connection
The hosted MCP server previously ran on a third-party platform. LaunchDarkly now runs the server itself at the samemcp.launchdarkly.com hostname. The server URL is now https://mcp.launchdarkly.com/mcp. You still sign in with OAuth, and the server still acts with the permissions of the member who authorized it.
For a limited time, the earlier URL, https://mcp.launchdarkly.com/mcp/launchdarkly, also connects to the new server. Existing connections keep working, and you don’t need to sign in again. After that, LaunchDarkly retires the earlier URL. Update your connection before then.
The new server also renames some tools. For example, get-agentcontrol-config is now get-agent-configs, and list-flags is now get-flags. The server doesn’t accept the earlier names. Until you reconnect, a call that uses an earlier name returns an error that asks you to reconnect. After you reconnect, your AI client loads the new tool list. Update your prompts, rules files, or agent skills that name a tool directly to use the new names.
To update your connection:
- Change the server URL in your AI client’s configuration from
https://mcp.launchdarkly.com/mcp/launchdarklytohttps://mcp.launchdarkly.com/mcp. To update a connection you configured with the install page, open the install page and follow the prompts for your AI client again. - Remove any API access token from the configuration, such as one in an
Authorizationheader. The hosted MCP server accepts only OAuth access tokens. - Disconnect and reconnect the server to restart the OAuth flow.
- 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.
Migrate from the local server
To migrate from the localnpx-based server:
-
Replace your existing server configuration. Here is an example of a configuration to remove:
Here is an example of a configuration to add:Remove any hardcoded API keys or environment variables used by the local server, such as the
--api-keyargument orLD_ACCESS_TOKEN. OAuth now handles authentication instead. - Close and reopen your AI client.
- Disconnect and reconnect the server to restart the OAuth flow.
- 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.
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. If you see a 401 error instead, confirm that your AI client’s configuration doesn’t include an API access token. The hosted MCP server rejects personal and service API access tokens. To resolve a 403 error:- 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 Project developer preset role, or another role that provides this access.
- If your account uses custom role creation, confirm that your custom role includes access to the project and environment you want to use through MCP tools.
- Disconnect and reconnect the server to restart the OAuth flow.
- If you use 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.