Skip to content

test(claude): extract uninstallMcpServer + cover the file-deletion edge cases#629

Merged
NagyVikt merged 2 commits into
mainfrom
agent/claude/gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56
Jun 5, 2026
Merged

test(claude): extract uninstallMcpServer + cover the file-deletion edge cases#629
NagyVikt merged 2 commits into
mainfrom
agent/claude/gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56

Conversation

@NagyVikt

@NagyVikt NagyVikt commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

NagyVikt added 2 commits June 5, 2026 14:06
…mcp.json

The gx mcp agent radar only helps if agents have it registered; manual
`claude mcp add` per machine meant nobody turned it on. Now `gx claude install`
wires it into the repo alongside settings/hooks/commands.

- installMcpServer merges { mcpServers.gx: { command: gx, args: [mcp, serve] } }
  into the target .mcp.json without clobbering other servers; idempotent.
- --no-mcp opts out.
- gx claude check warns when missing; doctor (check --fix) repairs via install.
- gx claude uninstall removes the gx server (drops .mcp.json if only ours).
- AGENTS.md repo-wiring bullet + usage updated.

Tests: 4 new (create/merge/idempotent/dry-run) in claude-install.test.js, 18/18;
no-new-failures vs base.
…ge cases

Addresses review note: the uninstall path (the error-prone 'delete file only if
it held nothing but ours' guard) had no coverage. Extracted uninstallMcpServer
so it is unit-testable; added 4 tests including the {$schema, mcpServers:{gx}}
case where an unrelated top-level key must block file deletion. 22/22 pass.
@NagyVikt NagyVikt merged commit 7b2fc10 into main Jun 5, 2026
@NagyVikt NagyVikt deleted the agent/claude/gx-claude-install-auto-registers-gx-mcp-2026-06-05-13-56 branch June 5, 2026 12:13
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