Skip to content

Commit 2919323

Browse files
BobDickinsonCopilot
andcommitted
Bundle mcpi into the published @modelcontextprotocol/inspector package
Add mcpi's build output to the root package's `bin`/`files` so that `npm install -g @modelcontextprotocol/inspector` also installs the `mcpi` binary alongside `mcp-inspector`. mcpi's tsup build already bundles all monorepo-internal code, and root already declares every third-party dependency mcpi needs, so no new dependencies or CI risk are introduced. - package.json: add "mcpi" bin entry and "clients/mcpi/build" to files - README.md / AGENTS.md: update project-layout notes to reflect that mcpi is now bundled into the published package - clients/mcpi/README.md: add an "Install" section documenting `npm install -g @modelcontextprotocol/inspector` as the real-world install path, and rename the old install section to "Build / run from this repo (development)" to distinguish it from end-user install Verified with npm pack + an isolated global install from the packed tarball: both mcp-inspector and mcpi bins resolve and run correctly with no missing dependencies. Co-authored-by: Copilot <[email protected]>
1 parent 98a4151 commit 2919323

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ inspector/
4242
│ │ └── static/ sandbox_proxy.html — served for the MCP Apps tab
4343
│ ├── cli/ Scriptable CLI (tsup bundle, @inspector/core alias)
4444
│ ├── mcpi/ Experimental session CLI (`mcpi` bin — connect once, many
45-
│ │ commands; implicit Unix-socket session daemon). Not part
46-
│ │ of the published package yet — see clients/mcpi/README.md
45+
│ │ commands; implicit Unix-socket session daemon). Bundled
46+
│ │ into the published package — see clients/mcpi/README.md
4747
│ ├── tui/ Ink + React terminal UI (tsup bundle)
4848
│ └── launcher/ The `mcp-inspector` bin; dispatches to web/cli/tui in-process
4949
├── core/ Shared code, consumed via the `@inspector/core` alias (no package.json)

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ inspector/
4949
├── clients/
5050
│ ├── web/ Web client (Vite + React + Mantine). src/ = browser app; server/ = Node backend
5151
│ ├── cli/ CLI client (tsup bundle, @inspector/core alias)
52-
│ ├── mcpi/ Experimental session CLI (`mcpi` bin) — not part of the
52+
│ ├── mcpi/ Experimental session CLI (`mcpi` bin) — bundled into the
5353
│ │ published package; see clients/mcpi/README.md
5454
│ ├── tui/ TUI client (Ink + React, tsup bundle)
5555
│ └── launcher/ Shared launcher — provides the `mcp-inspector` bin, dispatches to web/cli/tui

‎clients/mcpi/README.md‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# MCP Inspector session CLI (`mcpi`)
22

3-
**Experimental** separate client — not part of the published `@modelcontextprotocol/inspector` package. Connect once, then run many MCP commands against a named session via an implicit local daemon (ssh-agent style).
3+
**Experimental** separate client, bundled into the published `@modelcontextprotocol/inspector` npm package alongside `mcp-inspector`. Connect once, then run many MCP commands against a named session via an implicit local daemon (ssh-agent style).
44

55
> **Layout note:** Source lives in `clients/mcpi/`. At build time it bundles some modules from `clients/cli/src` (`handlers/`, `error-handler`, OAuth helpers) via the `@inspector/cli` alias. That reach-in is intentional and temporary — not a published library API — until a cleaner shared package exists.
66
7-
## Install / run (from this repo)
7+
## Install
8+
9+
```bash
10+
npm install -g @modelcontextprotocol/inspector
11+
mcpi --help
12+
```
13+
14+
This installs both bins from the same package: `mcp-inspector` (web/one-shot CLI/TUI launcher) and `mcpi` (this session CLI). `mcpi`'s own `clients/mcpi` package is `"private": true` and is never published on its own — it ships only as a bundled build inside `@modelcontextprotocol/inspector`.
15+
16+
## Build / run from this repo (development)
817

918
Build, then put `mcpi` on your PATH with `npm link` (points at this package’s `build/mcp-bin.js`):
1019

‎package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
"author": "The MCP Maintainers and Community",
1919
"type": "module",
2020
"bin": {
21-
"mcp-inspector": "./clients/launcher/build/index.js"
21+
"mcp-inspector": "./clients/launcher/build/index.js",
22+
"mcpi": "./clients/mcpi/build/mcp-bin.js"
2223
},
2324
"files": [
2425
"clients/launcher/build",
2526
"clients/web/build",
2627
"clients/web/dist",
2728
"clients/web/static",
2829
"clients/cli/build",
30+
"clients/mcpi/build",
2931
"clients/tui/build",
3032
"scripts/install-clients.mjs"
3133
],

0 commit comments

Comments
 (0)