
NATS
from daanrongen
MCP server for NATS โ publish, request-reply, JetStream streams, KV store, and server diagnostics over stdio
โ labsco summary โ our analysis, not the vendor's
What it is โ An MCP server for NATS that publishes messages, does request-reply, manages JetStream streams, uses the KV store, and inspects server diagnostics over stdio.
What you get โ
- Core โ
publishandrequest(request-reply pattern) - JetStream โ
stream_create/list/info/delete,stream_publish,stream_fetch,stream_consumer_create - KV store โ
kv_create_bucket,kv_get/put/delete,kv_list_keys,kv_history - Server โ
server_infodiagnostics - 17 tools total
Requirements โ A running NATS server URL (NATS_URL, e.g. nats://localhost:4222), required.
Cost snapshot โ Free; license not stated in the README. NATS itself is open source and self-hosted.
Setup effort โ bunx @daanrongen/nats-mcp, or claude mcp add nats -e NATS_URL=... -- bunx @daanrongen/nats-mcp.
Our take โ A capable bridge for teams already running NATS/JetStream who want to inspect and drive messaging from an assistant. Caveat: it assumes a reachable NATS server (no auth options shown beyond the URL), and the license is unspecified โ confirm before commercial use.
Source: the project README โ summarized 2026-07-08.
โ readme from github โ mirrored (latest on GitHub โ)
nats-mcp
MCP server for NATS โ publish messages, request-reply, manage JetStream streams, use the KV store, and inspect server diagnostics over stdio.
Tools (17 total)
| Domain | Tools | Coverage |
|---|---|---|
| Core | publish, request | Publish messages, request-reply pattern |
| Streams | stream_list, stream_info, stream_create, stream_delete, stream_publish, stream_fetch, stream_consumer_create | JetStream stream lifecycle and message delivery |
| KV | kv_create_bucket, kv_list_buckets, kv_get, kv_put, kv_delete, kv_list_keys, kv_history | Key-value store with history |
| Server | server_info | NATS server diagnostics |
Development
bun install
bun run dev # run with --watch
bun test # run test suite
bun run lint # lint and check formatting
bun run typecheck # type check
bun run build # bundle to dist/main.js
bun run inspect # open MCP Inspector in browserInspecting locally
bun run inspect launches the MCP Inspector against the local build:
bun run build && bun run inspectThis opens the Inspector UI in your browser where you can call any tool interactively and inspect request/response shapes.
Architecture
src/
โโโ config.ts # Effect Config โ NATS_URL
โโโ main.ts # Entry point โ ManagedRuntime + StdioServerTransport
โโโ domain/
โ โโโ NatsClient.ts # Context.Tag service interface
โ โโโ errors.ts # NatsError, KvNotFoundError, StreamNotFoundError
โ โโโ models.ts # Schema.Class models (NatsMessage, StreamInfo, KvEntry, โฆ)
โโโ infra/
โ โโโ NatsClientLive.ts # Layer.scoped โ connects via nats.js, drains on shutdown
โ โโโ NatsClientTest.ts # In-memory Ref-based test adapter
โโโ mcp/
โโโ server.ts # McpServer wired to ManagedRuntime
โโโ utils.ts # formatSuccess, formatError
โโโ tools/ # core.ts, streams.ts, kv.ts, server.ts{
"mcpServers": {
"nats": {
"type": "stdio",
"command": "bunx",
"args": ["@daanrongen/nats-mcp"],
"env": {
"NATS_URL": "nats://localhost:4222"
}
}
}
}Before it works, you'll need: NATS_URL
Installation
bunx @daanrongen/nats-mcpConfiguration
| Variable | Required | Description |
|---|---|---|
NATS_URL | Yes | NATS server URL (e.g. nats://localhost:4222) |
Setup
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"nats": {
"type": "stdio",
"command": "bunx",
"args": ["@daanrongen/nats-mcp"],
"env": {
"NATS_URL": "nats://localhost:4222"
}
}
}
}Claude Code CLI
claude mcp add nats -e NATS_URL=nats://localhost:4222 -- bunx @daanrongen/nats-mcpNo common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.
License
MIT