| title | MCP Server Setup |
|---|---|
| description | Guide the user through installing and configuring the LaunchDarkly MCP server for enhanced agent workflows |
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.
Look for @launchdarkly/mcp-server in the user's MCP configuration:
- Cursor: Check
.cursor/mcp.jsonor the Cursor settings UI - VS Code / Copilot: Check
.vscode/mcp.jsonor 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.
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.
Add to .cursor/mcp.json:
{
"mcpServers": {
"launchdarkly": {
"command": "npx",
"args": ["-y", "@launchdarkly/mcp-server"],
"env": {
"LAUNCHDARKLY_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
}
}
}
}Add to claude_desktop_config.json:
{
"mcpServers": {
"launchdarkly": {
"command": "npx",
"args": ["-y", "@launchdarkly/mcp-server"],
"env": {
"LAUNCHDARKLY_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
}
}
}
}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.
After configuring:
- Restart the editor or reload the MCP configuration
- Ask the user to try a command like "list my feature flags" to verify the MCP server is connected
- If it works, the setup is complete
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] 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:
- A LaunchDarkly SDK integrated into their project
- A working feature flag they can toggle
- (Optionally) The MCP server for ongoing flag management