11.5.6 Drop `@modelcontextprotocol/sdk` — delete the MCP transport, re-point the `auth login` probe at `GET /api/v1/me`, and prove nothing imports it
The card that finishes the migration by REMOVING the old path — not merely leaving it unused. An abandoned transport with no caller is not a neutral leftover: it keeps a dependency in every installer's node_modules, keeps its code in the coverage report, and stands as an invitation for the next contributor to reach for it.
⚠️ RE-SCOPED 2026-08-07 (story-level). This card assumed every method had moved; one had not.
nextReadywas still calling thenext_readytool when this card came up for execution — MOTIR-2338 made the exclusion list key-based and then ADDED an id-translation round trip for that tool, and this card assumed the port was already covered. Porting it is a behaviour change and does not belong inside a card that should read as a deletion, so it is MOTIR-2398 (11.5.23), which now blocks this one. Nothing else about this card changes.
What to build
- Delete the MCP transport.
Client,StreamableHTTPClientTransport,StreamableHTTPError,mcpEndpoint,connect()/close()'s SDK internals,callStructured,mapCallError,isUnauthorized,textOfand theToolCallOutcomeplumbing — every symbol whose only reason to exist was the tool protocol. - Delete the hand-written response mirrors that 11.5.2's generated types replaced, and any that survive only because a renderer's input type happens to point at them (those move to the adapter module's own view models).
- Re-point the
auth login/doctorvalidation probe.listToolNames()exists to prove a credential works by listing MCP tools; its replacement isGET /api/v1/me, which is cheaper, is what a v1 client would naturally use, and gives a better message (it can name the user and workspace the token resolves to). - Remove
@modelcontextprotocol/sdkfrompackages/cli/package.jsonand refresh the lockfile. - A guard that keeps it gone — a test asserting no file under
packages/cli/srcimports the SDK and that the dependency is absent from the package manifest. Without it the removal is a one-time cleanup rather than a property. - Rename what is now misnamed.
mcpClient.tsdescribes neither its contents nor its protocol; move it (and anymcp*symbol it exports) to a name that says what it is, updating imports mechanically. - Retire
connect()/close()as a REQUIREMENT. With no session to open,withProjectSession's handshake has nothing to do. Keep or drop the methods as the code reads best, but no command may still need a handshake before a request — a bearer and a URL are the whole client now.
Scope BOUNDARY
Ends at the removal plus the guard. It does NOT change any behaviour, output, flag or command — this card should be readable as a deletion plus a rename. It does NOT port nextReady (MOTIR-2398, which blocks it). It does NOT touch the MCP surface on the SERVER (app/api/mcp, lib/mcp/), which stays exactly as it is and keeps serving agents; only the CLI stops being one of its clients. It does NOT change the device-login flow, credential storage or .motir.json. It does NOT update the README, docs/cli.md or the package DESCRIPTION — that is 11.5.9's, so the prose change gets read as prose rather than buried in a deletion diff.
Acceptance criteria
@modelcontextprotocol/sdkis absent frompackages/cli/package.jsonand from the lockfile'spackages/clientry.- No file under
packages/cli/srcorpackages/cli/testimports it — asserted by a test that fails when an import is reintroduced, not by a one-time grep. motir auth loginandmotir doctorvalidate a credential againstGET /api/v1/me, and an invalid or revoked token still producesAuthErrorwith its existing re-login hint.- Every command's output is unchanged, asserted by the existing suites with their assertion strings untouched.
- No hand-written wire-shape interface remains in the client module; the only response types are generated or adapter-owned view models.
- The renamed module and its exports carry no
mcpin their names, and no import of the old path remains. - The scope-seam guard in
tests/cli/cli-connect-story.test.ts— the floor that has fallen once per porting card, and is at 1 — goes with the client rather than being lowered to 0, which would assert nothing. - The per-file coverage floor (≥90%) holds; the deleted code leaves no orphaned test asserting a capability that no longer exists.
Context refs
packages/cli/src/mcpClient.ts— everything to delete or rename; notenormalizeServerUrland theCLI_VERSIONusage are NOT MCP-specific and stay.packages/cli/src/commands/auth.ts+packages/cli/src/commands/doctor.ts— the twolistToolNames()call sites the probe change touches.packages/cli/src/session.ts—withProjectSession's connect/close bracket.packages/cli/package.json— the dependency to remove.packages/cli/vitest.config.ts— the per-file gate whose file globs must follow the rename.app/api/mcp/route.ts+lib/mcp/— the server surface this card deliberately leaves alone.- Predecessors: 11.5.4, 11.5.5, 11.5.20 and 11.5.23 — nothing here is removable until all four have landed.
- Story: MOTIR-1855.