Spec - tb-portreeve-mcp

Feature: tb-portreeve-mcp Created: 2026-08-10

Summary

Add a full-featured, tools-only MCP interface to the existing PortReeve installation. Each same-user MCP host launches portreeve mcp serve as a stdio bridge. The bridge delegates ordinary coordination through the official JavaScript client and private Unix socket to the single persistent daemon; it does not own another database, listener, or durable authority.

The initial release must make global PortReeve discovery and ordinary claim, lease, stack, activation, Docker-snapshot, launcher-coordination, settings, and history operations available through focused typed tools. Explicit targets, process-local credential handles, bounded lease custody, semantically idempotent mutations, and evidence-bound preview/execute receipts protect the agent-facing boundary. The CLI and Desktop provide configuration guidance for generic stdio hosts, Codex, and Claude Code without changing third-party files.

Definition of Done

The global Definition of Done in the software development workflow applies.

Acceptance Criteria

Rubric

#CriterionPassFailEvidence
R1Transport and single authorityThe stdio bridge delegates through the official client and private socket with no additional durable authority or listener.The bridge owns durable state, shells through the CLI, opens another listener, or permits non-MCP stdout.Process, module-graph, socket, stdout-framing, and packaging tests.
R2Complete typed tool surfaceEvery included coordination family has focused, strictly typed, bounded tools and every excluded capability is absent.A required family is missing, results are unbounded, an action multiplexer replaces focused tools, or excluded authority is exposed.Tool-catalog snapshots, input/output schema tests, annotation checks, and real discovery.
R3Availability and explicit scopeDiagnostics survive daemon absence or incompatibility, later calls retry, global reads support filters, and mutations require explicit durable targets.The bridge exits, silently guesses a worktree, stops retrying, or permits incompatible daemon operations.Daemon-absence, recovery, protocol-mismatch, filtering, and explicit-target tests.
R4Credential custodyCredentials remain process-local, model-invisible, and unpersisted; renewal and extension obey the ten-minute default and sixty-minute maximum custody bounds.A credential crosses MCP or persistence, remains after settlement, or renews outside the approved custody window.Seeded leakage tests, fake-clock renewal/expiry tests, bridge-exit tests, and extension-limit tests.
R5Lifecycle and idempotencyApproved standalone, stack, activation, Docker, and launcher-coordination operations work, and retries return existing or achieved results without duplicate effects.An approved lifecycle operation is absent, shell execution is exposed, credentials are lost during owned work, or retries create ambiguous duplicate state.Client/server integration, complete lifecycle fixtures, concurrent-bridge tests, and retry/replay tests.
R6Consequential mutation safetyEvery listed consequential mutation uses a five-minute evidence receipt, rejects stale or mismatched evidence, and returns the recorded result on completed replay.A consequential mutation is direct, stale evidence executes, successful replay duplicates effects, or unsafe any-owner eviction is exposed.Receipt expiry/replay tests, revision/fingerprint tests, and process/Docker evidence-change tests.
R7Safe documents and observabilityCanonical stack documents, cursored history, and redacted snapshots are bounded and exclude arbitrary filesystem, log, output, and secret access.Arbitrary paths or raw files can be accessed, collections are unbounded, external edits are overwritten without rejection, or sensitive data leaks.Traversal and symlink tests, external-edit fixtures, pagination tests, structured-history tests, and snapshot redaction tests.
R8Setup and shipped compatibilityCLI and Desktop generate valid generic, Codex, and Claude configurations without external edits, and the existing shipped products pass the required host and platform matrix.Configuration is invalid or applied automatically, a separate installation is required, or any required MCP era, host, runtime, platform, or Docker flow fails.CLI/Desktop E2E, packaged-artifact inspection, real Codex/Claude calls, Bun/Electron checks, and macOS/Linux/Docker release gates.

Changes

Append spec amendments here. Do not remove or weaken original criteria.