Matrix MCP Server

MCP Server for a Matrix home server integration; chat, manage rooms, etc.

Local serverstdioTypeScript

What is the Matrix MCP server?

Matrix MCP server exists for a simple reason — assistants are far more useful when they can act on Matrix directly instead of describing what you should do. MCP Server for a Matrix home server integration; chat, manage rooms, etc.

What you get

A comprehensive Model Context Protocol (MCP) server that provides secure access to Matrix homeserver functionality. Built with TypeScript, this server enables MCP clients to interact with Matrix rooms, messages, users, and more through a standardized interface.

  • 🔐 OAuth 2.0 Authentication with token exchange support
  • 📱 15 Matrix Tools organized by functionality tiers
  • 🏠 Multi-homeserver Support with configurable endpoints
  • 🔄 Real-time Operations with ephemeral client management
  • 🚀 Production Ready with comprehensive error handling
  • 📊 Rich Responses with detailed Matrix data

What the assistant can call

Once Matrix is connected, these are the calls the assistant has available:

  • Prerequisites — The Prerequisites tool exposed by this server
  • Installation — The Installation tool exposed by this server

Configuration and credentials

You will need 8 environment variables: SSL_KEY_PATH, SSL_CERT_PATH, IDP_ISSUER_URL, IDP_AUTHORIZATION_URL, IDP_TOKEN_URL, OAUTH_CALLBACK_URL, MATRIX_HOMESERVER_URL, MATRIX_CLIENT_ID. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Node.js 20+ and npm - Matrix homeserver access (Synapse, Dendrite, etc.) - MCP client (Claude Desktop, VS Code with MCP extension, etc.)

Setting it up

@modelcontextprotocol/inspector on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Choosing this one

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Matrix's toolset — Prerequisites, Installation — is a fair guide to whether it matches your workflow. It is maintained by mjknowles; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the matrix mcp server does with a few real requests.

Available tools

ToolWhat it does
PrerequisitesThe Prerequisites tool exposed by this server.
InstallationThe Installation tool exposed by this server.

How to install the Matrix MCP server

{
  "mcpServers": {
    "matrix": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/inspector"],
      "env": {
        "SSL_KEY_PATH": "your-value",
        "SSL_CERT_PATH": "your-value",
        "IDP_ISSUER_URL": "your-value",
        "IDP_AUTHORIZATION_URL": "your-value",
        "IDP_TOKEN_URL": "your-value",
        "OAUTH_CALLBACK_URL": "your-value",
        "MATRIX_HOMESERVER_URL": "your-value",
        "MATRIX_CLIENT_ID": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Node.js 20+ and npm - Matrix homeserver access (Synapse, Dendrite, etc.) - MCP client (Claude Desktop, VS Code with MCP extension, etc.)
VariableDescriptionRequired
SSL_KEY_PATHCredential the server authenticates with.Yes
SSL_CERT_PATHFilesystem location the server is allowed to use.Optional
IDP_ISSUER_URLEndpoint or connection string the server talks to.Yes
IDP_AUTHORIZATION_URLEndpoint or connection string the server talks to.Yes
IDP_TOKEN_URLCredential the server authenticates with.Yes
OAUTH_CALLBACK_URLEndpoint or connection string the server talks to.Yes
MATRIX_HOMESERVER_URLEndpoint or connection string the server talks to.Yes
MATRIX_CLIENT_IDConfiguration value read at startup.Optional

Example prompts to try

  • Use Matrix to Prerequisites.
  • Use Matrix to Installation.

Frequently asked questions

OAuth mode uses full OAuth 2.0 integration with your identity provider, supports token exchange for Matrix homeserver authentication, and is recommended for production deployments.