MQTTnet is a high-performance .NET library providing MQTT client and server implementations up to protocol version 5 with async APIs and multiple transports.
Overview
MQTTnet implements MQTT messaging for .NET across many framework versions and CPU architectures. It offers lightweight client and broker components without external dependencies, with optional TLS and WebSocket channels.
The client includes low-level and managed variants, with the managed client maintaining connections, subscriptions, and QoS rescheduling automatically. The server exposes connected client lists, mixed protocol versions, retained messages, and subscription validation hooks.
Performance claims in documentation cite high message throughput on local TCP benchmarks. The package ships via NuGet with sample projects for connect, publish, subscribe, and self-hosted broker scenarios.
The project is supported by the .NET Foundation and follows the Contributor Covenant code of conduct.
Key features
- MQTT 5 client and server
- Async and TLS support
- TCP and WebSocket channels
- Managed auto-reconnect client
- Retained message interfaces
- ASP.NET Core WebSocket server
- Azure IoT Hub compatibility
- No external dependencies
Use cases
- Embedded .NET MQTT clients
- In-process MQTT broker hosting
- IoT device messaging on .NET
- Azure IoT Hub integrations