github / github/copilot-cli

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

Aperta
#4,323 0 commenti 1 reazione 2 assegnatari Vedi su GitHub

@devm33 ci sta già lavorando.

Dal 1/8/2026.

area:configuration area:mcp
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.