fix(install): copilot-cli MCP config key (servers → mcpServers) and Copilot instructions path (#616)#714
Open
LNTisNotaTree wants to merge 1 commit into
Conversation
…h8205#616) GitHub Copilot CLI reads MCP servers from the "mcpServers" key in ~/.copilot/mcp-config.json, but the installer wrote "servers", so the server was silently never loaded. Likewise, Copilot only auto-loads instruction files matching .github/instructions/**/*.instructions.md, but the installer wrote .github/code-review-graph.instruction.md (flat directory, singular suffix), which was never read. - Write the copilot-cli entry under "mcpServers"; on install, migrate a stale entry that an older release left under "servers" (removing the legacy key once emptied) so upgrades self-heal. - Write instructions to .github/instructions/code-review-graph.instructions.md for both copilot and copilot-cli; on install, strip our section from the superseded legacy path (deleting the file when nothing else remains, leaving user content and unrecognized sections alone). - Teach uninstall to also remove entries under legacy platform keys and sections in legacy instruction paths written by older releases. Fixes tirth8205#616
LNTisNotaTree
force-pushed
the
fix/copilot-cli-mcp-key-and-instructions-path
branch
from
July 22, 2026 17:20
6870f12 to
5bf448f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #616.
Bug 1: MCP server written under the wrong JSON key
Copilot CLI reads MCP server definitions from
"mcpServers"in~/.copilot/mcp-config.json, but the installer wrote"servers"— the entry was silently never parsed.copilot-cliplatform now uses"key": "mcpServers".code-review-graphentry that an older release left under"servers"(other servers under that key are untouched; the key itself is dropped once emptied), so upgrading users self-heal on the nextinstallinstead of ending up with a duplicate/stale blob.uninstallnow also checks legacy keys, so it can clean configs written by older releases.The VS Code
copilotplatform keeps"servers"— that is correct for.vscode/mcp.json.Bug 2: instructions file at a path Copilot never loads
Copilot only auto-loads instruction files matching
.github/instructions/**/*.instructions.md; the installer wrote.github/code-review-graph.instruction.md(flat directory + singular suffix), which is never read..github/instructions/code-review-graph.instructions.mdfor bothcopilotandcopilot-cli.uninstallalso removes the section from the legacy path for installs created by older releases.Verification
End-to-end repro from the issue (isolated
HOME, pre-existingazure-style server undermcpServers, stalecode-review-graphunderservers):{ "servers": { "azure-mcp-server": { "command": "azmcp" } }, "mcpServers": { "code-review-graph": { "command": "...", "args": ["...", "serve"], "type": "stdio" } } }…and
.github/instructions/code-review-graph.instructions.mdis created while a generated legacy.github/code-review-graph.instruction.mdis removed.New tests cover: the corrected key, legacy-key migration (including dropping the emptied
serversobject), legacy instruction-file removal, preservation of user content sharing the legacy file, and leaving user-authored files without our marker untouched.tests/test_skills.py,tests/test_uninstall.py,tests/test_cli_install.pyall pass (225 tests); the full suite shows no new failures relative tomainin my environment.