Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-2214Done

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.

nextReady was still calling the next_ready tool 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

  1. Delete the MCP transport. Client, StreamableHTTPClientTransport, StreamableHTTPError, mcpEndpoint, connect()/close()'s SDK internals, callStructured, mapCallError, isUnauthorized, textOf and the ToolCallOutcome plumbing — every symbol whose only reason to exist was the tool protocol.
  2. 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).
  3. Re-point the auth login / doctor validation probe. listToolNames() exists to prove a credential works by listing MCP tools; its replacement is GET /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).
  4. Remove @modelcontextprotocol/sdk from packages/cli/package.json and refresh the lockfile.
  5. A guard that keeps it gone — a test asserting no file under packages/cli/src imports 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.
  6. Rename what is now misnamed. mcpClient.ts describes neither its contents nor its protocol; move it (and any mcp* symbol it exports) to a name that says what it is, updating imports mechanically.
  7. 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/sdk is absent from packages/cli/package.json and from the lockfile's packages/cli entry.
  • No file under packages/cli/src or packages/cli/test imports it — asserted by a test that fails when an import is reintroduced, not by a one-time grep.
  • motir auth login and motir doctor validate a credential against GET /api/v1/me, and an invalid or revoked token still produces AuthError with 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 mcp in 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; note normalizeServerUrl and the CLI_VERSION usage are NOT MCP-specific and stay.
  • packages/cli/src/commands/auth.ts + packages/cli/src/commands/doctor.ts — the two listToolNames() call sites the probe change touches.
  • packages/cli/src/session.tswithProjectSession'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.