Aviary
Concepts

MCP tools

Telescope's tools on the Aviary dev MCP endpoint (/mcp/aviary) — so coding agents (Claude Code, Cursor, …) can debug straight from the captured data.

A coding agent — Claude Code, Cursor, or anything that speaks MCP (Model Context Protocol) — can query Telescope's captured data directly. Instead of pasting a stack trace into a chat, you ask "why is POST /checkout slow?" and the agent pulls the request's batch waterfall with every query, log, and exception it produced.

Telescope does not run an MCP server of its own. It registers its tools on the Aviary dev MCP endpoint, /mcp/aviary, served by @dudousxd/nestjs-agent-mcp-server, next to the other Aviary consoles' tools. One endpoint, one connection, every console.

Removed in 5.0

Telescope 4.x had its own opt-in endpoint, POST <path>/api/mcp (mcp: true, mcpAuthorize, mcpDecorators, TelescopeMcpController). 5.0 removes it: connect the agent to /mcp/aviary instead. The tools below are the same data, gated by the console's authorize.

Set it up

Install the agent's MCP server and mount it in the app that runs Telescope:

import { AgentMcpServerModule } from '@dudousxd/nestjs-agent-mcp-server';
import { TelescopeModule } from '@dudousxd/nestjs-telescope';

@Module({
  imports: [
    TelescopeModule.forRoot({ authorize: { policy: ConsolePolicy, ability: 'view' } }),
    AgentMcpServerModule.forRoot({
      // …your MCP server options (see the agent's docs). The dev endpoint is on by default
      // at /mcp/aviary; `devTools: { path }` moves it, `devTools: false` turns it off.
    }),
  ],
})
export class AppModule {}

Telescope's tools are registered while the console's routes are mounted. Set devTools: true to keep them with routes: false, or devTools: false to turn them off:

TelescopeModule.forRoot({
  authorize: { policy: ConsolePolicy, ability: 'view' },
  devTools: false,
});

Protecting it

Each lib on the dev endpoint is gated by its own console check: Telescope's tools by the module's authorize (open outside production and 403 in production when omitted, see Protecting the routes). An agent client sends Authorization: Bearer <key> rather than the dashboard's session cookie, so give authorize a form that accepts it — for one shared token, authorizeByToken:

import { authorizeByToken } from '@dudousxd/nestjs-telescope';

TelescopeModule.forRoot({
  authorize: authorizeByToken({ token: process.env.TELESCOPE_TOKEN }),
});

For a key per developer, revocable on its own, sign the agent in with @nestjs/authentication's ApiKeyProvider on the dev endpoint (AgentMcpServerModule.forRoot({ devTools: { decorators: [...] } })) and keep a policy-based authorize: the key signs in the user it belongs to, and the policy still decides.

Connect an agent

For Claude Code, register the dev endpoint over the HTTP transport:

claude mcp add --transport http aviary http://localhost:3000/mcp/aviary

With a key, pass it as a header (in a shared .mcp.json, reference an environment variable, "Authorization": "Bearer ${AVIARY_MCP_KEY}", instead of committing it):

claude mcp add --transport http aviary https://app.example.com/mcp/aviary \
  --header "Authorization: Bearer $AVIARY_MCP_KEY"

Tools

ToolWhat it does
telescope_list_entriesRecent entries, newest first, as summaries. Filters: type, search, tag, sinceMinutes; limit (default 20, max 100). Returns { items, next }: pass next as cursor for the next page.
telescope_get_entryOne entry by id with the summaries of its batch — every other entry recorded during the same request or job, i.e. the waterfall.
telescope_get_traceEvery entry recorded under one traceId.
telescope_get_waterfallThe span waterfall of one traceId.
telescope_get_healthPulse health over the last sinceMinutes (default 60): throughput, percentiles, slowest requests and queries, N+1 suspects, exception families, cache hit rate.
telescope_diagnose_exceptionAI diagnosis of an exception entry by id. Listed only when AI diagnosis is configured. It spends AI tokens.

An unknown or pruned id is a tool error ("… not found"). A typical agent flow: telescope_get_health to find the slowest route, telescope_list_entries to find a representative request, then telescope_get_entry to pull its batch and spot the N+1.

Extensions can add tools to this list (the Resilience page adds telescope_resilience_circuits and telescope_resilience_reset_circuit). Each is served as telescope_<its name>; a tool that is not valid (not snake_case, no description, or a name already taken) is left out with a warning, and telescope's own tools are still served. Their data spans every organization, so with organizations on, a caller limited to some organizations gets an error from them.

On this page