github / github/copilot-cli

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

Đang mở
#4,634 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

triage
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong app.js được đóng gói, tại các hàm cài đặt MCP-registry umi và cmi, bao gồm cổng kiểm tra khả năng hỗ trợ của registryType và chuyển đổi lệnh khởi chạy. Theo dõi cách các entry point /mcp search và /mcp add-from-registry tạo ra mcp-config.json. Được xem là hoàn tất khi một loại registry có thể thực thi được ghi trong tài liệu được chấp nhận và cấu hình tạo ra trỏ trực tiếp đến tệp thực thi cục bộ của registry thay vì sử dụng npx, uvx hoặc Docker.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.