MQTTX CLI
$ mqttx Official Med RiskDeveloped by EMQX, MQTTX CLI (mqttx) unifies MQTT connection testing (mqttx conn), publishing (mqttx pub), subscribing (mqttx sub), and load benchmarking (mqttx bench) in one tool. Supports MQTT 5.0 properties (--content-type application/json) and --save-options / --load-options JSON configs.
brew install emqx/mqttx/mqttx-cli mqttx runs live broker connection checks, payload publishes, and connection benchmarks locally without needing an MCP server.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports JSON/YAML --load-options profiles, --format json payload decoding, and MQTT 5.0 flags, though sub and conn keep running until terminated.
- Supports
--load-optionsJSON profiles and MQTT 5.0 payload indicators mqttx subandmqttx connremain open until SIGINT/timeout
Supports TLS/mTLS and reusable profile files (--load-options) to avoid inline passwords, while mqttx bench can flood brokers if misconfigured.
- Profile files prevent repeated CLI password exposure
mqttx benchgenerates high load if run against prod
Installable via Homebrew tap, npm install -g mqttx-cli, Docker, and standalone binaries across macOS, Linux, and Windows.
- Available via
brew,npm, and prebuilt releases
Combines conn, pub, sub, and bench (plus WebSocket/MQTT 5.0 support) in a single CLI.
- Replaces separate pub/sub/load-test MQTT tools
Actively maintained by EMQX (emqx/MQTTX) under Apache-2.0 license.
- Official
emqx/MQTTXrepository under Apache-2.0
Good CLI docs and examples at mqttx.app/docs/cli/.
- CLI getting-started and command docs at mqttx.app
Security, Auth & Guardrails
Accepts -u/-P and TLS flags on CLI or loads reusable connection JSON/YAML profiles via --load-options <file>.
Apache-2.0 open-source CLI; completely free.
# MQTTX CLI Agent Rules - Wrap `mqttx sub` and `mqttx conn` with an external timeout in headless shells because they stay connected until interrupted. - Never run `mqttx bench` against shared or production brokers without explicit user approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
mqttx conn -h broker.emqx.io -p 1883 -V 5.0
Verifies MQTT 5.0 handshake and broker reachability.
Controlled Writes & Previews
mqttx pub -t 'sensors/temp' -h broker.emqx.io -p 1883 -m '{"c":23.4}' --payload-format-indicator --content-type application/json Sends a structured JSON message tagged with MQTT 5.0 metadata.
Strengths for Agents
- + Full MQTT 5.0 support including
--content-type, user properties, and WebSocket transport. - +
--save-options/--load-optionsstore repeatable test configs in JSON/YAML. - + Built-in
mqttx benchcovers connection and throughput stress testing.
Caveats & Pitfalls
- !
mqttx connandmqttx substay open indefinitely without an external process timeout. - ! Careless
mqttx benchconcurrency (-c) can overwhelm shared brokers.