Matrix MCP server
A self-hosted MCP server for Matrix homeservers that lets agents read rooms and messages, send chats, and manage rooms over HTTP with OAuth.
Matrix MCP is a community server that connects AI assistants to a Matrix homeserver (such as Synapse) so an agent can participate in decentralized, open chat. Its 20 tools are split into a read-only tier and an action tier. The read tier lists joined rooms, fetches room info and members, pulls recent messages or messages within a date range, identifies active users, reads notification counts, lists direct messages, looks up your own and other users' profiles, lists known users, and searches public rooms. The action tier sends messages and direct messages, joins and leaves rooms, creates rooms, invites users, and sets a room's name and topic. That makes it a fit for chat copilots, room moderation helpers, and digest bots on self-hosted Matrix.
The server is a TypeScript project you clone and build, then run as an HTTP server (default http://localhost:3000/mcp). It supports full OAuth 2.0 when ENABLE_OAUTH is set, and a development mode that accepts a Matrix access token via header. Configure it with your homeserver URL and domain. Because it is community-built, review the source and run it against a homeserver you control.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Available tools
| Tool | Description |
|---|---|
| list-joined-rooms | Get a list of all Matrix rooms the user has joined, with room names and IDs. |
| get-room-info | Get complete details and settings for a specific room. |
| get-room-members | List the members of a room. |
| get-room-messages | Retrieve recent messages from a room. |
| get-messages-by-date | Retrieve messages from a room within a specified date range. |
| identify-active-users | Identify the most active users in a room by message volume. |
| get-all-users | List known users from the client cache. |
| get-user-profile | Retrieve profile information for a given user. |
| get-my-profile | Retrieve the authenticated user's own profile and statistics. |
| search-public-rooms | Search for public rooms available to join. |
| get-notification-counts | Check unread message and mention counts. |
| get-direct-messages | List and access direct-message conversations. |
| send-message | Send a text message to a room (supports text, HTML, and emotes). |
| send-direct-message | Send a direct message to a user. |
| join-room | Join a room by ID or alias. |
| leave-room | Leave a room. |
| create-room | Create a new Matrix room with configuration options. |
| invite-user | Invite a user to a room. |
| set-room-name | Update a room's name. |
| set-room-topic | Update a room's topic or description. |
Required configuration
- MATRIX_HOMESERVER_URLRequired
Your Matrix homeserver endpoint.
- MATRIX_DOMAINRequired
Your Matrix homeserver domain.
- ENABLE_OAUTHOptional
Set to true to enable OAuth 2.0; otherwise dev mode accepts a Matrix access token via header.
- PORTOptional
HTTP port the server listens on (default 3000).
What you can do with it
Self-hosted chat copilot
On a private Synapse homeserver, an agent reads recent room messages and replies on your behalf, keeping the conversation on infrastructure you control.
Room moderation and digests
The agent identifies the most active users, reads messages within a date range, and posts a summary or sets a room topic to keep a community organized.
FAQ
- Is it official?
- No. Matrix MCP is a community project (mjknowles), not published by Matrix.org. Review the source and run it against a homeserver you control before pointing agents at it.
- Does it support remote/OAuth?
- Yes. It runs as an HTTP server (default http://localhost:3000/mcp) and supports OAuth 2.0 when ENABLE_OAUTH is set, plus a development mode that accepts a Matrix access token via header.
- Can it send messages, not just read?
- Yes. Alongside read tools it can send messages and DMs, create and join rooms, invite users, and set a room's name and topic, so scope the bot account's permissions accordingly.