Skip to content

feat(copilotcli): route disabled MCP servers to disabledMcpServers - #3513

Merged
dyoshikawa merged 7 commits into
mainfrom
resolve-issue-2402-copilotcli-disabled-mcp
Oct 17, 2026
Merged

dyoshikawa merged 7 commits into
mainfrom
resolve-issue-2402-copilotcli-disabled-mcp

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Refs #2402

Copilot CLI MCP files (.github/mcp.json, ~/.copilot/mcp-config.json) have no per-server disabled key. A canonical "disabled": true server was written as-is, so the CLI ignored the key and started the server anyway. The CLI turns a server off with disabledMcpServers ("MCP server names to disable. Listed servers are configured but not started"). The key lives in ~/.copilot/settings.json and also in .github/copilot/settings.json, where it is on the closed repository allowlist with union merge (CLI config dir reference).

Changes

  • Generate: the disabled key is dropped from the server entry. The server's name goes into disabledMcpServers in the scope's settings file, patched through the shared-config gateway. The mcp feature now owns that one key on both Copilot CLI settings files, and other settings (deniedUrls, disableAllHooks, model, ...) are preserved.
  • Managed names: rulesync manages only the servers it actually writes. Other names keep their state. A managed server that is disabled on disk but enabled canonically is re-enabled with a warning.
  • No-op runs: the file is not created or rewritten when nothing changes.
  • Fail-closed: if the settings file exists but cannot be parsed, the disabled server is skipped with a warning, because otherwise it would be written as a server that starts. On import, an unparsable settings file is an error, so disabled servers are not silently re-enabled.
  • Import: names listed in disabledMcpServers come back as "disabled": true. A name that does not match a server is ignored.
  • Follows the existing Rovo Dev mcp.disabledMcpServers design (rovodev-mcp.ts).
  • Docs: docs/reference/file-formats.md (Copilot CLI MCP section) and the regenerated docs-content.ts.

Remaining on #2402 (not addressed here; they need maintainer or product decisions)

Test plan

  • Unit tests for generate (project and global), retracting and re-enabling, no-op runs, the unparsable-settings fail-closed path, import round-trip including a __proto__ entry, and the extra shared write paths.
  • Manual check: generate -t copilotcli -f mcp, then import, round-trips disabled: true and keeps a hand-written model and an unmanaged name.
  • pnpm cicheck

🤖 Generated with Claude Code

https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv

dyoshikawa and others added 7 commits October 17, 2026 21:54
Copilot CLI MCP files have no per-server disabled key, so a canonical
"disabled": true server was written as-is and still started. The CLI
switches a server off through disabledMcpServers in its settings file
(.github/copilot/settings.json at project scope, ~/.copilot/settings.json
at global scope).

Generate now drops the disabled key from the server entry and patches
disabledMcpServers through the shared-config gateway. Only names of
servers rulesync writes are managed; other names keep their state, and a
managed server re-enabled canonically is called out with a warning. When
the settings file cannot be parsed, a disabled server is skipped instead
of being written as a runnable server. Import reads the list back as
"disabled": true.

Refs #2402

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
…pilotcli-disabled-mcp

# Conflicts:
#	src/generated/docs-content.ts
…pilotcli-disabled-mcp

# Conflicts:
#	src/generated/docs-content.ts
…pilotcli-disabled-mcp

# Conflicts:
#	src/generated/docs-content.ts
…pilotcli-disabled-mcp

# Conflicts:
#	src/generated/docs-content.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant