asyncio-mqtt
Idiomatic asyncio wrapper around paho-mqtt
Decision gist · record as of 2026-08-14
Yes. The package solves a real pain point—callback-free MQTT in async Python—with minimal dependencies, active maintenance, and no known vulnerabilities. Install friction is low and the BSD license is permissive. The only caveat is the Windows event-loop gotcha, which is well-documented and easily worked around. Suitable for production use in asyncio applications.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 add_reader(); you must switch to SelectorEventLoop via asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) before running your async code.
- Low friction: pure Python wheel with only two runtime dependencies (paho-mqtt and typing-extensions).
- Actively maintained with recent commits; last release was over 2 years ago but repository shows ongoing activity.
License · maintenance · safety
BSD 3-Clause License (permissive) — BSD 3-Clause License (permissive) allows commercial and private use with minimal restrictions—include a copy of the license and you're clear.
last release 2023-06-26 (1145 days) · last repo commit 2026-04-23 · 569 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 634,904 downloads/mo, #5,640 on PyPI
Alternatives
Verify before relying
pip install asyncio-mqtt
import asyncio_mqtt as aiomqtt
async def main():
async with aiomqtt.Client("test.mosquitto.org") as client:
await client.publish("humidity/outside", payload=0.38)
asyncio.run(main())- Whether the package is still actively maintained—last release was June 2023 but last commit shown is April 2026; clarify release cadence.
- Performance characteristics under high message throughput or with many concurrent subscriptions.
- Compatibility with MQTT 5.0 features beyond what paho-mqtt 1.x provides.
What it is and what it does
asyncio-mqtt is a thin, modern wrapper around paho-mqtt that replaces callback-based MQTT code with async/await patterns. Instead of defining on_message, on_connect, and on_disconnect callbacks, you write straightforward async context managers and async for loops to subscribe, publish, and handle messages. It handles connection lifecycle automatically and raises MqttError exceptions instead of returning error codes, making error handling more Pythonic.
The package is designed for developers building asyncio-based applications—web services, IoT clients, or any async Python code that needs MQTT messaging. It depends only on paho-mqtt for the underlying protocol implementation and typing-extensions for type hints, keeping the wrapper itself under 700 lines of code. It supports Python 3.7 through 3.11 and runs on Linux, macOS, and Windows (with a minor event-loop configuration on Windows).
Use it for
- Building async web services (FastAPI, Starlette) that need to publish or subscribe to MQTT topics without blocking request handlers.
- Writing IoT device clients that listen for commands and publish sensor readings using native async/await instead of managing callbacks.
- Integrating MQTT into async event-driven applications where you want message handling to fit naturally into the asyncio task model.
- Sharing a single MQTT connection across multiple concurrent async functions without creating separate clients or managing complex callback state.
- Filtering and routing incoming MQTT messages by topic pattern (e.g., humidity/outside, +/inside) within a single async loop.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package solves a real pain point—callback-free MQTT in async Python—with minimal dependencies, active maintenance, and no known vulnerabilities. Install friction is low and the BSD license is permissive. The only caveat is the Windows event-loop gotcha, which is well-documented and easily worked around. Suitable for production use in asyncio applications.
Install
asyncio-mqtt on PyPI
Before you install
Low friction: pure Python wheel with only two runtime dependencies (paho-mqtt and typing-extensions). Actively maintained with recent commits; last release was over 2 years ago but repository shows ongoing activity.
On Windows with Python 3.8+, the default ProactorEventLoop does not support add_reader(); you must switch to SelectorEventLoop via asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) before running your async code.
License in practice
BSD 3-Clause License (permissive) allows commercial and private use with minimal restrictions—include a copy of the license and you're clear.
Quickstart
pip install asyncio-mqtt
import asyncio_mqtt as aiomqtt
async def main():
async with aiomqtt.Client("test.mosquitto.org") as client:
await client.publish("humidity/outside", payload=0.38)
asyncio.run(main())
Verify before relying
- Whether the package is still actively maintained—last release was June 2023 but last commit shown is April 2026; clarify release cadence.
- Performance characteristics under high message throughput or with many concurrent subscriptions.
- Compatibility with MQTT 5.0 features beyond what paho-mqtt 1.x provides.
Package facts
| License | BSD 3-Clause License permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespaho-mqtttyping-extensions |
| Maintenance | Actively maintained 1,145 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 634,904 / month, #5,640 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: asyncio_mqtt-0.16.2-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 › “async mqtt wrapper”
- asyncio-mqttProvides an async/await interface to MQTT messaging, wrapping…
- aiomqttAn asyncio-native MQTT client that wraps paho-mqtt to provide…
- yoto-apiAsync Python client for controlling Yoto player devices via REST API…
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 aiomqtt · paho-mqtt · tb-paho-mqtt-client · gmqtt · victron-mqtt · types-paho-mqtt · yoto-api · synchronicity · asyncer · gcloud-aio-pubsub