Skip to content

D5: Decommission MCP — delete packages/mcp + agent-tools, shims shell the CLI, write ADR-035 - #1270

Merged
malibio merged 2 commits into
mainfrom
worktree-issue-1265-decommission-mcp
May 30, 2026
Merged

malibio merged 2 commits into
mainfrom
worktree-issue-1265-decommission-mcp

Conversation

@malibio

@malibio malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #1265

… the CLI (closes #1265)

- Delete packages/mcp/ (npm MCP server: server, tools, install, tests)
- Delete packages/agent-tools/ (gRPC client used by the shims)
- Delete .github/workflows/publish-mcp.yml
- Remove test:mcp, test:agent-tools from test:all/test:all:db; remove both
  packages from quality:fix/quality:check in root package.json
- Rewrite all four shims (claude-code, codex, gemini, opencode) to shell the
  nodespace CLI via execFile('nodespace', ['--json', ...]) with the same
  NodespaceCLIError surface — no npm dependency
- Delete phantom "nodespace mcp" Claude Desktop registration from:
  scripts/install.sh, scripts/uninstall.sh, packages/cli uninstall.rs
  (drop prompt_remove_mcp), packages/desktop-app onboarding.rs
  (drop configure_mcp Tauri command + MCP fields from structs), and
  onboarding-wizard.svelte (remove MCP step + summary entry)
- Remove from Tauri invoke handler in lib.rs
- Remove MCP Setup section from README.md
- Remove agent-tools publish steps from release.yml; skill publish remains
- Update context_assembly.rs doc comments to reference packages/skill/shims/
- All 133 frontend tests + 17 skill tests + 877 Rust tests pass

Co-Authored-By: Claude <[email protected]>
@malibio

malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Review Type: Initial Review


Code Review Summary

This is a well-executed, focused decommission PR that removes two dead packages and brings the codebase to a single, coherent agent-integration surface. The diff is clean, the deletion scope matches the issue specification exactly, and the ADR is thorough and accurate. This is a net positive change that eliminates a broken phantom MCP path (the nodespace mcp subcommand that never existed), removes a latent import bug (@nodespace/agent-tools vs. @nodespaceai/agent-tools), and simplifies the publish pipeline. The passing test counts in the commit message (133 frontend + 17 skill + 877 Rust) further confirm correctness.

One [Improvement] item on the shim DRY violation and one [Nit] on the Gemini error format. Neither blocks merge.


Requirements Check

  • packages/mcp/ and packages/agent-tools/ no longer exist — verified via git ls-tree HEAD
  • No dangling MCP references — acceptance-criteria grep returns zero hits in source files (.mcp.json and CLAUDE.md are harness/agent-guide files, not repo source)
  • .github/workflows/publish-mcp.yml deleted; release.yml drops agent-tools publish; @nodespaceai/skill publish is preserved
  • Root package.json: test:mcp, test:agent-tools removed; test:all, test:all:db, quality:fix, quality:check updated
  • All four shims (claude-code, codex, gemini, opencode) shell the CLI; none import @nodespace/agent-tools
  • README.md MCP Setup section removed
  • Onboarding wizard no longer offers the Claude Desktop MCP step; configure_mcp Tauri command deleted; struct fields cleaned
  • nodespace-docs/decisions/035-skills-replace-mcp.md exists and is well-written; ADR-021 header updated with Superseded-by pointer to 035; ADR-034 surface-1 wording corrected
  • packages/skill/package.json dependencies stays {}

Note on ADR cross-repo scope: The issue says two PRs (core + docs). The ADR landed in nodespace-docs already (confirmed locally). The nodespace-core PR body only says "Closes #1265" — it would be worth linking the docs PR explicitly in the body for traceability, but this is not a blocker.


Code Review Findings

Suggested Improvements

[Improvement] packages/skill/shims/*/ — runCLI + NodespaceCLIError duplicated verbatim across all four shims

The NodespaceCLIError class and runCLI helper (lines 1–48 of each shim after the new import block) are byte-for-byte identical across claude-code/nodespace-hook.ts, codex/nodespace-plugin.ts, gemini/nodespace-handler.ts, and opencode/nodespace-plugin.ts. The issue notes "lift from packages/mcp/src/tools.ts" as the pattern source, which makes sense for a bootstrap, but now that the pattern is settled a shared module is appropriate.

The constraint is that shims must be executable without an npm install step (they are copied verbatim into session temp dirs by GraphContextAssembler). A shared module inside packages/skill/src/cli.ts published as part of @nodespaceai/skill would work: each shim imports import { runCLI, NodespaceCLIError } from '@nodespaceai/skill/cli' and the agent runtime resolves it from the skill package that is already installed. Alternatively, since the shims shell a binary, a zero-dependency copy-paste approach is acceptable here by YAGNI — but that rationale should be explicitly captured in a comment so the next author does not add a fifth shim that diverges from the pattern.

Minimum suggested action: add a one-line comment above runCLI in each shim noting that this helper is intentionally inlined (not imported) because shims are copied into temp dirs without an npm context, and any future change must be replicated across all shims.


Nitpicks

Nit: packages/skill/shims/gemini/nodespace-handler.ts:101 — error prefix changed from [UNKNOWN_TOOL] to [CLI_ERROR] for the unknown-tool case

The old code was throw new ToolError('UNKNOWN_TOOL', ...) which produced [UNKNOWN_TOOL] Unknown tool: .... The new code wraps it in NodespaceCLIError which produces [CLI_ERROR] Unknown tool: .... Since this error is only observable during misconfiguration (an unrecognised tool name in the JSON stdin), and the Gemini protocol just surfaces it as { "error": "<string>" }, the practical impact is zero. Still, the prefix is now less specific than the original. If a future ToolError-equivalent needs distinct error codes, this slot is now gone. Not a blocker.

Nit: package.json:quality:check calls quality:fix on packages/skill instead of quality:check

Line: "quality:check": "bun run --cwd packages/desktop-app quality && bun run --cwd packages/skill quality:fix && bun run rust:quality"

This pre-existed on main and is not introduced by this PR. Calling quality:fix in a quality:check script means CI silently mutates the tree instead of failing on lint violations. Not a regression from this PR, but worth a follow-up issue.


Recommendation

APPROVE

The PR meets all acceptance criteria. The runCLI duplication is a known trade-off for standalone shims; flagged as an [Improvement] for a follow-up. No blockers, no security issues, no functional regressions.

…TOOL] prefix

- Add comment above runCLI in all 4 shims explaining intentional copy-paste:
  shims are deployed as standalone scripts into agent session temp dirs with
  no npm context, so imports are unavailable at runtime
- Restore [UNKNOWN_TOOL] prefix in gemini handler's default-case error message
  (regression from agent-tools removal)

Skipped: pre-existing quality:check calls quality:fix on packages/skill —
tracked as a separate issue, not introduced by this PR.

Co-Authored-By: Claude <[email protected]>
@malibio

malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Review Addressed

✅ Addressed 2 recommendations:

🟡 runCLI inlining rationale — Added a 4-line comment above runCLI in all four shims explaining that the copy-paste is intentional: shims are deployed as standalone scripts into agent session temp dirs with no npm context, so imports are unavailable at runtime. Comment also calls out that changes must be replicated across all four files.

🟢 [UNKNOWN_TOOL] prefix regression — Restored the [UNKNOWN_TOOL] prefix in nodespace-handler.ts's default-case error message (was inadvertently dropped when replacing the ToolError import).

⏭️ Skipped 1 recommendation:

🟢 quality:check calls quality:fix on packages/skill — Pre-existing issue, not introduced by this PR. Tracked for a separate cleanup.

@malibio
malibio merged commit 8095985 into main May 30, 2026
@malibio
malibio deleted the worktree-issue-1265-decommission-mcp branch May 30, 2026 14:47
malibio added a commit that referenced this pull request Jun 22, 2026
… the CLI, write ADR-035 (#1270)

* D5: Decommission MCP — delete packages/mcp + agent-tools, shims shell the CLI (closes #1265)

- Delete packages/mcp/ (npm MCP server: server, tools, install, tests)
- Delete packages/agent-tools/ (gRPC client used by the shims)
- Delete .github/workflows/publish-mcp.yml
- Remove test:mcp, test:agent-tools from test:all/test:all:db; remove both
  packages from quality:fix/quality:check in root package.json
- Rewrite all four shims (claude-code, codex, gemini, opencode) to shell the
  nodespace CLI via execFile('nodespace', ['--json', ...]) with the same
  NodespaceCLIError surface — no npm dependency
- Delete phantom "nodespace mcp" Claude Desktop registration from:
  scripts/install.sh, scripts/uninstall.sh, packages/cli uninstall.rs
  (drop prompt_remove_mcp), packages/desktop-app onboarding.rs
  (drop configure_mcp Tauri command + MCP fields from structs), and
  onboarding-wizard.svelte (remove MCP step + summary entry)
- Remove from Tauri invoke handler in lib.rs
- Remove MCP Setup section from README.md
- Remove agent-tools publish steps from release.yml; skill publish remains
- Update context_assembly.rs doc comments to reference packages/skill/shims/
- All 133 frontend tests + 17 skill tests + 877 Rust tests pass

Co-Authored-By: Claude <[email protected]>

* Address review: document runCLI inlining rationale, restore [UNKNOWN_TOOL] prefix

- Add comment above runCLI in all 4 shims explaining intentional copy-paste:
  shims are deployed as standalone scripts into agent session temp dirs with
  no npm context, so imports are unavailable at runtime
- Restore [UNKNOWN_TOOL] prefix in gemini handler's default-case error message
  (regression from agent-tools removal)

Skipped: pre-existing quality:check calls quality:fix on packages/skill —
tracked as a separate issue, not introduced by this PR.

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Michael Libio <[email protected]>
Co-authored-by: Claude <[email protected]>
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.

D5: Decommission MCP — delete packages/mcp + agent-tools, shims shell the CLI, write ADR-035

1 participant