Skip to content

chore(mcpi): replace the temporary @inspector/cli source alias with a real shared surface #2461

Description

@BobDickinson

Problem

clients/mcpi (#1783) bundles modules straight out of clients/cli/src via a temporary build-time alias:

// clients/mcpi/tsup.config.ts
"@inspector/cli": path.resolve(dirname, "../cli/src"),

What it reaches for today:

  • error-handler.js — CliExitCodeError, EXIT_CODES (used across the daemon, clients, and bin)
  • handlers/ — method-types.js, run-method.js, servers-list.js, format-output.js, connect-timeout.js
  • cliOAuth.js + cli-oauth-navigation.js — connect-time OAuth flow and navigation
  • style.js, utils/awaitable-log.js — output styling / logging helpers

This was flagged in review on #1783 (item 2g): clients/cli/src is not a published or internal library surface, so mcpi's compile depends on cli internals that can change under it, and the "which client owns which file" rules in AGENTS.md blur.

Proposed fix

Promote the genuinely shared, node-only CLI surface out of clients/cli/src into a shared area (e.g. core/ subdirectories, or a dedicated shared client-support area) and consume it from both clients/cli and clients/mcpi:

  1. error-handler (exit codes + CliExitCodeError)
  2. The method handlers and their option/format types
  3. The interactive OAuth connect flow (cliOAuth, cli-oauth-navigation) — already thin wrappers over core/auth
  4. style / awaitable-log output helpers

Then delete the @inspector/cli alias from clients/mcpi/tsup.config.ts and clients/mcpi/vitest.config.ts, and drop the layout note from clients/mcpi/README.md.

Notes

  • Until this lands, the alias is documented as intentional and temporary in clients/mcpi/README.md and AGENTS.md.
  • The TUI has its own copy of some of this logic; worth checking whether it can consume the same shared surface in the same pass.

Activity

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

Metadata

Metadata

Assignees

Labels

choreMaintenance: deps, build tooling, CI, cleanup — no user-facing behavior changev2Issues and PRs for v2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions