Skip to content

MCP servers with "disabled": true in mcp-config.json are still loaded and available #3582

Closed

Description

@mstehrani

Describe the bug

MCP servers marked with "disabled": true in ~/.copilot/mcp-config.json are still being loaded and their tools are available in the session. The disabled flag is completely ignored by the CLI runtime.

Affected version

1.0.57-0

Steps to reproduce the behavior

  1. Open ~/.copilot/mcp-config.json
  2. Set "disabled"#COLON| true on one or more MCP server entries:
    {
    "mcpServers": {
    "calendar": {
    "disabled": true,
    "type": "sse",
    "url": "https://example.com/sse",
    "headers": { ... }
    }
    }
    }
  3. Start a new Copilot CLI session
  4. Observe that tools from the "disabled" servers are still listed and callable

Expected behavior

Servers with "disabled": true should not be connected, and their tools should not be available in the session.

But in actuality, all MCP servers are loaded regardless of the disabled flag. In my case, 8 servers are marked disabled: true and all 8 have their tools available

Additional context

  • Copilot CLI version: 1.0.57-0
  • OS: Windows 11
  • Config file: ~/.copilot/mcp-config.json
  • Model: Claude Opus 4.6

Activity

  1. added theissue type on May 29, 2026
  2. added
    area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry
    area:configurationConfig files, instruction files, settings, and environment variables
    on May 30, 2026
  3. IrynaKulakova commented on Jun 18, 2026

    @IrynaKulakova

    Investigation Results

    Conclusion: "disabled": true on individual server entries is not a supported property

    The MCPServerConfig schema (src/core/persistence/mcp-config.ts) defines these properties for each server entry in mcp-config.json:

    • tools, type, isDefaultServer, filterMapping, timeout, oidc, auth, deferTools
    • Plus transport-specific fields: command/args/env/cwd (local) or url/headers (remote)

    There is no disabled property on the per-server config schema. The Zod schema drops unknown keys, so "disabled": true is silently ignored.

    How disabling actually works

    The CLI uses a separate disabledMcpServers string array stored in settings.json (not mcp-config.json). This list contains server names (keys from mcpServers). The disable mechanism:

    1. /mcp slash command → toggles servers on/off, writes to settings.json via UserSettings.writeKey("disabledMcpServers", ...)
    2. McpHost (src/mcp-client/mcp-host.ts) receives disabledMcpServers at construction and filters them out before connecting
    3. mcpConfigApi.disable() (src/core/sharedApi/mcpConfigApi.ts) adds server names to the persisted disabled list

    Workaround

    To disable an MCP server, either:

    • Use /mcp in an interactive session and toggle the server off
    • Manually add the server name to disabledMcpServers array in ~/.copilot/settings.json
    • Remove the server entry from mcp-config.json entirely

    Recommendation

    This is a feature request rather than a bug — the "disabled": true per-server property was never implemented. Could be closed as "not a bug" or converted to a feature request to support VS Code-style inline "disabled": true on server entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationConfig files, instruction files, settings, and environment variablesarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions