Skip to content

Finish the general nodespace mcp service: trust-boundary controls and a verified bash-less consumer #2512

Closed

Description

@malibio

Overview

nodespace mcp (packages/cli/src/commands/mcp.rs) is a real, tested binary today — a single passthrough MCP tool, JSON-RPC 2.0 over stdio — but it has no consumer wired to it and none of the trust-boundary controls ADR-038 requires before an external tool goes live. This issue is about finishing that general MCP service, not about any one specific agent harness.

MCP is NodeSpace's answer for surfaces without shell access (Claude Desktop's Chat tab, claude.ai, and similar). CLI-capable agent harnesses (Claude Code, Codex, OpenCode, and now Antigravity CLI per #2473) use skill + nodespace CLI directly and do not need this work — that path is already shipped and is not blocked by anything here.

(Antigravity CLI specifically was considered as a possible MCP consumer, since its own plugin model happens to expose MCP as one of its extensibility mechanisms. But that's incidental — Antigravity uses skill + CLI like every other harness that has shell access, the same as this issue's scope implies for any future harness. This issue does not target Antigravity specifically and isn't blocked on, or required by, anything about that agent.)

Architecture Impact

This is governed by ADR-035 ("NodeSpace Skill + CLI Replace MCP as the Agent Integration Surface", Accepted, amended 2026-08-31) and ADR-038's Trust Boundary section. Neither is reversed by this issue — both anticipate and gate exactly this work:

  • ADR-035 removed MCP as NodeSpace's general integration surface (packages/mcp/, packages/agent-tools/ deleted) in favor of "one client (the CLI), one catalog (the skill shims)" for every shell-capable harness.
  • ADR-035's 2026-08-31 amendment explicitly does not forbid reintroducing MCP, but sets a bar: "an MCP integration is acceptable to the extent its resident cost approaches a skill's... A single passthrough tool — one string parameter carrying the argument list that would follow nodespace on a shell line — does [clear that bar]... That is the shape to build if a bash-less surface needs reaching, and the reason to build nothing larger."
  • packages/cli/src/commands/mcp.rs (nodespace mcp) already implements exactly that shape. It exists today because ADR-035 named the Claude Desktop Chat tab (no shell) as a surface the CLI+skill path cannot reach.
  • ADR-038's Trust Boundary section requires, before any external tool is live: registration gated behind explicit user enablement, provenance marking (internal vs external source), and generated-schema validation (bounded nesting, no unbounded additionalProperties, size cap) before a registered tool reaches inference. None of this exists yet for nodespace mcp — it is a working binary with no registration/enablement/trust-boundary wiring around it.

No companion nodespace-docs change is required — this issue implements what ADR-035/038 already prescribe rather than proposing a new decision. If implementation surfaces a need to deviate from the single-passthrough-tool shape, or from the ADR-038 trust-boundary requirements, treat that as a signal to write a new ADR before proceeding, not to proceed and document after.

Problem Statement

nodespace mcp is a working binary with no registration/enablement/trust-boundary wiring around it. Bringing MCP back as a real, offered integration (for whichever bash-less surface needs it first) means closing that gap — not building a new server, and not doing it per-consumer.

It also means closing an installer gap: packages/skill/src/installer.ts writes each CLI harness's SKILL.md/shim files into its detected config directory (packages/skill/src/agents.ts's AGENTS list). There is no equivalent for MCP — no code writes a client's MCP config (e.g. Claude Desktop's claude_desktop_config.json) pointing at nodespace mcp. ADR-035's Decision section records that the previous MCP installer surface (configure_mcp Tauri command, the install.sh/uninstall.sh MCP registration, mcp_configured config fields) was deliberately deleted when MCP was dropped — confirmed gone from the codebase today. A user cannot self-serve this integration by hand-editing a client config as a substitute for real installer support; that path does not scale past a single early adopter and isn't what 'offered integration' should mean here.

Proposed Solution

  1. Add the trust-boundary controls ADR-038 requires, scoped to what "one passthrough tool, potentially multiple external consumers" actually needs: explicit enablement, provenance marking, schema validation on the passthrough tool's own schema.
  2. Decide and document the first real consumer this is verified against (e.g. Claude Desktop's Chat tab, since ADR-035 names it explicitly as the motivating bash-less surface) — verification requires an actual client, not documentation alone.
  3. Build the installer support: write (and, on uninstall, cleanly remove) the target client's MCP config, mirroring packages/skill/src/installer.ts's install/uninstall pattern for CLI-harness skills, gated behind the enablement mechanism from step 1 rather than always-on.
  4. Only after that, evaluate whether any CLI-capable harness (Antigravity included) should also be offered MCP as an additional, opt-in path alongside its default skill+CLI access — this is not required and should not be assumed as part of the base MCP work.

Acceptance Criteria

  • ADR-038 trust-boundary controls (explicit user enablement, provenance marking, schema validation) implemented for the nodespace mcp passthrough tool
  • nodespace mcp verified working end-to-end against at least one real bash-less MCP client
  • An installer writes that client's MCP config (pointing at nodespace mcp) automatically, the same way packages/skill/src/installer.ts writes each CLI harness's skill files today — not a manual, hand-edited config as the shipped path
  • Tests pass (bun run test:all)
  • Code passes bun run quality:fix

Technical Specifications

Reference Files

  • nodespace mcp implementation: packages/cli/src/commands/mcp.rs — the existing passthrough MCP server
  • nodespace mcp tests: packages/cli/tests/mcp_integration.rs
  • SKILL.md's shell-less path: packages/skill/SKILL.md → Preflight "Branch 2" (already documents the nodespace MCP passthrough tool for surfaces with no shell)
  • ADR-035: ../nodespace-docs/decisions/035-skills-replace-mcp.md — the single-passthrough-tool bar and its rationale
  • ADR-038: ../nodespace-docs/decisions/038-skill-mediated-tool-routing.md — the Trust Boundary section (external tool registration requirements)

Non-Goals

  • Does not reintroduce a general, many-tool MCP surface (the packages/mcp/agent-tools shape ADR-035 deleted) — the single-passthrough-tool shape is the only one ADR-035's amendment clears.
  • Does not make MCP the default integration for any CLI-capable harness — skill + nodespace CLI directly stays the default and, for shell-capable agents, the only method needed. Any CLI harness gaining MCP as an additional path is a separate, later decision, not scoped here.
  • Is not Antigravity-specific. Antigravity CLI's tool-registration mechanism happens to be MCP itself (it has no separate non-MCP plugin API the way Claude Code/Codex/OpenCode do), but that is incidental to this issue, not its driver — Antigravity ships with skill + CLI access only, same as every other harness, until this general MCP work exists and a decision is separately made to offer it there too.

Related Issues

Activity

  1. changed the title [-]Wire Antigravity CLI to nodespace mcp as a bash-less tool-call integration[/-] [+]Finish the general nodespace mcp service: trust-boundary controls and a verified bash-less consumer[/+] on Sep 8, 2026
  2. self-assigned this
    on Sep 10, 2026
  3. mstomar125 commented on Sep 10, 2026

    @mstomar125
    Contributor

    Opened #2551 implementing ADR-038's Trust Boundary controls for `nodespace mcp` plus installer support.

    What's implemented:

    • Explicit user enablement: `run_server` refuses to serve anything (not even `initialize`) unless `~/.nodespace/daemon.toml`'s `[mcp] enabled` flag is true — only ever set by the new `nodespace mcp install`/`uninstall` subcommands.
    • Provenance marking: every `tools/list` entry carries `_meta.source: "external"`.
    • Generated-schema validation: bounded nesting depth, no unbounded `additionalProperties`, a size cap, enforced before the schema is ever returned to a client.
    • Installer: `nodespace mcp install/uninstall/status` writes/removes Claude Desktop's `claude_desktop_config.json` `mcpServers.nodespace` entry (via new `packages/skill/src/mcp-clients.ts` + `mcp-installer.ts`, mirroring `agents.ts`/`installer.ts`'s shape), gated behind the enablement flag above.

    Verification level — read this before reviewing:

    • Confirmed ADR-035's previously-deleted MCP installer surface (`configure_mcp`, install.sh/uninstall.sh MCP registration, `mcp_configured` fields) is genuinely gone before writing anything.
    • Unit + integration tested thoroughly, including real end-to-end JSON-RPC over real stdio against the compiled `nodespace` binary, and one test that drives the actual compiled TypeScript installer through a full install → enable → serve → uninstall → disable lifecycle against a real (fake-$HOME) `claude_desktop_config.json` and a real `daemon.toml` — no mocks on either side of that boundary.
    • What is NOT verified, and needs a human with a real Claude Desktop install: that Claude Desktop's Chat tab actually launches `nodespace mcp` from the written config, discovers the tool, and a model successfully invokes it end-to-end through Claude Desktop's own UI. Also unconfirmed against the real client: whether its `Tool`-object parser tolerates the added `_meta.source` field (spec-permitted, not confirmed live). Full detail on what's verified at what level is in the PR description.

    `bun run test:all` and `bun run quality:fix` both clean. This is security-relevant trust-boundary work, so I'm asking for an adversarial review rather than a quick skim before merge — not merging this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions