Read-only NATS and JetStream observability: trace a request across streams, rank what is broken.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Give an AI agent safe access to your production event bus.
A web UI, a CLI and an MCP server over one bounded query engine β so humans and agents debug NATS from the same source of truth.
Every NATS GUI answers "what is in this stream?". That is the easy question.
The hard question in an event-driven system is "why did this one flow fail?" β and answering it
means following a single request_id across four streams, three services and a dead-letter subject.
Today you do that by hand, with a terminal per stream.
NATS Trail answers that question directly, and exposes the answer to agents as a typed, bounded, read-only tool contract β so you can point Claude at production and ask.
Or, from an agent: "Why did the refresh for s3-events fail?" β and it lands on the message that actually broke, with the retry state and the correlation ids already extracted:
There are several NATS MCP servers. They shell out to the nats CLI, return raw dumps, and expose
publish and delete while describing themselves as read-only.
NATS Trail treats the agent surface as a contract, not a wrapper:
| NATS Trail | Typical NATS MCP server | |
|---|---|---|
| Tool schemas | Explicit JSON input and output schemas per tool | None, or input only |
| Result size | limit is required, capped at 200, with cursors | Unbounded |
| Long scans | maxScan budget with explicit truncation warnings | Scans until it dies |
| Message shape | subject, timestamp, stream/seq, truncation flag, extracted request_id / correlation_id | Raw payload dump |
| Errors | Structured envelope with code and retriable | Stack traces or plain strings |
| Writes | Unreachable from the agent runtime | publish, KV and object writes exposed |
| Audit | Every call logged with origin and token identity; mutations with their arguments | None |
NATS Trail can write: publish, purge, delete messages, consumers and streams. Those live behind
/api/mutate, reachable from the UI and the CLI.
executeMcpTool() receives an McpRuntimeData interface that exposes only read functions. There is
no disabled publish behind a feature flag β there is no publish to call. A misconfigured
environment variable cannot purge your production stream, because the code path does not exist. CLI
write commands additionally refuse to run under --agent, and the test suite reads the source to
assert none of this has been quietly undone.
This is the only reason it is reasonable to hand an agent a prod context.
Open http://127.0.0.1:4000 β one process serves the UI and the API.
Prefer containers? The compose file brings up NATS Trail next to a JetStream-enabled server:
/api and /ws to the bridge)npm run dev runs the TypeScript watcher, the API bridge and the UI together.
Requirements: Node.js >= 22 (for the built-in SQLite used by the correlation index) and a reachable NATS server (nats-server -js is fine).
Point any MCP client at the stdio server. For Claude Code:
Or wire it manually:
Twenty-five read-only tools, all returning the same envelope:
See docs/mcp-agent.md.
A filter you save in the UI is the same filter nats-trail filter run executes, and the same one
natstrail.run_filter hands an agent. Configure a context once; use it everywhere.
packages/ui β React + Vite. Presentation only.packages/server β Express + WebSocket bridge. Owns connections and credentials.packages/core β the Query Engine: envelopes, limits, truncation, filters, error normalization.packages/cli β the nats-trail binary: query commands, serve, and an interactive shell.packages/mcp β tool contracts and the stdio server.See docs/architecture.md.
Inspect β context selector (local / dev / staging / prod) with a prod confirmation gate, live subject subscription, JSON pretty print with tree view and in-payload search, stream and consumer browsing, auto-detected DLQ panel.
![]() JetStream β streams, subjects, counts and consumer health. | ![]() NATS Core β live subject subscription with filters. |
![]() DLQ β auto-detected dead letters with reason and origin. | ![]() Viewer β tree, raw, search, fullscreen, copy-path. |
Understand β subject discovery infers payload shapes from real traffic, flow reconstruction
turns one request_id into a causal chain, and the health summary ranks what is actually broken.
Query β bounded stream scans with cursors and time windows, filters by subject, date, text and JSON event type, saved filters shared across all three surfaces. Binary payloads (protobuf, msgpack) are detected and shown as hex dumps rather than mojibake.
Browse β KV buckets with per-key revision history including deletes, Object Store metadata, and
server health from the monitoring port (varz / jsz / connz).
Change β publish, request/reply, purge, and delete messages, consumers and streams, from the UI and the CLI, behind confirmation. Never from the agent surface.
Integrate β read-only HTTP API under /api/integration, bearer tokens with per-token audit
identity, and POST /api/integration/enrich/sentry to attach NATS context to an error without
exposing credentials.
Full list in docs/features.md Β· CLI reference in docs/cli.md.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/nats-trail)<a href="https://allmcps.com/mcp/nats-trail"><img src="https://allmcps.com/api/badge/nats-trail?style=directory" alt="Nats Trail on AllMCPs" /></a>