mcp-server-matrix
Provides tools for interacting with Matrix homeservers, enabling sending and reading messages, managing rooms, inviting users, and retrieving room and user information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-matrixread the last 10 messages in #announcements"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-matrix
A Model Context Protocol (MCP) server for Matrix — the open, decentralized communication protocol.
Built on matrix-nio, this server lets any MCP-compatible AI assistant (Claude, OpenClaw, etc.) send and read messages, manage rooms, and interact with any Matrix homeserver (Synapse, Dendrite, Conduit).
Features
Tool | Description |
| Send a message (text, HTML, or Markdown) with optional reply |
| Read recent messages (with pagination) |
| Get messages filtered by date range |
| List all joined rooms |
| Room details — name, topic, members, encryption status |
| List joined members with display names and avatars |
| Unread and mention counts per room |
| List DM conversations with unread status |
| Send a DM (auto-creates room if needed) |
| User profile — display name, avatar |
| Join a room by ID or alias |
| Leave a room |
| Create a new room (with optional invites) |
| Invite a user to a room |
| React to a message with an emoji |
| Resolve |
Installation
pip install mcp-server-matrixOr with uv:
uvx mcp-server-matrixConfiguration
Set environment variables:
Variable | Required | Description |
| Yes | Homeserver URL (e.g. |
| Yes | Full user ID (e.g. |
| Yes* | Account password |
| Yes* | Access token (alternative to password) |
| No | Path for nio session store (default: |
| No | Log level: DEBUG, INFO, WARNING, ERROR (default: INFO) |
* Provide either MATRIX_PASSWORD or MATRIX_ACCESS_TOKEN.
Usage
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"matrix": {
"command": "mcp-server-matrix",
"env": {
"MATRIX_HOMESERVER": "https://matrix.example.com",
"MATRIX_USER": "@bot:example.com",
"MATRIX_PASSWORD": "your-password"
}
}
}
}Claude Code
{
"mcpServers": {
"matrix": {
"command": "mcp-server-matrix",
"env": {
"MATRIX_HOMESERVER": "https://matrix.example.com",
"MATRIX_USER": "@bot:example.com",
"MATRIX_ACCESS_TOKEN": "syt_..."
}
}
}
}OpenClaw
Add to openclaw.json:
{
"mcp": {
"servers": {
"matrix": {
"command": "mcp-server-matrix",
"env": {
"MATRIX_HOMESERVER": "https://matrix.example.com",
"MATRIX_USER": "@bot:example.com",
"MATRIX_PASSWORD": "your-password"
}
}
}
}
}Direct (stdio)
export MATRIX_HOMESERVER=https://matrix.example.com
export MATRIX_USER=@bot:example.com
export MATRIX_PASSWORD=your-password
mcp-server-matrixExamples
Once connected, your AI assistant can:
Read messages: "What are the latest messages in #general?"
Send messages: "Send 'Hello everyone!' to #announcements"
Manage rooms: "Create a room called 'Project X' and invite @alice:matrix.org"
Get info: "How many members are in #team-chat?"
Supported Homeservers
Tested with:
Synapse (reference implementation)
Should work with any spec-compliant homeserver (Dendrite, Conduit, etc.)
Requirements
Python 3.10+
A Matrix account on any homeserver
Network access to the homeserver
License
MIT
Links
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Baho73/mcp-server-matrix'
If you have feedback or need assistance with the MCP directory API, please join our Discord server