[Feature Request] Register the MCP server via VS Code's native API and add zh-CN localization
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript, vscode
调研方向
Start by reading package.json, src/debugMCPServer.ts, src/utils/agentCatalog.ts, and src/utils/agentConfigurationManager.ts, then check the VS Code MCP extension guide and existing localization setup. Implementing native registration, preserving non-VS-Code agent configuration, adding fallback behavior, and localizing manifest and runtime strings span several areas. Done means the acceptance criteria pass for both zh-CN and English, including port and host changes.
由索引模型根据 Issue 内容生成。
描述
Feature Request: register the MCP server through VS Code's native API, and add zh-CN localization
中文摘要:希望扩展不要再去直接改写各 Agent 的 MCP 配置文件,而是使用 VS Code 原生的 MCP 服务器注册 API(
vscode.lm.registerMcpServerDefinitionProvider/contributes.mcpServerDefinitionProviders)来自注册自己;同时希望扩展的界面文案、命令标题、设置项描述等提供中文(zh-CN)本地化支持。
Background
Today DebugMCP does not use VS Code's native MCP server registration mechanism. Instead it:
- Runs its own Streamable HTTP MCP server on
http://localhost:<port>/mcp(src/debugMCPServer.ts). - Registers itself with agents by reading and rewriting the agents' config files on disk (
src/utils/agentCatalog.ts,src/utils/agentConfigurationManager.ts), e.g.%APPDATA%\Code\User\mcp.jsonfor GitHub Copilot,~/.copilot/mcp-config.jsonfor Copilot CLI,~/.codex/config.tomlfor Codex, and the variousmcp_settings.jsonfiles for Cline / Roo Code / Cursor / Claude Code / Antigravity.
The file-writing approach works, but it has real downsides:
- It mutates files the extension does not own. Users who keep their MCP configuration under version control or sync it across machines get unexpected diffs.
- Entries are never cleaned up. Uninstalling the extension leaves a stale
debugmcpentry behind in every config file the user selected, and there is no uninstall-time cleanup. - It races with the host editor. VS Code (and the agent itself) may rewrite the same file, so the entry can be lost or clobbered; the user may have to restart or reload the window for Copilot to pick it up.
- It cannot be expressed in the UI. The server does not appear as an extension-provided MCP server in the MCP views, and there is no way to let the user disable/re-enable it from the standard MCP surfaces.
- Port changes are not tracked. Changing
debugmcp.serverPortleaves the previously written URL behind in the config files until the next migration runs. - It does not work in restricted environments. Writing to other tools' config directories can fail (read-only home, sandboxed remote, enterprise policy) and there is no VS Code-native fallback.
Request 1 — Register the MCP server through VS Code's native API
VS Code already provides a first-class way for an extension to expose an MCP server, documented in the official MCP extension guide:
- Contribute
contributes.mcpServerDefinitionProvidersinpackage.json. - Implement the provider with
vscode.lm.registerMcpServerDefinitionProvider(providerId, { onDidChangeMcpServerDefinitions, provideMcpServerDefinitions, resolveMcpServerDefinition }). - Return a
vscode.McpHttpServerDefinitionpointing athttp://localhost:<port>/mcp.
Proposal:
- Add a
debugmcpdefinition provider that registers the server as a VS Code-managed MCP server, so Copilot (and any other VS Code-native agent) discovers it without any config file being touched. - Use
resolveMcpServerDefinitionto lazily start the local server (and to surface port/host changes), so the extension no longer has to eagerly bind a port just to be registered. - Emit
onDidChangeMcpServerDefinitionswhendebugmcp.serverPort/debugmcp.bindHostchange, so the definition stays in sync instead of leaving a stale URL in a config file. - Keep the existing file-based registration for the non-VS-Code agents (Cline, Cursor, Codex, Copilot CLI, Claude Code, …), since those have no equivalent host API. Ideally this becomes an explicit, opt-in choice in the agent selection popup rather than an automatic side effect.
- If the native API is unavailable on the user's VS Code version, fall back to the current file-based path instead of failing.
Related: #118 (MCP not connected to GitHub Copilot agent runtime) — a native registration would also make the server visible to VS Code's own MCP status/error reporting.
Request 2 — Chinese (zh-CN) localization
The extension UI is currently English-only. Please add localization for the end-user-facing surface:
- Manifest strings (
package.json+package.nls.json+package.nls.zh-cn.json):displayName,description, command titles (e.g. "Show Agent Selection Popup"), configuration property titles/descriptions (debugmcp.serverPort,debugmcp.timeoutInSeconds,debugmcp.bindHost,debugmcp.captureDebugOutput), and the category. - Runtime strings (via a
l10nbundle andvscode.l10n.t()): the agent selection dialog ("DebugMCP Setup - Choose AI Agent to Configure", "Configure …", "Add DebugMCP server to this agent"), all notification and error messages (e.g. "DebugMCP server running on …", "DebugMCP successfully configured for …", the invalid-JSON error), and the output-channel messages. - Ideally also localize the
debug-liveskill content, or at least ship a zh-CN variant of it.
Acceptance criteria
- Installing the extension and activating it registers the MCP server in VS Code through the native MCP server definition API, with no file outside the extension being modified for the VS Code / Copilot case.
- The registered definition reflects the current
debugmcp.serverPort/debugmcp.bindHost, and updates when those settings change. - The server shows up in VS Code's MCP server list / status UI as provided by the extension.
- Uninstalling the extension leaves no stale
debugmcpentries behind for VS Code / Copilot. - The agent selection UI, commands, settings descriptions and notifications render in Chinese when the VS Code display language is
zh-cn, and remain English otherwise. - Non-VS-Code agents (Cline, Cursor, Codex, Copilot CLI, Claude Code) keep working through the existing configuration-file mechanism.
Notes
- The extension currently targets
vscode: ^1.104.0, which already includesvscode.lm.registerMcpServerDefinitionProvider.
- 主要语言
- TypeScript
- 星标
- 580
- 派生
- 63
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/DebugMCP 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 56/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 1 天内回复
查看 microsoft/DebugMCP 的全部 Issue
相似的 Issue
-
Navbar avatar and name stay stale after saving profile changes可能已有人在做 @alexechoi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
marmelab/atomic-crm#416 ·
维护者通常 1 天内回复
-
feature-request
难度 2/5 1-3 小时 新手友好度 66/100
bluesky-social/social-app#12343 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
lucide-icons/lucide#5165 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
marktext/marktext#6033 · 1 条评论 ·
维护者通常 1 天内回复
-
area:desktop bug has repro platform:macos
难度 2/5 1-3 小时 新手友好度 62/100
anthropics/claude-code#107903 ·