finds.dev← search

// the find

mochi-mqtt/server

★ 1,878 · Go · MIT · updated Apr 2025

The fully compliant, embeddable high-performance Go MQTT v5 server for IoT, smarthome, and pubsub

Mochi-MQTT is an embeddable MQTT v5 broker written in Go, designed to be imported as a library rather than deployed as a standalone service. It targets developers who need a broker baked into their application — IoT gateways, smart home hubs, test harnesses — rather than a separate infrastructure component.

The hook system is the standout feature: stackable, composable, and covers basically every point in the packet lifecycle (OnPacketRead, OnPublish, OnQosComplete, etc.), so you can implement auth, persistence, or message transformation without forking the server. The inline client (v2.4.0+) is genuinely useful — subscribe and publish directly from embedding code without a loopback TCP connection, and it bypasses ACL checks so it can reach $SYS topics. Passes the Paho Interoperability Test suite for both v5 and v3.1.1, which is a real bar to clear. Benchmarks show competitive throughput with Mosquitto at low client counts and actually beats it in the million-message test.

No cluster support — it's on the roadmap but absent, which rules it out for anything that needs horizontal scaling or HA. The persistence hooks (Badger, Pebble, Redis, Bolt) are basic key-value stores; there's no WAL or replication story, so a crash during high QoS traffic can lose inflight messages. Metrics support is flagged as 'enhanced metrics' on the roadmap, meaning current observability is limited to $SYS topics and whatever you wire up yourself. Last push was April 2025, and the benchmark numbers are from v2.2.10 — unclear how current the performance story is.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →