mcp-configure
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLaunchDarkly MCP Server Configuration (onboarding)
LaunchDarkly MCP 服务器配置(入门引导)
Configures the LaunchDarkly hosted MCP server so flag management skills and onboarding can use MCP tools. Uses OAuth for authentication — no API keys needed for the hosted server.
This skill is nested under LaunchDarkly onboarding; the parent skill's Step 4 hands off here. Hosted MCP is the default. For federal/EU or other cases where hosted is unavailable, use the Local server via section in MCP Config Templates and local MCP server docs.
npx配置LaunchDarkly托管的MCP服务器,以便功能标志管理技能和入门引导流程可以使用MCP工具。采用OAuth进行认证——托管服务器无需API密钥。
本技能嵌套在LaunchDarkly入门引导之下;父级技能的第4步会将流程移交至此。托管式MCP是默认选项。对于联邦/欧盟或其他无法使用托管服务的场景,请使用MCP配置模板中的通过搭建本地服务器章节,以及本地MCP服务器文档。
npxPrerequisites
前提条件
- A LaunchDarkly account (sign up at https://app.launchdarkly.com/signup?source=agent)
- An MCP-compatible coding agent
- 拥有LaunchDarkly账户(在https://app.launchdarkly.com/signup?source=agent注册)
- 兼容MCP的编码Agent
Hosted MCP Servers
托管式MCP服务器
LaunchDarkly provides two hosted MCP servers. For onboarding, only the feature management server is required.
| Server | URL | Purpose |
|---|---|---|
| Feature management | | Manage feature flags |
| AI Configs | | Manage AI Configs |
LaunchDarkly提供两款托管式MCP服务器。入门引导阶段仅需功能管理服务器。
| 服务器类型 | URL | 用途 |
|---|---|---|
| 功能管理 | | 管理Feature flags |
| AI配置 | | 管理AI Configs |
Workflow
工作流程
Step 1: Detect the Agent
步骤1:检测Agent
If the parent onboarding skill already identified the agent, use that context. Otherwise infer from agent-specific directories, config files, and the tools available to you at runtime. Do not ask the user — pick the strongest match.
如果父级入门技能已识别出Agent,请使用该上下文信息。否则,从Agent专属目录、配置文件以及运行时可用工具中推断。无需询问用户——选择最匹配的选项。
Step 2: Try Quick Install
步骤2:尝试快速安装
The fastest path is the quick install link. Present it to the user:
Feature management: https://mcp.launchdarkly.com/mcp/fm/install
AI Configs (optional): https://mcp.launchdarkly.com/mcp/aiconfigs/install
Important: tell the user what to expect after clicking the link. The install link may open in the browser, but the authorization or "add server" prompt typically appears back in the coding environment (the editor or host app where the agent runs), not in the browser. Immediately after presenting the link, include guidance like:
- After clicking the link, watch your coding environment (the editor where this conversation is running) for an approval dialog, an "add MCP server" prompt, or a tools/integrations panel notification.
- The browser may start the OAuth flow, but you'll likely need to confirm or approve the server in the editor itself.
- If no prompt appears: check the editor's MCP, integrations, or tools settings area to see if the server was added but needs to be enabled. If it's not there at all, fall back to manual setup (Step 3 below).
If the quick install link doesn't work (agent doesn't support it, or user prefers manual setup), proceed to Step 3.
最快的方式是使用快速安装链接。将其展示给用户:
重要提示:告知用户点击链接后的预期流程。 安装链接可能会在浏览器中打开,但授权或“添加服务器”提示通常会出现在编码环境中(即Agent运行的编辑器或宿主应用),而非浏览器。展示链接后,请立即提供如下指导:
- 点击链接后,请留意你的编码环境(即本次对话运行的编辑器),查看是否出现确认对话框、“添加MCP服务器”提示或工具/集成面板通知。
- 浏览器可能会启动OAuth流程,但你可能需要在编辑器中确认或批准服务器。
- 如果未出现提示: 检查编辑器的MCP、集成或工具设置区域,查看服务器是否已添加但需要启用。如果完全未添加,请回退至手动设置(如下步骤3)。
如果快速安装链接无法使用(Agent不支持,或用户偏好手动设置),请继续步骤3。
Step 3: Manual Configuration
步骤3:手动配置
Locate the MCP config file for the detected agent and add the hosted server entry. See MCP Config Templates for the exact JSON per agent.
| Agent | Config file location |
|---|---|
| Cursor | |
| Claude Code | |
| GitHub Copilot | Repo Settings on GitHub.com → Copilot → Cloud agent → MCP (see MCP UI links) |
| Windsurf | Agent-specific MCP config |
Only add the feature management server for onboarding. Add the AI Configs server only if the user explicitly needs it.
找到已检测到的Agent对应的MCP配置文件,并添加托管服务器条目。各Agent的具体JSON格式请参见MCP配置模板。
| Agent | 配置文件位置 |
|---|---|
| Cursor | |
| Claude Code | |
| GitHub Copilot | GitHub.com上的仓库设置 → Copilot → 云Agent → MCP(参见MCP UI链接) |
| Windsurf | Agent专属MCP配置 |
入门引导阶段仅添加功能管理服务器。 仅当用户明确需要时,才添加AI配置服务器。
Step 4: Agent-Specific Authorization
步骤4:Agent专属授权
After writing the config, some agents need extra steps. Do not send users through long manual menu paths only—use MCP UI links (HTTPS docs + shortcuts for VS Code / Cursor).
command:Cursor:
- Open MCP in Cursor using the Cursor MCP doc link and in-app shortcuts (e.g. Settings search via link when clickable).
command: - Toggle on LaunchDarkly feature management (or the name from your config).
- Click Connect to authorize with the LaunchDarkly account.
VS Code (when applicable):
- Use VS Code MCP doc + / Settings links; trust or start the server if prompted.
mcp.json
Claude Code:
- Authorization happens automatically on first MCP tool call via OAuth prompt. File-based setup: Claude Code MCP doc.
GitHub Copilot:
- Click Save after adding the MCP configuration in repo settings. Use the GitHub Copilot MCP doc for the exact Settings path on github.com.
完成配置后,部分Agent需要额外步骤。请勿仅引导用户通过冗长的手动菜单路径——请使用MCP UI链接(HTTPS文档 + 适用于VS Code/Cursor的快捷方式)。
command:Cursor:
- 使用Cursor MCP文档链接及应用内快捷方式在Cursor中打开MCP(例如,可点击的链接打开设置搜索)。
command: - 开启LaunchDarkly功能管理(或配置中的对应名称)。
- 点击连接以使用LaunchDarkly账户授权。
VS Code(适用时):
- 使用VS Code MCP文档 + /设置链接;如有提示,请信任或启动服务器。
mcp.json
Claude Code:
- 首次调用MCP工具时,会通过OAuth提示自动完成授权。基于文件的设置:Claude Code MCP文档。
GitHub Copilot:
- 在仓库设置中添加MCP配置后,点击保存。具体的github.com上的设置路径请参见GitHub Copilot MCP文档。
Step 5: Restart and Auto-Verify
步骤5:重启与自动验证
MCP tools are only available to the agent after a restart or refresh — newly added MCP servers do not appear mid-session.
- Tell the user to enable the server and restart. Before restarting, they need to make sure the MCP server is toggled on and authorized in their editor's MCP settings (e.g. in Cursor: toggle on the LaunchDarkly server and click Connect). Then restart or refresh the agent — be specific about how: "Restart Cursor" / "reload Claude Code" / "refresh the Copilot agent" depending on what you detected in Step 1. After the user restarts, the conversation will resume in a new turn.
- On the next turn, probe silently. Call a lightweight MCP tool (e.g. with the user's project key). Do not ask the user whether MCP is working — just try it.
list-feature-flags- Success (normal response, even an empty flag list): MCP is live. Note it in the onboarding log and continue.
- Failure (tool not found, auth error, timeout): fall back to ldcli/API. Note the fallback in the onboarding log. Do not block the rest of onboarding — Steps 5-6 must still be completable without MCP.
- If the probe fails, briefly tell the user MCP isn't available yet and that you'll use ldcli/API instead. Offer a one-liner they can try later to re-enable MCP (e.g. "You can set up MCP anytime by clicking [quick install link] and restarting").
- If the failure looks like a config issue (wrong file path, missing OAuth, server not enabled), mention the likely cause so the user can fix it on their own time — but do not block progress.
For local server verification, see MCP Config Templates — Verify (local server).
npx只有在重启或刷新后,Agent才能使用MCP工具——新添加的MCP服务器不会在会话中途生效。
- 告知用户启用服务器并重启。 重启前,他们需要确保编辑器的MCP设置中已开启并授权MCP服务器(例如,在Cursor中:开启LaunchDarkly服务器并点击连接)。然后重启或刷新Agent——请给出具体操作说明:“重启Cursor”/“重新加载Claude Code”/“刷新Copilot Agent”,具体取决于步骤1中检测到的Agent。用户重启后,对话将在新轮次中继续。
- 下一轮次中静默探测。 调用轻量级MCP工具(例如,使用用户的项目密钥调用)。无需询问用户MCP是否正常工作——直接尝试即可。
list-feature-flags- 成功(响应正常,即使是空的Feature flags列表):MCP已生效。在入门引导日志中记录并继续流程。
- 失败(工具未找到、授权错误、超时):回退至ldcli/API。在入门引导日志中记录回退操作。请勿阻塞后续入门引导流程——第5-6步必须能够在无MCP的情况下完成。
- 如果探测失败,简要告知用户MCP暂不可用,将改用ldcli/API。提供一句后续可重新启用MCP的说明(例如:“你可随时点击[快速安装链接]并重启,重新设置MCP”)。
- 如果失败看起来是配置问题(文件路径错误、缺少OAuth、服务器未启用),请提及可能的原因,以便用户自行修复——但请勿阻塞流程。
本地服务器的验证,请参见MCP配置模板——验证(本地服务器)。
npxLocal MCP: Access Token Setup
本地MCP:访问令牌设置
When the user needs the local server (federal/EU or other cases where hosted MCP is unavailable), the server requires a . This is a sensitive credential.
npxLAUNCHDARKLY_ACCESS_TOKENFirst, tell the user how to create a token if they don't already have one:
Create an API access token at app.launchdarkly.com/settings/authorization/tokens/new. Give it a descriptive name (e.g. "MCP server") and at minimum the Reader role. Copy the token — you won't be able to see it again after leaving the page.
Then ask how they want to add the token to the MCP config:
D4-LOCAL -- BLOCKING: Call your structured question tool now.
- question: "The local MCP server needs an API access token to authenticate with LaunchDarkly. You can create one at app.launchdarkly.com/settings/authorization/tokens/new. Once you have the token, how would you like to add it to your MCP config? We recommend adding it yourself — there is a non-zero risk when an AI agent handles secrets, as tokens may persist in conversation history, logs, or model context."
- options:
- "I'll add the token to the config myself — just tell me which file and variable"
- "I have the token ready — go ahead and help me wire up the config"
- STOP. Do not write the question as text. Do not write any token value to a config file before the user selects an option.
If the user adds the token themselves:
- Tell them the config file path for their agent (see MCP Config Templates)
- Tell them to set as the value — either as an environment variable or directly in the config file
LAUNCHDARKLY_ACCESS_TOKEN - Remind them to add the config file to if the token is inline
.gitignore - Wait for them to confirm, then proceed to Step 5 (Restart and Auto-Verify)
If the user wants agent-assisted setup:
- Ensure the config file is in before writing
.gitignore - Write the config per MCP Config Templates
- Remind the user that the token will be visible in the config file and conversation history
- Proceed to Step 5 (Restart and Auto-Verify)
当用户需要本地服务器(联邦/欧盟或其他无法使用托管式MCP的场景)时,服务器需要。这是敏感凭证。
npxLAUNCHDARKLY_ACCESS_TOKEN首先,告知用户如果没有令牌,如何创建:
在app.launchdarkly.com/settings/authorization/tokens/new创建API访问令牌。为其设置一个描述性名称(例如“MCP服务器”),至少赋予Reader角色。复制令牌——离开页面后将无法再次查看。
然后询问用户希望如何将令牌添加到MCP配置中:
D4-LOCAL -- BLOCKING: 立即调用结构化问题工具。
- 问题:“本地MCP服务器需要API访问令牌以向LaunchDarkly认证。你可在app.launchdarkly.com/settings/authorization/tokens/new创建令牌。获得令牌后,你希望如何将其添加到MCP配置中?我们建议你自行添加——AI Agent处理密钥存在一定风险,因为令牌可能会保留在对话历史、日志或模型上下文中。”
- 选项:
- “我会自行将令牌添加到配置中——只需告诉我对应的文件和变量”
- “我已准备好令牌——请帮我完成配置”
- STOP。请勿将问题以文本形式写出。在用户选择选项前,请勿将任何令牌值写入配置文件。
如果用户自行添加令牌:
- 告知用户其Agent对应的配置文件路径(参见MCP配置模板)
- 告知用户将设置为对应值——可作为环境变量或直接写入配置文件
LAUNCHDARKLY_ACCESS_TOKEN - 提醒用户如果令牌直接写入配置文件,请将该配置文件添加到中
.gitignore - 等待用户确认,然后继续步骤5(重启与自动验证)
如果用户希望Agent协助设置:
- 写入配置前,确保配置文件已在中
.gitignore - 根据MCP配置模板写入配置
- 提醒用户令牌将在配置文件和对话历史中可见
- 继续步骤5(重启与自动验证)
Edge Cases
边缘情况
- User already has MCP configured: Verify by checking for existing LD MCP entries in the config. If present and working, skip configuration.
- User has the old npx-based local server: Migrate them. Remove the old entry and any
npx @launchdarkly/mcp-serverenv vars. Replace with the hosted server config.LD_ACCESS_TOKEN - Federal or EU instances: The hosted MCP server is not available for federal or EU environments. Use local MCP server docs and the Local server via section in MCP Config Templates. Follow the Local MCP: Access Token Setup flow for token handling.
npx - Agent not in known list: Provide the generic pattern: the user needs to add an MCP server entry pointing to using whatever format their agent expects.
https://mcp.launchdarkly.com/mcp/fm - User opts out of MCP during onboarding: Document that choice and continue with the parent skill's ldcli/API fallbacks for environments and flags; do not block SDK work.
- 用户已配置MCP: 通过检查配置中是否存在现有LD MCP条目进行验证。如果已存在且正常工作,跳过配置步骤。
- 用户使用旧版基于npx的本地服务器: 帮助迁移。移除旧的条目及所有
npx @launchdarkly/mcp-server环境变量。替换为托管服务器配置。LD_ACCESS_TOKEN - 联邦或欧盟实例: 托管式MCP服务器不适用于联邦或欧盟环境。请使用本地MCP服务器文档和MCP配置模板中的通过搭建本地服务器章节。遵循本地MCP:访问令牌设置流程处理令牌。
npx - Agent不在已知列表中: 提供通用模式:用户需要添加一个指向的MCP服务器条目,格式遵循其Agent要求。
https://mcp.launchdarkly.com/mcp/fm - 用户在入门引导阶段选择不使用MCP: 记录该选择,并继续使用父级技能的ldcli/API回退方案处理环境和Feature flags;请勿阻塞SDK相关工作。
What NOT to Do
禁止操作
- Don't configure the old npx-based local server by default. Prefer the hosted server for standard regions.
- Don't ask for or store API keys for the hosted server. The hosted server uses OAuth.
- Don't add both servers by default. Only add AI Configs if the user asks for it.
- Don't handle the access token for local MCP without asking the user first via the D4-LOCAL decision point.
- 默认情况下,请勿配置旧版基于npx的本地服务器。标准区域优先使用托管服务器。
- 请勿索要或存储托管服务器的API密钥。托管服务器使用OAuth。
- 默认情况下,请勿同时添加两款服务器。仅当用户要求时才添加AI配置服务器。
- 在通过D4-LOCAL决策点询问用户前,请勿处理本地MCP的访问令牌。
References
参考资料
- MCP UI links — HTTPS + links to open MCP settings (Cursor, VS Code, Claude Code, Windsurf, GitHub)
command: - MCP Config Templates — hosted OAuth JSON per agent; Local server via fallback; migration from old local server
npx - Official MCP docs — full hosted setup guide
- MCP UI链接 —— 用于打开MCP设置的HTTPS + 链接(Cursor、VS Code、Claude Code、Windsurf、GitHub)
command: - MCP配置模板 —— 各Agent的托管式OAuth JSON;通过搭建本地服务器回退方案;从旧版本地服务器迁移的方法
npx - 官方MCP文档 —— 完整的托管式设置指南