Repository navigation
feat(mcp-sync): sync GitHub Copilot CLI's MCP servers too - #581
Merged
Merged
Conversation
Copilot CLI keeps its user MCP list in ~/.copilot/mcp-config.json (COPILOT_HOME moves it) but is not a Codeman run mode, so it has no registry entry. Add the copilot-json dialect (mcpServers, tools ["*"], type local/http/sse, checked against `copilot mcp add` 1.0.94) and declare Copilot as a sync-only target in src/mcp-sync-targets.ts, listed after the registry CLIs. A server switched off with `copilot mcp disable` is recorded in settings.json (disabledMcpServers), not on the entry: sync reads that list so it is not copied, and reports the target unreadable if the file is not valid JSON instead of guessing.
Ark0N
pushed a commit
that referenced
this pull request
Oct 10, 2026
…opilot (#581) The route test cleared only the registry CLIs' relocation vars, so with COPILOT_HOME exported it wrote its fixture into that real Copilot config. It now clears the sync-only tools' vars too, and Copilot's install probe goes through the test's own installed set instead of the machine's PATH. Docs: CLAUDE.md, the API reference and the Settings reference name COPILOT_HOME and the sync-only table; a missing comma in docs/cli-registry.md; the mcp-sync.ts overview and the Sync confirm mention Copilot. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ark0N
pushed a commit
that referenced
this pull request
Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ark0N
pushed a commit
that referenced
this pull request
Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
|
Merged and shipped in 1.41.0, thanks @opticon454! MCP server sync now includes GitHub Copilot CLI as a sync target, with all the same safety rules. One fix at merge: the route test didn't clear |
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.
Summary
MCP server sync (#521) copies MCP servers between the agent CLIs' own config files. GitHub Copilot CLI keeps its list too (
~/.copilot/mcp-config.json), so it was left out. This adds it.Copilot is not a Codeman run mode, so it has no CLI-registry entry (and giving it one would drag in launch, discovery and install). It is declared as plain data in
src/mcp-sync-targets.ts(MCP_SYNC_ONLY_TOOLS) and joins the registry CLIs as a sync target, after them, so a registry CLI's definition wins a same-name difference. It takes part whencopilotis installed or its config file exists, otherwise it is reportedabsentand never created. The same rules apply as for the others: additive only, switched-off servers are not copied, nothing unparseable is written, secrets keep the file0600, results carry names only.The dialect (
copilot-json), checked against Copilot CLI 1.0.94~/.copilot/mcp-config.json, moved byCOPILOT_HOME(verified:COPILOT_HOME=<dir> copilot mcp listreads<dir>).mcpServers, each entry withtools(["*"]= all),typelocal|http|sse, andcommand/args/envorurl/headers. Copied servers are written withtools: ["*"]; an existing server's tool filter is never touched.copilot mcp disabledoes not mark the entry. It lists the name underdisabledMcpServersinsettings.jsonbeside the config. Sync reads that list (never writes it), so a disabled server is not copied. Ifsettings.jsonis not valid JSON the target isunreadablerather than guessed at.Round trip checked with the real CLI: a file written by
addServers('copilot-json', ...)is listed bycopilot mcp listasfs (local),web (http),live (sse), andcopilot mcp get fsshows the command, the masked env andTools: * (all).Tests
test/mcp-sync.test.ts(+10): output captured fromcopilot mcp add; the written shape; existing server and tool filter kept; both directions between Copilot and Claude (sse expressed) and idempotent; a server disabled insettings.jsonis not copied (and the file is only read); a server disabled in Copilot but live elsewhere is still synced; invalidsettings.jsonleaves the target unreadable without quoting the file;COPILOT_HOME; neither installed nor configured isabsent; env values stay out of the result and the file is private.test/mcp-sync-targets.test.ts(+5): the declaration, the binary probe, yielding to a registry id, order in the route's targets,binaryOnPath.tsc --noEmitclean.Docs:
docs/cli-registry.md(new "Tools that are not run modes" paragraph),docs/api-reference.md,docs/wiki/Settings-Reference.md, the Settings text.