feat(installer): GitHub Copilot targets — VS Code, Copilot CLI, JetBrains#1440
Open
colbymchenry wants to merge 4 commits into
Open
feat(installer): GitHub Copilot targets — VS Code, Copilot CLI, JetBrains#1440colbymchenry wants to merge 4 commits into
colbymchenry wants to merge 4 commits into
Conversation
…ains
Adds three new installer targets so `codegraph install` can wire the
MCP server into GitHub Copilot surfaces:
- copilot-vscode: .vscode/mcp.json (local) or the VS Code User-dir
mcp.json (global), JSONC-surgical edits, `--path` pinned via
${workspaceFolder} for global installs
- copilot-cli: ~/.copilot/mcp-config.json
- copilot-jetbrains: github-copilot config dir (XDG / %LOCALAPPDATA%)
Detection, install, uninstall, and --print-config are covered for all
three in installer-targets.test.ts, including platform-specific path
resolution.
Co-Authored-By: Claude Fable 5 <[email protected]>
….copilot/ide locks
The VS Code Copilot Chat extension writes MCP socket-handoff lock files
into ~/.copilot/ide/ on launch, so `existsSync(~/.copilot)` reported the
Copilot CLI as installed on any machine that merely has the VS Code
extension (caught live on the maintainer's Mac). Detection now counts
the dir as a CLI footprint only when it holds something besides `ide`.
Also: uninstalling a from-scratch install now deletes mcp-config.json
instead of leaving a `{}` husk that would keep detect() reporting the
CLI as installed.
Co-Authored-By: Claude Fable 5 <[email protected]>
… folder
VS Code refuses to start a user-level MCP server whose entry uses
${workspaceFolder} in a window with no folder open, surfacing only a
cryptic "Variable workspaceFolder can not be resolved" toast (hit live
during validation). Global installs now note this up front.
Co-Authored-By: Claude Fable 5 <[email protected]>
…— VS Code toasts an error in every folderless window
A user-level mcp.json entry using ${workspaceFolder} makes VS Code
refuse to start the server in ANY window without a folder open (loose
files, welcome tab), toasting "Variable workspaceFolder can not be
resolved" — recurring error-noise, hit live during validation.
The pin was never needed for VS Code: unlike Cursor, VS Code documents
stdio-server cwd as the workspace folder, and the codegraph server
resolves its project via roots/list with a cwd fallback. Global entries
are now variable-free (`serve --mcp`); local installs keep the absolute
--path. This supersedes the "open a folder" install note from the
previous commit, which is removed again.
Co-Authored-By: Claude Fable 5 <[email protected]>
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
Adds GitHub Copilot as a supported agent for
codegraph install/uninstall, via three new installer targets:copilot-vscode— Copilot Chat in VS Code. Writes the server entry to.vscode/mcp.json(local) or the VS Code User-dirmcp.json(global:~/Library/Application Support/Code/Useron macOS,%APPDATA%\Code\Useron Windows,$XDG_CONFIG_HOME/~/.config/Code/Useron Linux). Uses theserverskey (notmcpServers) per VS Code's v1.102+ format, edits viajsonc-parserso user comments and sibling servers survive, and pins--pathfor local installs only. Global entries are deliberately variable-free (9769d6b): a user-level entry using${workspaceFolder}makes VS Code toast "Variable workspaceFolder can not be resolved" in every folderless window; VS Code documents stdio cwd = workspace folder, and the server resolves the project via MCP roots with a cwd fallback, so no pin is needed.copilot-cli— the GitHub Copilot CLI (~/.copilot/mcp-config.json).copilot-jetbrains— the Copilot plugin in JetBrains IDEs (github-copilotconfig dir, XDG on Unix,%LOCALAPPDALOCAL%-fallback on Windows).Also updates the
TargetIdunion, registry, install/uninstall command descriptions, README, and CHANGELOG.Testing
npx vitest run __tests__/installer-targets.test.ts— 215 passed, 3 skipped (the skips areit.runIf(platform)variants for OSes other than the host; run on macOS).npx tsc --noEmit— clean.it.runIf(platform)gates. Validated on all three platforms — macOS (dev machine), Linux (node:22-bookwormDocker, run with--init), and Windows 11 ARM (Parallels VM, fresh clone atC:\dev\codegraph): 215 passed / 3 skipped on each, where the skips are the other platforms' gated variants — every gated test executed on its target OS.~/.copilot/ide/, so the CLI'sexistsSync(~/.copilot)check false-positived on a machine with only the VS Code extension. Fixed in 234dfe6 (the dir now only counts as a CLI footprint when it holds something besideside, and uninstalling a from-scratch install deletesmcp-config.jsonrather than leaving a{}husk that would re-trigger detection). After the fix, the prompt on the same machine shows VS Code detected, Copilot CLI not found, JetBrains not found — all correct. Suites re-run green on macOS, Linux, and Windows at 234dfe6 (217 passed / 3 skipped each).Validation checklist for reviewers
codegraph install --print-config copilot-vscode— inspect the snippet without writing files..vscode/dir:codegraph install --target=copilot-vscode --location=local --yes, confirm.vscode/mcp.jsongainsservers.codegraphand pre-existing servers/comments are untouched.codegraph uninstall --target=copilot-vscode --location=local --yes, confirm only the codegraph entry is removed.🤖 Generated with Claude Code