mautrix
A Python 3 asyncio Matrix framework.
What it is and what it does
Mautrix is an asyncio-based Python framework for building applications that interact with the Matrix protocol. It sits between raw HTTP and high-level application logic, offering layered abstractions: a basic HTTP client, Matrix Client API endpoints, application service transaction handling, end-to-end encryption support via libolm, and specialized bridging utilities. The framework targets developers building Matrix bots, bridges to other chat systems, or custom Matrix clients.
The package provides utilities for common tasks like HTML parsing, configuration management, database access (via asyncpg or SQLAlchemy), and token signing. It requires Python 3.10+ and depends on aiohttp, attrs, and yarl for async HTTP operations. The codebase is actively maintained and classified as Beta, indicating core functionality is stable but the API may evolve.
Use it for:
- Build a Matrix appservice that bridges messages between Matrix and another chat platform
- Create a Matrix bot that syncs room state and handles encrypted messages
- Implement end-to-end encryption in a custom Matrix client using the crypto framework
- Develop a Matrix application service with transaction support and user/alias query handling
- Build double-puppeting integrations where a bridge controls user accounts on both sides
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
An asyncio Matrix framework for Python that provides HTTP client APIs, application service support, end-to-end encryption, and bridging utilities for building Matrix protocol applications.
Yes, if you are building a Matrix application or bridge. The framework is actively maintained, has low install friction, and provides well-structured abstractions for the full Matrix protocol stack. The copyleft license (MPL 2.0) requires source disclosure if you modify and redistribute, so review your licensing constraints. No known security vulnerabilities as of the fact sheet date.
Install
mautrix on PyPI
pip
pip install mautrixuv
uv add mautrixpoetry
poetry add mautrixInstalling mautrix
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (40 days old) and ongoing repository activity. Requires Python 3.10 or later.
License in practice
Licensed under Mozilla Public License 2.0 (MPL 2.0), a copyleft license. You must disclose source code modifications and distribute under the same license if you modify and redistribute the package.
Quickstart
pip install mautrix
import asyncio
from mautrix.client import Client
async def main():
client = Client(homeserver="https://matrix.example.com", user_id="@user:example.com")
# Use client for Matrix operations
asyncio.run(main())
Requires Python 3.10 or later. End-to-end encryption support requires libolm system library (installed via python-olm dependency).
Verify before relying
- Whether libolm system library is required for end-to-end encryption support or if python-olm handles installation
- Specific asyncpg or SQLAlchemy version requirements for database helpers
- Whether all advertised components (bridge, crypto, appservice) are production-ready or still experimental
Package facts
| License | not declared (copyleft) |
| Python support | supports the current Python release (~=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — aiohttp, attrs, yarl |
| Maintenance | actively maintained — 40 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 973,500/month — #4,603 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mautrix-0.21.1-py3-none-any.whl
Tags
More Chat packages
Provides Python bindings for Slack's Web API,…
permissive · top 1,000 on PyPI
python-telegram-botProvides a pure Python asynchronous interface…
copyleft · top 1,000 on PyPI
slackclientProvides Python interfaces to Slack's Web API…
permissive · top 5,000 on PyPI
aiogramaiogram is an asynchronous Python framework for…
permissive · top 5,000 on PyPI
TelethonTelethon is an asyncio-based Python library…
permissive · top 5,000 on PyPI
mleapSerializes and deserializes machine learning…
permissive · top 5,000 on PyPI
matrix-niomatrix-nio is an asyncio-based Python client…
unclear · top 5,000 on PyPI
vodozemacProvides Python bindings for vodozemac, a…
unclear · top 15,000 on PyPI
matrix-clientPython client library for connecting to and…
permissive · top 15,000 on PyPI
matrix-synapseMatrix Synapse is a homeserver implementation…
unclear · top 15,000 on PyPI
httpx-aiohttpProvides aiohttp-based transports for httpx,…
unclear · top 5,000 on PyPI
aionotionaionotion is an asyncio-friendly Python library…
permissive · top 15,000 on PyPI
aiohueAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
dj-rest-authProvides drop-in REST API endpoints for user…
permissive · top 5,000 on PyPI
unicryptoProvides a unified interface to cryptographic…
unclear · top 15,000 on PyPI
aioesphomeapiAsync Python client library for communicating…
permissive · top 5,000 on PyPI