Inspector V2 Tech Stack - Server

July 2, 2026 · View on GitHub

Brief | V1 Problems | V2 Scope | V2 Tech Stack | V2 UX | V2 Auth | V2 New Spec Impact

Web Client | CLI, TUI, Launcher | Server | Storage

Overview

Language and Runtime

  • Typescript
  • Node

Transport Operation

Let's consider how to operate the server transports.

Hono Rationale

Hono is selected based on community consensus (PR #945 discussion) for alignment with modern web standards and the TypeScript SDK v2 direction.

Why Hono over Express:

RequirementHonoExpress
Bundle size12kb~1mb
Web Standards (Request/Response)Yes - NativeNo - Shimmed
TypeScript nativeYesNo - @types package
Tree-shakableYes - FullyNo
HTTP/2 supportYesNo (SPDY dropped)
Built-in middlewareYes - Body parsing, auth, etc.No - Requires plugins
Edge/serverless deploymentYes - NativePartial - Requires adapters

Benefits:

  1. Web Standards Alignment - Uses native Request/Response objects, enabling deployment across Node, Deno, Bun, serverless, and edge environments
  2. TypeScript Native - Full type safety without external type packages, no monkey-patching of request objects
  3. Future-proofing - HTTP/2 support enables potential gRPC transport; aligns with TypeScript SDK v2 plans
  4. Developer Experience - Simpler API, type-safe context, smaller learning curve
  5. Bundle Efficiency - Dramatically smaller footprint benefits both development and deployment

Logging

Let's step up our logging capability with an advanced logger:

Pino Rationale

Pino is selected for synergy with the History Screen feature. The log file serves dual purposes:

  1. Server diagnostics - Standard application logging
  2. History persistence - Request/response replay source

Why Pino over Winston:

RequirementPinoWinston
Default JSON formatYes - NDJSONNo - Text (needs config)
Line-by-line parsingYes - NativeNo - Extra work
High-throughput loggingYes - Very fastPartial - Slower
Log rotationYes - pino-rollYes - winston-daily-rotate
Dev-friendly outputYes - pino-prettyYes - Built-in

Architecture:

┌─────────────────────────────────────────────────────────────────┐
│                         Server                            │
│                                                                 │
│  MCP Request ──▶ Pino Logger ──┬──▶ history.ndjson (file)       │
│                                │                                │
│                                └──▶ Console (pino-pretty)       │
│                                                                 │
│  History API: GET /api/history?method=tools/call&limit=50       │
│  (parses history.ndjson, returns filtered JSON)                 │
└─────────────────────────────────────────────────────────────────┘

Log Entry Schema:

Each MCP operation logs a request/response pair:

{"ts":1732987200000,"level":"info","type":"mcp_request","method":"tools/call","target":"echo","params":{"message":"hello"},"requestId":"abc123","serverId":"my-server"}
{"ts":1732987200045,"level":"info","type":"mcp_response","requestId":"abc123","result":{"content":[{"type":"text","text":"hello"}]},"duration":45,"success":true}

Schema fields:

FieldDescription
tsUnix timestamp (ms)
levelLog level (info, error)
typemcp_request or mcp_response
methodMCP method (tools/call, resources/read, prompts/get, etc.)
targetTool name, resource URI, or prompt name
paramsRequest parameters
requestIdCorrelation ID linking request to response
serverIdServer identifier
resultResponse data (for mcp_response)
errorError message (for failed requests)
durationResponse time in ms
successBoolean success indicator

Dependencies:

  • pino - Core logger
  • pino-pretty - Dev console formatting
  • pino-roll - Log rotation (optional)
  • pino-http - Express integration