skillfed

mautrix

A Python 3 asyncio Matrix framework.

mautrix v0.21.1 973.5K downloads/30d#4,603 on PyPI251
Copyleft license Active released

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 mautrix

uv

uv add mautrix

poetry

poetry add mautrix

Installing 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

Development Status :: 4 - BetaFramework :: AsyncIOLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Communications :: Chat

Tags

matrix protocol python clientasyncio matrix frameworkmatrix appservice frameworkmatrix bridge buildermatrix e2e encryption pythonmatrix chat client librarymatrix homeserver integration
matrix-protocolasyncioe2e-encryption

More Chat packages