Matrix

v1.0.0Communicationstable

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

homeservermatrixmatrix-homeservermatrix-mcpmcp
Share:
45
Stars
0
Downloads
0
Weekly
0/5

What is Matrix?

Matrix is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for a matrix home server integration; chat, manage rooms, etc.

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

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP Server for a Matrix home server integration; chat, manag

Use Cases

Chat and manage Matrix homeserver rooms via AI
Enable messaging integration in AI agents
mjknowles

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx matrix

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Matrix

Matrix MCP Server is a TypeScript server that bridges AI assistants to a Matrix homeserver, exposing 20 tools for reading and sending messages, managing rooms, inviting users, and querying member activity. It supports both read-only Tier 0 tools (list rooms, get messages, search public rooms, count notifications) and action Tier 1 tools (send messages, create rooms, join/leave, set room names and topics), with optional OAuth and token exchange for secure authentication. Teams use it to let their AI assistant participate in Matrix chat, monitor channels, and automate room administration.

Prerequisites

  • Node.js 20 or higher with npm
  • Access to a Matrix homeserver (Synapse, Dendrite, or compatible)
  • A Matrix user account with an access token or OAuth credentials
  • An MCP-compatible client such as Claude Desktop or Claude Code
  • Optional: SSL certificates for HTTPS mode
1

Clone and install dependencies

Clone the matrix-mcp-server repository and install npm dependencies.

git clone https://github.com/mjknowles/matrix-mcp-server.git
cd matrix-mcp-server
npm install
2

Copy and configure environment file

Copy the example environment file and configure your Matrix homeserver URL, domain, and OAuth/auth settings.

cp .env.example .env
# Edit .env with your values:
# MATRIX_HOMESERVER_URL=https://matrix.example.com
# MATRIX_DOMAIN=example.com
# MATRIX_CLIENT_ID=your_client_id
# MATRIX_CLIENT_SECRET=your_client_secret
# PORT=3000
# ENABLE_OAUTH=false
3

Build the server

Compile the TypeScript source to JavaScript.

npm run build
4

Start the server

Start the MCP server. It listens for HTTP connections by default on the configured PORT.

npm start

# Development mode with hot reload:
npm run dev
5

Connect your MCP client via HTTP transport

Add the server to Claude Code using HTTP transport, passing your Matrix user ID and homeserver URL as headers.

claude mcp add --transport http matrix-server http://localhost:3000/mcp \
  -H "matrix_user_id: @youruser:example.com" \
  -H "matrix_homeserver_url: https://matrix.example.com"
6

Verify with MCP Inspector

Test the server connection using the MCP Inspector tool before using it with Claude.

npx @modelcontextprotocol/inspector
# Connect to: http://localhost:3000/mcp

Matrix Examples

Client configuration

Environment file configuration for Matrix MCP Server with a Synapse homeserver.

{
  "mcpServers": {
    "matrix-server": {
      "command": "node",
      "args": ["/path/to/matrix-mcp-server/dist/index.js"],
      "env": {
        "MATRIX_HOMESERVER_URL": "https://matrix.example.com",
        "MATRIX_DOMAIN": "example.com",
        "PORT": "3000",
        "ENABLE_OAUTH": "false"
      }
    }
  }
}

Prompts to try

Example prompts to interact with your Matrix homeserver through the MCP server.

- "List all the Matrix rooms I've joined"
- "Get the last 20 messages from the #general room"
- "Send a message to #announcements: 'Deployment complete'"
- "Create a new Matrix room called 'project-alpha' and invite @alice:example.com"
- "Who are the most active users in #dev this week?"
- "Search for public Matrix rooms about open source"
- "Show me my unread notification count across all rooms"

Troubleshooting Matrix

Server starts but tools return 'unauthorized' errors

Pass the matrix_user_id and matrix_homeserver_url headers with each request, or set MATRIX_HOMESERVER_URL in .env. If using token exchange, verify MATRIX_CLIENT_ID and MATRIX_CLIENT_SECRET are correct and the OAuth provider is reachable.

npm run build fails with TypeScript errors

Ensure you are using Node.js 20 or higher (`node --version`). Run `npm install` to ensure all type definitions are installed, then retry `npm run build`.

Claude Code cannot connect to the server at localhost:3000

Verify the server is running with `curl http://localhost:3000/mcp`. Check that PORT in .env matches the URL you're connecting to. If running behind a firewall or in Docker, ensure the port is exposed and accessible from where Claude Code is running.

Frequently Asked Questions about Matrix

What is Matrix?

Matrix is a Model Context Protocol (MCP) server that mcp server for a matrix home server integration; chat, manage rooms, etc. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Matrix?

Follow the installation instructions on the Matrix GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Matrix?

Matrix works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Matrix free to use?

Yes, Matrix is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "matrix": { "command": "npx", "args": ["-y", "matrix"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Matrix?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides