Repository navigation
Closed
Description
Background
#1300 ported the hook layer (core/react/*) and state machinery (core/mcp/state/*) from v1.5, plus the InspectorClientProtocol interface. The hooks and state stores all run against that interface — they have no concrete client to instantiate.
#1244 (Wire App.tsx) assumes App.tsx can new InspectorClient(...) and pass it to useInspectorClient, but the concrete class doesn't exist in v2 yet. #1244 is therefore actually blocked on this issue, not on #1300.
This issue ports the remaining v1.5 core/ subsystems so App.tsx has something real to instantiate.
Scope
Port from v1.5/main into v2:
core/mcp/ (runtime)
inspectorClient.ts(~2169 LOC) — the concrete class implementingInspectorClientProtocol. Wires transport + SDKClient+ pending sampling/elicit queues + fetch tracking + message log.messageTrackingTransport.ts— wraps any transport to dispatchmessageevents for the protocol log.fetchTracking.ts—createFetchTrackerforfetchRequestevents.config.ts—InspectorClientOptionsruntime defaults and validation.oauthManager.ts— drives the auth state machine through the SDK transport.
core/mcp/node/ (stdio)
config.ts— stdio server config types.transport.ts— node stdio transport factory.
core/mcp/remote/ (HTTP / SSE / streamable)
createRemoteTransport.ts— entry point that picks SSE vs streamable HTTP.remoteClientTransport.ts— the SDKTransportimpl.createRemoteFetch.ts— fetch wrapper that injects OAuth headers + fires the tracking eventsfetchRequestLogStateconsumes.createRemoteLogger.ts— pino routing.sessionStorage.ts,constants.ts,types.ts,node/.
core/auth/ (~9 files, ~1050 LOC)
state-machine.ts— the OAuth XState machine that drives discovery / DCR / authorize / token / refresh.providers.ts— built-in provider configs (Google, GitHub, Okta, generic OIDC, etc.).discovery.ts— OAuth metadata discovery.storage.ts,store.ts— token persistence.types.ts,utils.ts,index.ts.
core/storage/
store-io.ts+ adapter abstractions for browserlocalStorage/ node FS.
core/logging/
logger.ts,index.ts— small pino wrapper used by the remote subsystem.
Acceptance criteria
-
import { InspectorClient } from '@inspector/core/mcp/inspectorClient'resolves to a concrete class that implementsInspectorClientProtocol. -
new InspectorClient({ transport: 'stdio', command: 'node', args: ['server.js'] })connects against a real stdio MCP server end-to-end (manual smoke test). -
new InspectorClient({ transport: 'http', url: '...' })connects against a real streamable-HTTP server (manual smoke). - OAuth flow completes against at least one provider (manual smoke).
- Vitest unit tests cover the InspectorClient class at the v1.5 level (port the existing v1.5 tests; the spec is "no regression vs. v1.5").
-
npm run validateclean. - All hooks under
core/react/continue to work — the existing hook tests still pass without modification (they targetInspectorClientProtocol). - The opaque
AppRendererClientalias incore/mcp/inspectorClientProtocol.tsis replaced with the SDKClienttype, matching v1.5.
Out of scope
- Wiring
App.tsxto the hooks — that's Wire App.tsx to v2 core/ hook layer; remove demo stub from InspectorView #1244, which this unblocks. - CLI / TUI / launcher ports — that's Port v1.5 CLI / TUI / launcher to v2 (clients/cli, clients/tui, clients/launcher) #1246, also blocked on this.
- Any v2-only behavior change beyond what's in v1.5 today. New behavior lands in follow-up issues, not here.
Unblocks
- Wire App.tsx to v2 core/ hook layer; remove demo stub from InspectorView #1244 (Wire App.tsx)
- Port v1.5 CLI / TUI / launcher to v2 (clients/cli, clients/tui, clients/launcher) #1246 (CLI / TUI / launcher port)
Related
- v1.5 source of truth:
git show origin/v1.5/main:core/mcp/inspectorClient.ts(and the rest ofcore/under that ref) — or browse/Users/cliffhall/Projects/mcp-inspector-v1.5/core/. - Protocol surface this must satisfy:
core/mcp/inspectorClientProtocol.ts(landed in feat(core): port v1.5 hook layer (#1243) #1300). - Event map this must dispatch:
core/mcp/inspectorClientEventTarget.ts(landed in feat(core): port v1.5 hook layer (#1243) #1300).
Activity
wip(core): bulk-copy v1.5 InspectorClient runtime files (#1302)
wip(core): integrate ported v1.5 InspectorClient + port tests (#1302)
wip(core): port test-servers, more types, partial test integration (#…
feat(core): port v1.5 InspectorClient + transports + auth subsystem (#…
feat(core): port v1.5 InspectorClient + transports + auth subsystem (#…