SuperAPI AI Directory

hono-telescope

Read-only debugging for Hono apps: recent exceptions with their requests, logs and queries, requests filtered by status or duration, and the slowest queries.

Open website

About this tool

Purpose

hono-telescope is a debugging tool for Hono applications, inspired by Laravel Telescope. It provides a dashboard that shows every request along with the logs, database queries, exceptions, and external calls that occur within that request. Its dashboard endpoint also acts as an MCP (Model Context Protocol) server, enabling AI coding agents to read live telemetry data directly from a running application—the actual exception, the request that produced it, and the queries that were executed—instead of being handed a pasted stack trace.

Key Capabilities

  • MCP Server: The dashboard endpoint doubles as an MCP server, and AI agents can read live requests, exceptions, and queries through five read-only tools.
  • HTTP Request Monitoring: Tracks headers, payloads, and response bodies of incoming requests, as well as headers, payloads, and responses of outgoing fetch calls.
  • Exception Tracking: Captures and monitors application errors and their stack traces.
  • Log Monitoring: Monitors console logs at different severity levels.
  • Database Query Monitoring: Provides explicit per-client instrumentation for Prisma, Sequelize, MongoDB, and Bun SQLite, and records execution time.
  • Dashboard: A modern React-based web interface with real-time updates.
  • Zero Configuration: Works out of the box with sensible defaults.
  • Tag System: Organize entries using custom tags and context.
  • TypeScript Support: Complete type definitions and type safety.
  • High Performance: Minimal overhead and efficient memory management.
  • Bun and Node.js: Seamless support for both runtimes.
  • Multi-Database Support: Integrates with mainstream database libraries.
  • Zero Runtime Dependencies: Depends only on Hono (as a peer dependency).

Usage

Visit /telescope to open the dashboard. Telescope is enabled by default outside production and disabled by default in production.

The MCP server requires no additional mounting; it is provided directly by the already-mounted dashboard. All five tools are read-only, and there is no tool to clear or write telemetry data. Among them, minStatus: 400 is notable: handlers that return an error status code without throwing an exception do not record an exception, so this filter is the only way to discover such failures. The transport uses the current Streamable HTTP revision (2026-07-28) and also accepts 2025-11-25 for compatibility with older clients. GET and DELETE return 405: that revision has no SSE stream and no session.

For clients that only support stdio, the package includes a bridge: it reads JSON-RPC messages line by line from stdin, forwards them to the endpoint already provided by the application, and writes replies back to stdout.--url(or TELESCOPE_URL) is the only required option. For a dashboard protected by dashboard.auth , credentials can be passed via request headers—--header can be repeated, andTELESCOPE_HEADER is for clients that can only set environment variables. The bridge only forwards and does not reimplement the protocol, so it adds no tools, session state, or new dependencies, and it requires the application to already be running.

All options are optional;createTelescope() can use the default values. If you mount the dashboard at a path other than /telescope , you must set dashboardPath to the same value. The middleware uses dashboardPath Avoid recording the dashboard's own traffic; the dashboard uses it to construct the base URL.

For database queries, pass the database client to Telescope for query instrumentation. Prisma returns a new client, and you must use the one that is returned. Supported databases include Prisma, Sequelize, MongoDB, and Bun SQLite. Note: automatic database interception was removed in 1.0 because it never worked under Node ESM, and at runtime it could only capture raw SQL; explicit per-client instrumentation is now required. Failed queries are also recorded, marked as failed and accompanied by the client's own error message, so failed commands and slow commands are distinguishable in the dashboard and in MCP. This covers Prisma, MongoDB, and Bun SQLite. Sequelize is the exception: it is instrumented through the afterQuery hook, and that hook does not appear to run when a query fails, so failed Sequelize queries are currently not recorded at all.

Each client only needs to call each instrument* method once. Unlike the collector, they are not idempotent (only instrumentBunSqlite prevents double wrapping), so instrumenting the same client twice causes every query to be recorded twice.instrumentBunSqlite Wraps the query and prepare statement factories, so statement calls (all, get, run, values) are recorded; queries issued directly on the database (db.exec, db.run, db.all, db.get) are not captured.

When to use

Suitable for developers building with the Hono framework who need to debug request chains, exceptions, logs, and database queries, especially in scenarios where they want an AI coding agent to read telemetry data directly from a running application.

Limitations

  • The dashboard exposes request and response bodies, headers, and SQL, so Telescope is disabled when NODE_ENV === 'production' . If you still want to enable it in production, you must provide dashboard.auth, otherwise mounting will throw an error.
  • Sensitive headers (authorization, cookie, set-cookie, x-api-key, proxy-authorization) and request body keys (password, token, secret, apikey, authorization) are redacted by default at any nesting depth, recursing through nested objects and arrays, case-insensitively, with values replaced by [REDACTED] rather than deleted.
  • Outgoing request bodies are only captured when already in memory (string, URLSearchParams, or ArrayBuffer). ReadableStream, FormData, or Blob request bodies, as well as the request body of a Request object passed as the first argument to fetch, are skipped and the payload remains empty.
  • Streaming responses are not captured. Responses produced by Hono's streamText and streamSSE are recorded but without the response body, so recording does not buffer or delay the stream. Detection relies on the Transfer-Encoding: chunked header set by these helpers (the bare stream() helper does not set content-type, so it is also skipped); a manually constructed new Response(readableStream, { headers: { 'content-type': 'text/plain' } }) does not set either header, so it will be read and buffered before being recorded. Setting Transfer-Encoding: chunked or a non-text content type for such responses can make them opt out of capture.
  • Request and response bodies larger than capture.maxBodySize are recorded only as metadata ({ truncated: true, size }), and non-JSON text/* request bodies are recorded as { body: text }. JSON array bodies are wrapped so the recorded body is always an object: the request is { body: [...] } and the response is { response: [...] }. Redaction still descends into arrays.
  • Custom storage adapters must implement StorageAdapter and be validated against the contract test suite included in the package. That suite (a Vitest suite, which requires installing a test runner yourself to run) pins down theTwo sorting guarantees: list returns newest first, findByParent returns oldest first.
  • Upgrading from 0.x: 1.0 introduces a new API centered on createTelescope(); setupTelescope(app, config) is replaced by createTelescope(config), and middleware and the dashboard must be mounted explicitly; config keys are changed to camelCase (e.g. max_entries → maxEntries, sanitize_headers → redact.headers); database interception is changed to explicit per-client, and automatic interception has been removed; Axios interception has been removed (axios on Node does not use fetch); requests whose handlers throw an exception are recorded with the status code returned by your own onError, and the exception is recorded as a child entry of that request.

Quick Start

First install the dependencies, then build the project for the first time. In development mode, start the TypeScript watcher and the example app: in terminal 1 run the TypeScript compilation (watch mode), in terminal 2 start the example Hono app, with hot reload at http://localhost:3000。示例 The API endpoint is http://localhost:3000/api/...,仪表盘为 http://localhost:3000/telescope。可使用测试脚本一次性测试所有端点,自动填充仪表盘数据。

Roadmap (planned features)

  • Data export: export monitoring data in multiple formats (JSON, CSV).
  • Alerts and notifications: real-time alerts for errors and performance issues.
  • Analytics and reporting: advanced analytics and historical data analysis.
  • Authentication and authorization: dashboard access control beyond basic authentication.
  • Multi-tenant support: support for multiple isolated projects.
  • Plugin system: an extensible plugin architecture to support custom integrations.
  • Data persistence: optional database storage for long-term monitoring.