Matrix MCP server

Communitymjknowles (community)46Config last verified Jun 1, 2026

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.

Add to ~/.claude.json

~/.claude.json
json
{
  "mcpServers": {
    "matrix": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}
Or via CLI
bash
claude mcp add --transport http matrix http://localhost:3000/mcp

Heads up

  • First tool call opens a browser to authorize.

Available tools

ToolDescription
list-joined-roomsGet a list of all Matrix rooms the user has joined, with room names and IDs.
get-room-infoGet complete details and settings for a specific room.
get-room-membersList the members of a room.
get-room-messagesRetrieve recent messages from a room.
get-messages-by-dateRetrieve messages from a room within a specified date range.
identify-active-usersIdentify the most active users in a room by message volume.
get-all-usersList known users from the client cache.
get-user-profileRetrieve profile information for a given user.
get-my-profileRetrieve the authenticated user's own profile and statistics.
search-public-roomsSearch for public rooms available to join.
get-notification-countsCheck unread message and mention counts.
get-direct-messagesList and access direct-message conversations.
send-messageSend a text message to a room (supports text, HTML, and emotes).
send-direct-messageSend a direct message to a user.
join-roomJoin a room by ID or alias.
leave-roomLeave a room.
create-roomCreate a new Matrix room with configuration options.
invite-userInvite a user to a room.
set-room-nameUpdate a room's name.
set-room-topicUpdate 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.
← Browse all communication servers