Skip to content

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

Done

Description

@cthlo

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

Activity

  1. added theissue type on Jul 31, 2026
  2. added
    area:configuration
    area:mcp
    and removed on Aug 1, 2026
  3. self-assigned this
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:configurationarea:mcp

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions