github / github/copilot-cli

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

Abierto
#4,323 0 comentarios 1 reacción 2 asignados Ver en GitHub

@devm33 ya está trabajando en esto.

Desde el 1/8/2026.

area:configuration area:mcp
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.