matrix-mcp-server
by mjknowles·★ 44·Score 42
Matrix MCP Server provides secure OAuth 2.0 authentication and 15 tools for Matrix home server integration with room management, messaging, and user profile operations.
Overview
The Matrix MCP Server is a comprehensive TypeScript implementation that enables secure interaction with Matrix homeserver functionality. It provides both read-only and action tools organized in tiers, allowing clients to list rooms, retrieve messages, manage user profiles, create and join rooms, and send messages with proper authentication. The server supports OAuth 2.0 with token exchange for production deployments and offers development mode for testing. The architecture follows a clean three-layer design with HTTP, MCP, and Matrix layers, ensuring secure ephemeral client management and proper permission checks.
Try asking AI
After installing, here are 6 things you can ask your AI assistant:
When to choose this
Choose this server if you need AI integration with Matrix communication protocols and want to automate room management, messaging, and user interactions within a Matrix ecosystem.
When NOT to choose this
Don't choose this if you need support for non-Matrix chat platforms or if you're looking for a solution that doesn't require OAuth configuration for production deployments.
Tools this server exposes
12 tools extracted from the READMElist-joined-roomsGet all rooms the user has joined
get-room-inforoomId: stringGet detailed information about a specific room
get-room-messagesroomId: string, limit?: numberRetrieve recent messages from a room
get-user-profiletargetUserId: stringGet profile information for any Matrix user
search-public-roomssearchTerm?: string, server?: string, limit?: numberDiscover public Matrix rooms to join
send-messageroomId: string, message: string, messageType?: 'text' | 'html' | 'emote', replyToEventId?: stringSend messages to Matrix rooms
create-roomroomName: string, isPrivate?: boolean, topic?: string, inviteUsers?: string[], roomAlias?: stringCreate new Matrix rooms with customizable settings
join-roomroomIdOrAlias: stringJoin Matrix rooms by ID or alias
leave-roomroomId: string, reason?: stringLeave a Matrix room with optional reason
invite-userroomId: string, targetUserId: stringInvite a user to a Matrix room
set-room-nameroomId: string, roomName: stringUpdate the display name of a Matrix room
set-room-topicroomId: string, topic: stringUpdate the topic/description of a Matrix room
Comparable tools
Installation
Installation
Prerequisites
- Node.js 20+ and npm
- Matrix homeserver access (Synapse, Dendrite, etc.)
- MCP client (Claude Desktop, VS Code with MCP extension, etc.)
Steps
# Clone the repository
git clone <repository-url>
cd matrix-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Start the server
npm startClaude Desktop Integration
{
"mcpServers": {
"matrix": {
"command": "node",
"args": ["dist/server.js"],
"env": {
"ENABLE_OAUTH": "true",
"MATRIX_HOMESERVER_URL": "https://matrix.example.com"
}
}
}
}FAQ
- What authentication methods does this MCP server support?
- The server supports OAuth 2.0 with token exchange for production deployments and direct access without OAuth for development. OAuth mode is recommended for production deployments as it prevents direct Matrix token exposure.
- How do I handle multiple Matrix homeservers?
- The server supports multi-homeserver configuration through environment variables. You can configure different endpoints and set up appropriate authentication for each homeserver.
- Can I use this MCP server with any Matrix implementation?
- Yes, the server is designed to work with any Matrix homeserver implementation including Synapse, Dendrite, and others. It communicates with the homeserver using the standard Matrix client-server API.
Compare matrix-mcp-server with
Last updated · Auto-generated from public README + GitHub signals.