Matrix
MCP Server for a Matrix home server integration; chat, manage rooms, etc.
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
Maintainer
Works with
Installation
Manual Installation
npx matrixConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 installCopy 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=falseBuild the server
Compile the TypeScript source to JavaScript.
npm run buildStart 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 devConnect 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"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/mcpMatrix 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.
Matrix Alternatives — Similar Communication Servers
Looking for alternatives to Matrix? Here are other popular communication servers you can use with Claude, Cursor, and VS Code.
Slack
★ 86.1kEnables interaction with Slack workspaces through comprehensive channel management, messaging, user management, file uploads, and Block Kit formatting. Features secure credential storage via macOS Keychain and supports all major Slack operations incl
LibreChat
★ 37.3kEnhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenA
Note Gen
★ 11.9kA cross-platform Markdown AI note-taking software.
DeepChat
★ 5.8k🐬DeepChat - A smart assistant that connects powerful AI to your personal world
WhatsApp MCP
★ 5.7kConnects AI assistants to the official Meta WhatsApp Cloud API for managing conversations and sending various message types through natural language. It provides tools for media management, template messages, and real-time webhook processing without
Apple
★ 3.1kEnables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
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.
Set Up Matrix in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.