Skip to content

refactor: remove MCP server, port to CLI commands#50

Merged
rhuanbarreto merged 3 commits into
mainfrom
claude/quirky-ride
Mar 12, 2026
Merged

refactor: remove MCP server, port to CLI commands#50
rhuanbarreto merged 3 commits into
mainfrom
claude/quirky-ride

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Removed the MCP server (archgate mcp) and all related infrastructure (server, resources, 6 tools, 10 test files, @modelcontextprotocol/sdk dependency)
  • Added archgate review-context CLI command — replaces MCP review_context tool, with --staged, --run-checks, --domain options
  • Added archgate session-context command group with claude-code and cursor subcommands — replaces MCP session context tools
  • Extracted session context business logic into src/helpers/session-context.ts with clean result types
  • Updated editor settings — removed all MCP config from claude-settings.ts and cursor-settings.ts
  • Updated 7 ADRs and CLAUDE.md to remove MCP references and document new commands

Net: -803 lines (669 added, 1472 removed)

Test plan

  • bun run validate passes (lint, typecheck, format, 236 tests, ADR check, build)
  • archgate review-context --help shows correct options
  • archgate session-context claude-code --help shows correct options
  • archgate session-context cursor --help shows correct options
  • No imports referencing @modelcontextprotocol/sdk or src/mcp/ remain
  • Skills in plugin repo updated to use CLI commands instead of MCP tools (separate PR)

🤖 Generated with Claude Code

rhuanbarreto and others added 3 commits March 12, 2026 19:49
Replace the MCP server (`archgate mcp`) with direct CLI commands.
Skills now invoke `archgate review-context`, `archgate session-context
claude-code`, and `archgate session-context cursor` via shell instead
of MCP tool calls.

New files:
- src/helpers/session-context.ts — business logic extracted from MCP tools
- src/commands/review-context.ts — replaces MCP review_context tool
- src/commands/session-context/ — replaces MCP session context tools

Removed:
- src/mcp/ (server, resources, 6 tools)
- src/commands/mcp.ts
- @modelcontextprotocol/sdk dependency
- .mcp.json, .cursor/mcp.json
- All MCP tests (10 files)

Updated:
- Editor settings (claude-settings.ts, cursor-settings.ts) — no MCP config
- 7 ADRs — removed MCP references
- CLAUDE.md — updated command table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rhuanbarreto rhuanbarreto merged commit 5537633 into main Mar 12, 2026
7 checks passed
@rhuanbarreto rhuanbarreto deleted the claude/quirky-ride branch March 12, 2026 19:02
rhuanbarreto added a commit that referenced this pull request Mar 13, 2026
The `archgate mcp` command was removed in #50, but the VS Code and
Copilot settings helpers still generated mcp.json files pointing to it.
This caused broken MCP server entries when running `archgate init`.

- Remove ARCHGATE_VSCODE_MCP_CONFIG and mcp.json generation from
  vscode-settings.ts (marketplace URL logic preserved)
- Remove ARCHGATE_COPILOT_MCP_CONFIG and mcp.json generation from
  copilot-settings.ts
- Update init-project.ts comment
- Update tests to assert mcp.json is no longer created

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rhuanbarreto added a commit that referenced this pull request Mar 13, 2026
The `archgate mcp` command was removed in #50, but the VS Code and
Copilot settings helpers still generated mcp.json files pointing to it.
This caused broken MCP server entries when running `archgate init`.

- Remove ARCHGATE_VSCODE_MCP_CONFIG and mcp.json generation from
  vscode-settings.ts (marketplace URL logic preserved)
- Remove ARCHGATE_COPILOT_MCP_CONFIG and mcp.json generation from
  copilot-settings.ts
- Update init-project.ts comment
- Update tests to assert mcp.json is no longer created

Co-authored-by: Rhuan Barreto <rhuan.barreto@soprasteria.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot mentioned this pull request Mar 13, 2026
rhuanbarreto added a commit that referenced this pull request May 25, 2026
- Update ARCH-007 context and consequences to remove outdated
  "MCP server" framing — the decision (Bun.spawn over Bun.$) is still
  valid but the rationale cited a deployment mode removed in PR #50
- Remove MCP regression tests from init-project, copilot-settings, and
  cursor-settings — testing what a function should NOT produce is
  unnecessary noise eight months after the removal

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
rhuanbarreto added a commit that referenced this pull request May 25, 2026
Remove test assertions that only existed to guard against re-introduction
of features that were removed long ago:

- `--prefix` option on `adr import` (replaced by domain-aware remapping)
- `defineRules` reference in rules template (removed when satisfies
  RuleSet replaced it)
- `.cursor/rules/archgate-governance.mdc` (removed when Cursor plugin
  moved to VSIX)
- `.cursor/mcp.json` in init-project (MCP server removed in PR #50)

These add noise without value — the removed code paths don't exist,
TypeScript wouldn't compile references to them, and broader assertions
already cover the expected behavior.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
rhuanbarreto added a commit that referenced this pull request May 25, 2026
* refactor(loader): remove dead module cache-buster from rule imports

The `?t=${Date.now()}` query string was introduced when archgate ran as
a long-lived MCP server process where `loadRuleAdrs()` could be called
multiple times. PR #50 removed the MCP server and ported everything to
CLI commands, but left the cache-buster in place with an updated
comment. Each `archgate check` is now a fresh Bun process — there is no
module cache to bust.

Closes #345 — the broader caching optimization proposed there is not
warranted given current performance (~850ms total, ~188ms rule
execution).

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>

* chore: add baseBranch to archgate config

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>

* style: format archgate config with oxfmt

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>

* chore: remove stale MCP server references and regression tests

- Update ARCH-007 context and consequences to remove outdated
  "MCP server" framing — the decision (Bun.spawn over Bun.$) is still
  valid but the rationale cited a deployment mode removed in PR #50
- Remove MCP regression tests from init-project, copilot-settings, and
  cursor-settings — testing what a function should NOT produce is
  unnecessary noise eight months after the removal

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>

* test: remove vestigial regression guards for removed features

Remove test assertions that only existed to guard against re-introduction
of features that were removed long ago:

- `--prefix` option on `adr import` (replaced by domain-aware remapping)
- `defineRules` reference in rules template (removed when satisfies
  RuleSet replaced it)
- `.cursor/rules/archgate-governance.mdc` (removed when Cursor plugin
  moved to VSIX)
- `.cursor/mcp.json` in init-project (MCP server removed in PR #50)

These add noise without value — the removed code paths don't exist,
TypeScript wouldn't compile references to them, and broader assertions
already cover the expected behavior.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>

---------

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
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