aiomqtt
The idiomatic asyncio MQTT client
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real pain point—callback-based MQTT programming—with a clean async/await API. It is well-suited for any asyncio application that needs MQTT. The Windows event loop caveat is documented and straightforward to work around.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- On Windows with Python 3.8+, the default ProactorEventLoop does not support the add_reader method required by aiomqtt; you must switch to SelectorEventLoop before running.
- Low friction: pure Python wheel with only paho-mqtt and typing-extensions as runtime dependencies.
- Active maintenance with recent commits and no known vulnerabilities.
License · maintenance · safety
permissive license (permissive) — BSD 3-clause permissive license. The underlying paho-mqtt dependency is dual-licensed under BSD 3-clause and Eclipse Distribution License v1.0, both permissive.
last release 2026-03-05 (162 days) · last repo commit 2026-04-23 · 569 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,161,075 downloads/mo, #4,284 on PyPI
Alternatives
Verify before relying
pip install aiomqtt
import asyncio
from aiomqtt import Client
async def main():
async with Client("test.mosquitto.org") as client:
await client.publish("temperature/outside", payload=28.4)
asyncio.run(main())- Whether the package handles reconnection and backpressure automatically or requires explicit handling in user code.
- Performance characteristics and latency overhead compared to direct paho-mqtt usage.
What it is and what it does
aiomqtt is an asyncio wrapper around paho-mqtt that replaces callback-based MQTT programming with async/await patterns. Instead of registering on_publish, on_subscribe, and on_disconnect callbacks, you write linear async code using context managers and async iteration. It supports MQTT 5.0, 3.1.1, and 3.1, is fully type-hinted, and raises MqttError exceptions instead of returning numeric error codes.
The package is designed for developers building IoT applications, real-time data pipelines, or other systems that need to publish or subscribe to MQTT topics without blocking. It has been actively maintained since 2017, supports Python 3.8 through 3.13, and carries no known security vulnerabilities. The only gotcha is a Windows-specific event loop configuration requirement documented in the description.
Use it for
- Publish sensor readings to an MQTT broker from an asyncio application without blocking other concurrent tasks.
- Subscribe to multiple MQTT topics and process incoming messages in an async for loop within a larger async application.
- Build IoT gateways or data aggregators that need to handle many concurrent MQTT connections with clean async/await syntax.
- Integrate MQTT messaging into async web frameworks or other asyncio-based services.
- Replace callback-heavy paho-mqtt code with readable linear async code in new projects.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real pain point—callback-based MQTT programming—with a clean async/await API. It is well-suited for any asyncio application that needs MQTT. The Windows event loop caveat is documented and straightforward to work around.
Install
aiomqtt on PyPI
Before you install
Low friction: pure Python wheel with only paho-mqtt and typing-extensions as runtime dependencies. Active maintenance with recent commits and no known vulnerabilities.
On Windows with Python 3.8+, the default ProactorEventLoop does not support the add_reader method required by aiomqtt; you must switch to SelectorEventLoop before running.
License in practice
BSD 3-clause permissive license. The underlying paho-mqtt dependency is dual-licensed under BSD 3-clause and Eclipse Distribution License v1.0, both permissive.
Quickstart
pip install aiomqtt
import asyncio
from aiomqtt import Client
async def main():
async with Client("test.mosquitto.org") as client:
await client.publish("temperature/outside", payload=28.4)
asyncio.run(main())
Verify before relying
- Whether the package handles reconnection and backpressure automatically or requires explicit handling in user code.
- Performance characteristics and latency overhead compared to direct paho-mqtt usage.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespaho-mqtttyping-extensions |
| Maintenance | Actively maintained 162 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,161,075 / month, #4,284 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: aiomqtt-2.5.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “asyncio mqtt client”
- aiomqttAn asyncio-native MQTT client that wraps paho-mqtt to provide…
- gmqttgmqtt is an async Python MQTT client that connects to MQTT brokers,…
- asyncio-mqttProvides an async/await interface to MQTT messaging, wrapping…
Give your agent the search over MCP, or paste the wish link into any chat.
More Internet packages
Botocore provides low-level, data-driven access to Amazon Web Services APIs, serving as the foundation for the AWS CLI and boto3 libraries.
Install it if you need programmatic access to AWS services.
Provides an async client for AWS services using botocore and aiohttp, allowing you to call AWS APIs asynchronously within asyncio-based applications.
Install it if you need to call AWS services from async Python code; it is the standard way to do so.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides a platform-independent file locking mechanism to coordinate access to files across processes and threads.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides common Protocol Buffer message definitions used across Google Cloud APIs, enabling Python clients to interact with Google services.
See also asyncio-mqtt · gmqtt · paho-mqtt · tb-paho-mqtt-client · telegraph · gcloud-aio-pubsub · types-paho-mqtt · victron-mqtt · yoto-api · pyimouapi