github / github/copilot-cli

Comments in .mcp.json not supported, causing all workspace MCP servers to be skipped

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

@devm33 đang làm issue này rồi.

Từ ngày 1/8/2026.

area:configuration area:mcp
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 bug

Repository-level  .mcp.json files are parsed as strict JSON. Adding a  // or  /* ... */  comment causes Copilot CLI to reject the entire file and skip every MCP server it defines.
This makes it difficult to maintain a shared repository configuration containing documentation or temporarily disabled server definitions.

Affected version

1.0.78-0

Steps to reproduce the behavior
  1. Create a trusted Git repository.
  2. Add .mcp.json:
{
  "mcpServers": {
    // Used for browser-based integration tests.
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["@playwright/mcp@latest"],
      "tools": ["*"]
    }
  }
}
  1. Run copilot mcp list --json
  2. Copilot reports:
Warning: skipping workspace MCP config ".mcp.json" because it is malformed:
Invalid JSON: key must be a string
  1. Remove the comment and repeat the command. The workspace MCP server is then discovered successfully.
Expected behavior

Copilot CLI should parse .mcp.json as JSONC, supporting  // and  /* ... */ comments while continuing to load valid MCP definitions.

Alternatively, the configuration schema could provide a documented repository-level mechanism such as "enabled": false for retaining optional MCP definitions without loading them.

A malformed individual server entry should ideally not prevent unrelated valid servers from loading.

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.

Đánh giá

Issue này chưa được đánh giá.

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.