Element MCP Server
Connects to Element/Matrix to list rooms, read messages, search message content, and view detailed room information from Matrix conversations.
Provides read-only access to Matrix accounts, enabling listing of joined rooms, retrieving messages from specific rooms, searching messages by content, and viewing room details.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Element MCP Server search for messages about 'project deadline' in my chats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Element MCP Server
An MCP (Model Context Protocol) server that connects Claude with Element. Read rooms, messages, and search content in your Matrix conversations.
🌐 También disponible en español más abajo / Spanish version below
What is this?
This server acts as a "bridge" between Claude and your Matrix account. Once configured, Claude can:
List your Matrix rooms
Read messages from any room
Search messages by content
View detailed room information
Related MCP server: google-chat-mcp
Prerequisites
Node.js 18+ installed
A Matrix account (e.g., on matrix.org or Element)
Your Matrix Access Token
Getting your Access Token
From Element Web/Desktop:
Open Element and go to Settings (gear icon)
Go to Help & About
In the advanced section, find Access Token
Copy the token (starts with something like
syt_...orMDAxO...)
⚠️ Important: Your access token is like a password. Don't share it publicly.
Installation
# Clone the repository
git clone https://github.com/rosquillas/matrix-mcp-server.git
cd matrix-mcp-server
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
Environment Variables
# Your Matrix homeserver (default: https://matrix.org)
MATRIX_HOMESERVER=https://matrix.org
# Your access token (REQUIRED)
MATRIX_ACCESS_TOKEN=your_token_here
# Transport type: 'stdio' or 'http' (default: stdio)
TRANSPORT=stdio
# Port for HTTP mode (default: 3000)
PORT=3000Usage
stdio mode (recommended for Claude Desktop)
MATRIX_ACCESS_TOKEN=your_token npm startHTTP mode (for remote use)
TRANSPORT=http MATRIX_ACCESS_TOKEN=your_token npm startClaude Desktop Configuration
Add this to your Claude Desktop config file:
Mac:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"matrix": {
"command": "node",
"args": ["/path/to/matrix-mcp-server/dist/index.js"],
"env": {
"MATRIX_HOMESERVER": "https://matrix.org",
"MATRIX_ACCESS_TOKEN": "your_token_here"
}
}
}
}Available Tools
matrix_list_rooms
List all rooms you've joined.
Parameters:
limit(optional): Maximum number of rooms (1-100, default: 20)
matrix_get_messages
Get messages from a specific room.
Parameters:
room_id(required): Room ID (e.g.,!abc123:matrix.org)limit(optional): Number of messages (1-100, default: 50)direction(optional):'b'for older,'f'for newer
matrix_search_messages
Search messages by content.
Parameters:
query(required): Text to searchroom_id(optional): Limit to a specific roomlimit(optional): Max results (1-50, default: 10)
matrix_get_room_info
Get detailed room information.
Parameters:
room_id(required): Room ID
Example Usage
Once configured, you can tell Claude:
"Show me my Matrix rooms"
"What was discussed yesterday in the development room?"
"Search for messages about 'deployment' in my chats"
Security
Access token is passed as environment variable, never stored in code
Only read operations (cannot send messages)
Server only communicates with your configured homeserver
Troubleshooting
"MATRIX_ACCESS_TOKEN environment variable is required"
Make sure to set the environment variable with your token.
"Matrix API error (401)"
Your token expired or is invalid. Generate a new one from Element.
"Matrix API error (403)"
You don't have permissions to access that room.
Versión en Español
¿Qué es esto?
Este servidor actúa como un "puente" entre Claude y tu cuenta de Matrix. Una vez configurado, Claude puede:
Ver tus salas de Matrix
Leer mensajes de cualquier sala
Buscar mensajes por contenido
Ver información detallada de las salas
Requisitos Previos
Node.js 18+ instalado
Una cuenta de Matrix (por ejemplo, en matrix.org o Element)
Tu Access Token de Matrix
Obtener tu Access Token
Desde Element Web/Desktop:
Abre Element y ve a Configuración (ícono de engrane)
Ve a Ayuda y Sobre (Help & About)
En la sección avanzada, encontrarás Access Token
Copia el token (empieza con algo como
syt_...oMDAxO...)
⚠️ Importante: Tu access token es como una contraseña. No lo compartas públicamente.
Instalación
# Clona el repositorio
git clone https://github.com/rosquillas/matrix-mcp-server.git
cd matrix-mcp-server
# Instala dependencias
npm install
# Compila el proyecto
npm run buildConfiguración con Claude Desktop
Agrega esto a tu archivo de configuración:
Mac:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"matrix": {
"command": "node",
"args": ["/ruta/a/matrix-mcp-server/dist/index.js"],
"env": {
"MATRIX_HOMESERVER": "https://matrix.org",
"MATRIX_ACCESS_TOKEN": "tu_token_aqui"
}
}
}
}License
MIT
Available Tools
4 toolsmatrix_get_messagesGet Matrix MessagesARead-onlyIdempotent
Retrieve messages from a specific Matrix room.
Use matrix_list_rooms first to get available room IDs.
Args:
room_id: The room ID to fetch messages from
limit: Maximum messages to return (1-100, default 50)
from: Pagination token for fetching more messages
direction: 'b' for older messages, 'f' for newer
Returns:
List of messages with sender, timestamp, and content
Pagination tokens for fetching more messages
Inputs: room_id (required), limit, from, direction.
matrix_get_room_infoGet Matrix Room InfoBRead-onlyIdempotent
Get detailed information about a specific Matrix room.
Returns room name, topic, members, and other state information.
Args:
room_id: The room ID to get info for
Returns:
Room name, topic, creation info, and member list
Inputs: room_id (required).
matrix_list_roomsList Matrix RoomsARead-onlyIdempotent
List all Matrix rooms that the user has joined.
Returns room IDs, names, and basic information about each room. Use this to discover which rooms are available before fetching messages.
Returns:
List of rooms with room_id, name, topic, and member count
Use room_id with matrix_get_messages to read messages
Inputs: limit.
matrix_search_messagesSearch Matrix MessagesARead-onlyIdempotent
Search for messages across Matrix rooms.
Search for specific content within messages. Can search all rooms or a specific room.
Args:
query: Text to search for in messages
room_id: Optional room ID to limit search scope
limit: Maximum results (1-50, default 10)
Returns:
Matching messages with room, sender, and content
Inputs: query (required), room_id, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: list_rooms discovers available rooms, get_room_info provides room metadata, get_messages retrieves message history, and search_messages performs content searches. The descriptions clearly differentiate these functions, making tool selection unambiguous for an agent.
All tools follow a perfect 'matrix_verb_noun' pattern with consistent snake_case throughout: matrix_list_rooms, matrix_get_room_info, matrix_get_messages, and matrix_search_messages. This predictable naming convention makes the tool set highly readable and organized.
Four tools is reasonable for a Matrix server, covering core room discovery, metadata retrieval, message reading, and search functionality. However, the absence of write operations (like sending messages or creating rooms) makes the count feel slightly lean for a complete Matrix integration, though still well-scoped for read-only use cases.
The tool set provides excellent read-only coverage for rooms and messages, but lacks any write capabilities (e.g., send_message, create_room, join_room) or room management operations (e.g., leave_room, update_room_info). This creates notable gaps that could limit agent workflows, though the existing tools form a coherent read-only surface.
Maintenance
Related MCP Connectors
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Read-only access to your own crypto portfolio across 11+ exchanges and 20+ chains: holdings, full history, FIFO cost basis and P&L, fees and income. Ask Claude or ChatGPT about your portfolio; the connector can never trade, move funds or act as a login.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Matrix, the open decentralized communication protocol, allowing them to send and read messages, manage rooms, and perform other Matrix operations through natural language.1619 PyPI3MIT
- AlicenseNot gradedqualityFmaintenanceConnects Claude to Google Chat for searching messages, spaces, and DMs, automatically resolving user IDs to real display names.MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to communicate with an OpenClaw bot via Matrix, allowing you to send messages and read replies using natural language.GPL 3.0
- AlicenseNot gradedqualityCmaintenanceConnects Claude to your personal Telegram and Slack accounts, letting it read real DMs, groups, channels, unread messages, and search chats, with optional sending enabled by the user.62 npmMIT