Atlas / MCP servers / mjknowles / Matrix

MatrixBLOCK

mcp/mjknowles/matrix

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

Verdict
BLOCK
Grade
D
Trust score
69 /100
Exposed tools
20 15r · 5w · 0d
Transport
streamable-http
License
MIT
Stars
52
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

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.

Features

  • 🔐 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

Quick Start

Prerequisites

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

Installation

# Clone the repository
git clone 
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 start

Development Mode

# Start with hot reload (OAuth disabled for easier testing)
npm run dev

# Or start with OAuth enabled
ENABLE_OAUTH=true npm run dev

Available Tools

📖 Tier 0: Read-Only Tools

Room Tools

  • `list-joined-rooms` - Get all rooms the user has joined
  • No parameters required
  • Returns room names, IDs, and member counts
  • `get-room-info` - Get detailed room information
  • roomId (string): Matrix room ID (e.g., !roomid:domain.com)
  • Returns name, topic, settings, creator, and member count
  • `get-room-members` - List all members in a room
  • roomId (string): Matrix room ID
  • Returns display names and user IDs of joined members

Message Tools

  • `get-room-messages` - Retrieve recent messages from a room
  • roomId (string): Matrix room ID
  • limit (number, default: 20): Maxim
Read from source at commit 152607b1bc05OBSERVED · 2026-10-08
Advertisement
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add matrix-mcp-server --env ENABLE_OAUTH=${ENABLE_OAUTH} --env ENABLE_TOKEN_EXCHANGE=${ENABLE_TOKEN_EXCHANGE} --env IDP_AUTHORIZATION_URL=${IDP_AUTHORIZATION_URL} --env IDP_TOKEN_URL=${IDP_TOKEN_URL} -- npx -y [email protected]
claude-desktop
{
  "mcpServers": {
    "matrix-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "ENABLE_OAUTH": "${ENABLE_OAUTH}",
        "ENABLE_TOKEN_EXCHANGE": "${ENABLE_TOKEN_EXCHANGE}",
        "IDP_AUTHORIZATION_URL": "${IDP_AUTHORIZATION_URL}",
        "IDP_TOKEN_URL": "${IDP_TOKEN_URL}"
      }
    }
  }
}
03

Exposed tools (20)

15 read · 5 write · 0 destructive.

ToolRiskDescription
create-roomwrite
get-all-usersread
get-direct-messagesread
get-messages-by-dateread
get-my-profileread
get-notification-countsread
get-room-inforead
get-room-membersread
get-room-messagesread
get-user-profileread
identify-active-usersread
invite-userread
join-roomread
leave-roomread
list-joined-roomsread
search-public-roomsread
send-direct-messagewrite
send-messagewrite
set-room-namewrite
set-room-topicwrite
04

Trust audit

BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeFAIL
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (5 observation(s))
Network
declared (8 observation(s))
Shell
none-observed
Dependencies
not all pinned
Secrets in source
none-found

Findings (13)

HIGHNetwork egress · net.tls_off · CWE-200, CWE-319
src/auth/tokenExchange.ts:60
agent: new https.Agent({ rejectUnauthorized: false }), // For local development with self-signed certs
Why it matters. certificate verification is disabled
Fix. leave verification on
HIGHNetwork egress · net.tls_off · CWE-200, CWE-319
src/auth/verifyAccessToken.ts:12
requestAgent: new https.Agent({ rejectUnauthorized: false }),
Why it matters. certificate verification is disabled
Fix. leave verification on
HIGHNetwork egress · net.tls_off · CWE-200, CWE-319
src/auth/verifyAccessToken.ts:45
agent: new https.Agent({ rejectUnauthorized: false }),
Why it matters. certificate verification is disabled
Fix. leave verification on
HIGHNetwork egress · net.tls_off · CWE-200, CWE-319
src/matrix/client.ts:73
const agent = new https.Agent({ rejectUnauthorized: false });
Why it matters. certificate verification is disabled
Fix. leave verification on
MEDIUMInformation disclosure · disclose.log_secret · CWE-209, CWE-532
src/auth/tokenExchange.ts:48
console.log(`Performing token exchange with IDP at ${tokenUrl}`);
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/tools/tier0/messages.ts:3
import { createConfiguredMatrixClient, getAccessToken, getMatrixContext } from "../../utils/server-helpers.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/tools/tier0/messages.ts:4
import { removeClientFromCache } from "../../matrix/client.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/tools/tier0/messages.ts:5
import { processMessage, processMessagesByDate, countMessagesByUser } from "../../matrix/messageProcessor.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/tools/tier0/messages.ts:6
import { ToolRegistrationFunction } from "../../types/tool-types.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/tools/tier0/notifications.ts:3
import { createConfiguredMatrixClient, getAccessToken, getMatrixContext } from "../../utils/server-helpers.js";
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
package.json
@modelcontextprotocol/sdk, cors, dotenv, express, jsonwebtoken, jwks-rsa, matrix-js-sdk, node-fetch
Why it matters. 20 dependency range(s) float
Fix. pin exact versions or ship a lockfile
LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
CLAUDE.md:120
- `ENABLE_TOKEN_EXCHANGE`: Set to "true" to exchange the access token used to access this MCP server for one from the Matrix client in your IdP (assuming both this mcp server and your homeserver share
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
INFOPrompt injection · prompt.authority_framing · CWE-94, CWE-1427
docs/matrix-mcp-test-plan.md:215
- User has 2 joined rooms with full access

Gates applied: no_behavioural_pass.

Audited 2026-10-08 · audit v0.4.1 · source sha 152607b1bc05full audit observations/trust-audit/mcp-server/mjknowles__matrix.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-08152607b1bc05BLOCKD69first audit
06

Questions

What is the Matrix MCP server?

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

What tools does Matrix expose?

20 in total: 15 read-only, 5 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.

Is Matrix safe to connect to an agent?

No — not without reading the findings first. The audit graded it D (69/100) and found 4 critical or high issues in the source. Each one is listed on this page with the file and line it is on.

What credentials does Matrix need?

It reads ENABLE_OAUTH, ENABLE_TOKEN_EXCHANGE, IDP_AUTHORIZATION_URL, IDP_TOKEN_URL, MATRIX_CLIENT_SECRET, OAUTH_CALLBACK_URL, OAUTH_SCOPES_SUPPORTED and SSL_KEY_PATH from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does Matrix run?

It speaks streamable-http, so it runs as a service you connect to over the network. It is published on npm as matrix-mcp-server at 1.0.0.

How current is this page?

The grade is for one exact copy of the source (152607b1bc05), read on 2026-10-08. The repository is watched and re-audited when it changes.

Advertisement