matrix-mcp-server
@guan-tends/matrix-mcp-server
Matrix 채팅 작업을 호출 가능한 도구로 노출하는 독립형 MCP(Model Context Protocol) 도구 서버입니다. 모든 MCP 호환 클라이언트 — AI 에이전트, 자동화 파이프라인, 개발자 도구 — 는 이러한 도구를 사용하여 메시지 전송, 방 관리, 이름 확인, Matrix 프로토콜 상호작용을 수행할 수 있습니다.
@vector-im/matrix-bot-sdk 기반으로 구축되었으며 완전한 E2EE(종단간 암호화)를 지원합니다.
기능
15개의 MCP 도구 — 메시징, 방 관리, 사용자 관리, 지능형 ID 확인
E2EE 지원 — Rust 암호화 백엔드를 통한 완전한 Megolm 암호화
사람 친화적인 이름 확인 — 불투명한 ID 대신 이름으로 방과 사용자 참조
별칭 시스템 — 서버에 사용자 정의 단축키 학습 가능 (예:
"eng"→"!abc123:matrix.org")독립형 HTTP 서버 — 독립적으로 실행되며, HTTP를 통해 모든 MCP 클라이언트 연결 가능
크론 없음, LLM 없음 — 순수 도구 서버. 일정 관리와 지능은 에이전트 계층에 있음
Related MCP server: ottoauthMCP
설치
npm install @guan-tends/matrix-mcp-server요구 사항
Node.js >= 22.0.0
액세스 토큰이 있는 Matrix 계정
빠른 시작
1. 클론 및 구성
git clone https://github.com/guan-tends/matrix-mcp-server.git
cd matrix-mcp-server
npm install
cp config.example.json5 config.json5Matrix 자격 증명으로 config.json5을 편집하세요:
{
homeserverUrl: "https://matrix.org",
accessToken: "syt_...",
serverName: "matrix.org",
port: 3456,
host: "0.0.0.0",
storePath: "./data/store.json",
cryptoPath: "./data/crypto",
}2. 실행
npm start서버는 http://0.0.0.0:3456에서 수신 대기하며 HTTP를 통해 MCP 프로토콜 요청을 수락합니다.
3. MCP 클라이언트 연결
모든 MCP 호환 클라이언트를 서버에 연결하세요:
{
"mcpServers": {
"matrix": {
"url": "http://localhost:3456"
}
}
}또는 다중 서버 도구 구성을 위해 @guan-tends/mcp-ai 애그리게이터와 함께 사용하세요.
구성
파일 기반
config.json5을 편집하세요 (모든 옵션은 config.example.json5 참조).
환경 변수
모든 구성 값은 환경 변수로 설정할 수 있습니다 (최우선 순위):
변수 | 구성 키 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
도구 (15개)
메시징
도구 | 설명 |
| 방에 텍스트 전송 (ID 또는 확인된 이름으로) |
| HTML 형식 메시지 전송 |
| 메시지에 이모지로 반응 |
| 직접 메시지 전송 (필요시 암호화된 DM 생성) |
방 관리
도구 | 설명 |
| ID 또는 별칭으로 방 참여 |
| 방 나가기 |
| 참여 중인 모든 방 나열 |
| 방에서 최근 메시지 가져오기 |
사용자 관리
도구 | 설명 |
| 사용자의 현재 상태 가져오기 |
| 사용자를 방에 초대 |
| 사용자를 방에서 추방 |
ID 확인
도구 | 설명 |
| 서버에 방 별칭 학습 (예: |
| 서버에 사용자 별칭 학습 (예: |
| 방 이름을 신뢰 점수와 함께 Matrix ID로 확인 |
| 사용자 이름을 신뢰 점수와 함께 Matrix ID로 확인 |
확인 전략
확인자는 신뢰 점수를 사용한 하이브리드 접근 방식을 사용합니다:
사용자 별칭 (신뢰도: 1.0) — 사용자 정의 매핑
정확한 일치 (신뢰도: 0.9) — 정확한 표시 이름 또는 표준 별칭
부분 일치 (신뢰도: 0.7) — 부분 이름 일치
모호성 (신뢰도: 0.5) — 여러 일치 항목, 후보 반환
아키텍처
┌─────────────────────────┐
│ index.js │
│ (composition root) │
└──────────┬──────────────┘
│ wires
┌────────────────┼────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ MatrixClient │ │ AliasStore │ │ McpDataStore │
│ (bot-sdk) │ │ (aliases) │ │ (DM cache) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
└────────┬────────┘ │
▼ │
┌──────────────────┐ │
│ MatrixIdResolver │◄────────────────┘
└────────┬─────────┘
│
▼
┌──────────────────┐
│ mcp-server.js │── MCP SDK SimpleServer
│ (15 tools) │── HTTP transport
└──────────────────┘구성 루트 IoC: index.js가 모든 의존성을 연결합니다. 어떤 모듈도 다른 모듈의 의존성을 가져오지 않습니다. 각 모듈은 독립적으로 테스트 가능합니다.
설계 결정
구성 루트 IoC —
index.js가 모든 의존성을 연결합니다. 모듈 간 교차 가져오기가 없습니다.최소 AliasStore — 방/사용자 별칭 관리에 필요한 메서드는 4개뿐입니다.
간단한 JSON 영속성 —
persist.js가 로드/저장을 처리합니다. 데이터 파일 2개.withErrorHandling래퍼 — 모든 도구에서 반복되는 try/catch를 DRY로 처리합니다.크론 없음, LLM 없음, 봇 없음 — 순수 MCP 도구 서버. 에이전트가 자체 일정을 관리합니다.
테스트
# All tests (unit + E2E)
npm test
# Watch mode
npm run test:watch
# With coverage
npm run test:coverage65개 테스트 — 6개 파일 (단위 5개, E2E 1개).
프로젝트 구조
src/
├── index.js — Composition root: config → Matrix client → wire → start
├── mcp-server.js — 15 MCP tools + helpers (withErrorHandling, resolveRoomInput, etc.)
├── matrix-id-resolver.js — Room/user name → Matrix ID resolution
├── alias-store.js — Minimal per-user alias storage
├── mcp-data-store.js — DM room ID cache
└── persist.js — Simple JSON load/save utility
__tests__/
├── unit/ — Unit tests (alias-store, mcp-data-store, resolver, mcp-server, persist)
├── e2e/ — E2E test (full server start → MCP client → tool calls)
├── mocks/ — Mock MatrixClient for testing
└── vitest.config.js후원
이 프로젝트가 유용하다면 개발을 지원해 주세요:
Solana:
Eu8wQcW68TKMs1a6eqzZu8znzU52QLqQugAMG8uCD6y6EVM (Ethereum / Base / Arbitrum / Optimism / Polygon):
0x2733ff7c865C56d565a99BE1DC11B81cc76850A5XRP Ledger:
r4X6e7McAQj7e8vBCeued1RYu4mCJrREDG
라이선스
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA self-hostable MCP server that turns a folder of skills into callable tools via MCP and REST APIs.2MIT
- FlicenseNot gradedqualityDmaintenanceStandalone MCP server that proxies tool calls to Ottoauth HTTP endpoints, enabling account creation and dynamic service interaction.
- FlicenseNot gradedqualityDmaintenanceMCP server for Rocket.Chat, enabling AI agents to interact with Rocket.Chat workspaces via tools like listing users, sending messages, and managing channels.2
- AlicenseNot gradedqualityCmaintenanceMCP server for Matrix that lets Claude list rooms, search/read messages, send messages and files, react, create rooms, and invite users, with multi-homeserver support and safe-by-default writes; no end-to-end encryption.MIT
Related MCP Connectors
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/guan-tends/matrix-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server