github / github/copilot-cli

Add support for an MCP server package type that resolves to a local executable

未关闭
#4,634 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

triage
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Describe the feature or problem you'd like to solve

When using an MCP registry that includes an MCP server pointing to a local exe, there is no way to have Copilot install it correctly. Only npm, pypi, oci and docker are supported as "registry type"

Proposed solution

We have MCP servers served as simple binaries. Those are documented in our MCP registry (configured in Azure API Center and enforced through GitHub Copilot Enterprise).

To be able to install those MCP servers using copilot (eg /mcp search ...) correctly, copilot should support a new "registryType" in addition to the existing ones (npm, pypi, oci, docker).

This could be something like "none" or "executable", etc.

The expected behavior would be that if the MCP registry lists an MCP server with the new registry type (none, executable, etc), copilot would add the MCP server in mcp-config.json, fully respecting the MCP registry definition and thus pointing to the executable and NOT using npx, uvx, etc as it currently does.


For reference, here's the analysis of the problematic part of copilot's codebase:

Analyzed the CLI's bundled  app.js . Found the exact logic (functions  umi / cmi  in the MCP-registry install module):

Root cause: Copilot CLI's registry→launch-config converter only supports 4 hardcoded  registryType s, each mapped to a fixed launcher — there's no "binary/exe" package type at all:

switch (t.registryType) {
  case "npm":    n.push("npx"), ..., n.push("-y"), n.push(identifier[@version]); break;
  case "pypi":   n.push("uvx"), ..., n.push(identifier); break;
  case "oci":
  case "docker": n.push("docker","run","--rm","-i"), ...; break;
  default: throw new Error(`Unsupported package type: ${t.registryType}`);
}

And a supportability gate:  ["npm","pypi","oci","docker"].includes(registryType)  — anything else is rejected as "not yet supported."

What this means for you: if your registry's GitLab MCP entry has  registryType: "npm" , Copilot always synthesizes  npx -y <identifier>@<version>  — it never reads or honors a custom "command/exe path" field from the registry package object, regardless of what your registry intends. There's a separate  commandToRegistryType  map (npx→npm, uvx→pypi, dotnet→nuget, docker→docker, brew→homebrew, mcpb→mcpb) used for fingerprinting, but the actual launch-builder ( umi ) doesn't implement nuget/homebrew/mcpb either — only npm/pypi/oci/docker.

Bottom line: there's currently no supported registry package type that resolves to a raw local executable path. To point at your exe you'd need to bypass  /mcp search / /mcp add -from-registry and instead manually add the server ( /mcp add  with explicit command, or edit the MCP config file directly) with  command: "C:\path\to\gitlab-mcp.exe" 
Example prompts or workflows

No response

Additional context

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从打包后的 app.js 中的 MCP-registry 安装函数 umi 和 cmi 开始,包括 registryType 支持性门控和启动命令切换。追踪 /mcp search 和 /mcp add-from-registry 入口如何生成 mcp-config.json。完成的标准是:接受一个有文档说明的可执行 registry 类型,并且生成的配置直接指向 registry 的本地可执行文件,而不是使用 npx、uvx 或 Docker。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。