"In the beginning there was the Message, and the Message was with the Broker, and the Message was... well, probably JSON."
A high-performance MQTT/NATS explorer TUI built in Rust. Like htop for your broker, except it won't judge you for subscribing to # or > in production.*
*It handles 1000+ messages per second without breaking a sweat, much like Death handles souls - efficiently and without unnecessary drama.
┌─────────────────────────────────────────────────────────────────────────────┐
│ mqtop │ ● Connected │ Topics: 436 │ Msgs: 12.5k (219/s) │ 5m │
├─────────────────┬───────────────────────────────────────┬───────────────────┤
│ Topics │ Messages │ Stats │
│ │ │ │
│ ▼ sensors │ sensors/device-001/temp │ Connection │
│ ▼ device-001 │ │ Status: ● │
│ ▶ temp │ { │ Host: mqtt:8883 │
│ ★ device-002 │ "timestamp": 1703... │ │
│ ▶ metrics │ "value": 23.5, │ Messages │
│ ▶ status │ "unit": "celsius" │ Total: 12.5k │
│ │ } │ Rate: 219.2/s │
│ │ │ │
│ │ │ Device Health │
│ │ │ ● 12 healthy │
│ │ │ ● 2 warning │
└─────────────────┴───────────────────────────────────────┴───────────────────┘
q:Quit /:Search f:Filter s:Star y:Copy m:Track ?:Help
* Though we make no guarantees about what the Librarian would say if you tried subscribing to ook/#.
The universe, as has been observed, operates on certain immutable rules. So does mqtop:
- Real-time MQTT + NATS streaming - Messages arrive faster than you can read them, much like footnotes in a Discworld novel
- Hierarchical topic tree - Collapsible, expandable, and infinitely more organized than L-space
- Device health monitoring - Knows when your devices are healthy, warning, or have shuffled off this mortal coil
- Metric tracking with sparklines - Little graphs that go up and down, creating the illusion of understanding
- Protocol-aware wildcard filters - MQTT (
+,#) and NATS (*,>) patterns - Latency monitoring - Track message delays with the precision of a well-oiled mechanism
- Starred topics - Bookmark the important ones, forget the rest
- Publish bookmarks - Save your favorite messages for rapid-fire testing
- Publishing - Send MQTT topics or NATS subjects directly, no external tools required
- Clipboard support - Copy topics and payloads to share the joy
- JSON syntax highlighting - Pretty colors for pretty data
- Vim-style navigation -
hjklfor those who have Seen The Light - Resilient connection - Auto-reconnect with exponential backoff, because hope springs eternal
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/frahlg/mqtop/master/install.sh | bashHomebrew (macOS/Linux):
brew tap frahlg/tap
brew install mqtopFor those who prefer their software pre-compiled, download from GitHub Releases:
| Platform | Binary | Notes |
|---|---|---|
| macOS (Apple Silicon) | mqtop-macos-arm64 |
For the M1/M2/M3 enlightened |
| macOS (Intel) | mqtop-macos-x64 |
For the x86 nostalgic |
| Linux (x64) | mqtop-linux-x64 |
The penguin approves |
| Linux (ARM64) | mqtop-linux-arm64 |
Raspberry Pi and friends |
| Windows | mqtop-windows-x64.exe |
It works here too |
# Make it executable (macOS/Linux)
chmod +x mqtop-*
# macOS: Remove the quarantine attribute
xattr -cr ./mqtop-*
# Run it
./mqtop --helpFor those who prefer to compile their own reality:
git clone https://github.com/frahlg/mqtop.git
cd mqtop
cargo build --releaseBinary materializes at target/release/mqtop (~3MB).
-
Run mqtop:
mqtop
-
The Server Manager opens automatically. Press
ato add a new server. -
Choose protocol and fill in your broker details:
- In Server Manager press
Tabto switch between MQTT and NATS. - Name:
my-broker - Host:
mqtt.example.com - Port:
8883(or1883for non-TLS) - Enable TLS if needed
- Set your client ID, username, password, or token
- In Server Manager press
-
Press
Enterto save, then select your server and pressEnteragain to connect. -
Watch the messages flow. Navigate with arrow keys or
hjkl, expand topics withEnteror→.
That's it. No config files required (though you can use them if you're that kind of person).
| Key | What It Does |
|---|---|
Tab |
Cycle panels (Topics → Messages → Stats) |
1 2 3 |
Jump directly to panel |
↑ ↓ or j k |
Move up/down |
← → or h l |
Collapse/expand or dive deeper |
Enter |
Toggle expand/collapse |
g / G |
Top / Bottom |
PgUp PgDn |
Page navigation |
| Key | What It Does |
|---|---|
/ |
Fuzzy search |
f |
Set topic/subject filter (MQTT/NATS wildcards) |
F |
Clear filter |
* |
Show only starred topics |
MQTT filter examples:
sensors/#- All sensor topicssensors/+/temperature- Temperature from any deviceook/#- The Librarian's private topics*
NATS filter examples:
telemetry.>- All telemetry subjectstelemetry.*.meter- Meter updates from any device
* Not recommended unless you want to be hit with a very large dictionary.
| Key | What It Does |
|---|---|
S |
Open server manager |
Enter |
Activate selected server |
e |
Edit server configuration |
a |
Add new server |
d |
Delete server |
Tab |
Switch MQTT/NATS server list |
Esc |
Close |
| Key | What It Does |
|---|---|
P |
Open publish dialog |
Ctrl+P |
Copy current message to publish |
B |
Open bookmark manager |
Ctrl+S |
Save publish as bookmark |
| Key | What It Does |
|---|---|
s |
Star/unstar topic |
y |
Copy topic to clipboard |
Y |
Copy payload to clipboard |
m |
Track metric from message |
p |
Cycle payload mode (Auto → Raw → Hex → JSON) |
c |
Clear statistics |
? |
Help overlay |
q |
Quit |
While mqtop works fine without config files, you can create one at ~/.config/mqtop/config.toml for persistent settings:
[mqtt]
active_server = "production"
[[mqtt.servers]]
name = "production"
host = "mqtt.example.com"
port = 8883
use_tls = true
client_id = "mqtop-prod"
subscribe_topic = "#"
keep_alive_secs = 30
[nats]
active_server = "ops"
[[nats.servers]]
name = "ops"
host = "nats.example.com"
port = 4222
use_tls = false
subscribe_subject = ">"
[ui]
message_buffer_size = 100 # Messages per topic
stats_window_secs = 10 # Rate calculation window
tick_rate_ms = 100 # UI refresh rate
# Topic highlighting
[[ui.topic_colors]]
pattern = "sensors"
color = "cyan"
[[ui.topic_colors]]
pattern = "alerts"
color = "red"Servers added via the UI are automatically saved to the config file.
Note: creds_file for NATS is parsed in config but currently not supported by the built-in NATS client. Use username/token for now.
mqtop stores data in ~/.config/mqtop/:
config.toml- Configuration and serversbackups/- Rolling config backups (last 5)userdata.json- Starred topics, metrics, bookmarks
mqtop --debug
tail -f mqtop.logThe log file knows all.
[ui]
tick_rate_ms = 200 # Slower refreshcargo test # Run tests
cargo run -- --debug # Debug mode
cargo build --release # Production buildCreated by Fredrik Ahlgren (@frahlg on GitHub, @frahlg on X)
Co-authored with Claude Code.
MIT License - See LICENSE file.
- Fork it
- Create a feature branch
- Make your changes
- Submit a pull request
For bugs and features, open an issue.
GNU Terry Pratchett