Compatible with every major AI agent and IDE
What is the Matrix/Element MCP Server?
Connect your Matrix account to any AI agent and take full control of your decentralized communications through natural conversation.
What you can do
- Room Management — Create, join, knock, or leave rooms using simple commands like
create_roomandjoin_room. - Messaging & Events — Send messages or custom events to any room with transaction tracking via
send_message. - State Synchronization — Use
sync_clientto fetch the latest state from the homeserver and stay updated on all conversations. - User Discovery — Search the global user directory using
search_user_directoryto find and connect with others. - Account Control — Manage your profile, change passwords, or handle account registration and deactivation.
- Encryption & Keys — Handle cryptographic keys (
upload_keys,query_keys) for secure, end-to-end encrypted communication.
How it works
- Subscribe to this server
- Provide your Matrix Homeserver URL and Access Token
- Start orchestrating your chats from Claude, Cursor, or any MCP-compatible client
Who is this for?
- DevOps Engineers — automate alert rooms and incident response directly from the terminal.
- Privacy Advocates — maintain secure, decentralized communication without leaving your AI workflow.
- Community Managers — manage room states and user interactions across large Matrix networks.
Built-in capabilities (19)
Change the account password
Claim E2EE keys from the homeserver
Create a new Matrix room
Deactivate the current Matrix account
Download media from the homeserver
Get state events for a room
Join a Matrix room by ID or alias
Knock on a Matrix room to request access
Leave a Matrix room
Log in to a Matrix account
Log out of the current Matrix account
Query E2EE keys from the homeserver
Register a new Matrix account
Search the user directory
Send a message or event to a Matrix room
Set state events for a room
Synchronize client state with the homeserver
Upload E2EE keys to the homeserver
Upload media to the homeserver
Why Mastra AI?
Mastra's agent abstraction provides a clean separation between LLM logic and Matrix/Element tool infrastructure. Connect 19 tools through Vinkius and use Mastra's built-in workflow engine to chain tool calls with conditional logic, retries, and parallel execution. deployable to any Node.js host in one command.
- —
Mastra's agent abstraction provides a clean separation between LLM logic and tool infrastructure. add Matrix/Element without touching business code
- —
Built-in workflow engine chains MCP tool calls with conditional logic, retries, and parallel execution for complex automation
- —
TypeScript-native: full type inference for every Matrix/Element tool response with IDE autocomplete and compile-time checks
- —
One-command deployment to any Node.js host. Vercel, Railway, Fly.io, or your own infrastructure
Matrix/Element in Mastra AI
Matrix/Element and 4,000+ other MCP servers. One platform. One governance layer.
Teams that connect Matrix/Element to Mastra AI through Vinkius don't need to source, host, or maintain individual MCP servers. Every tool call runs inside a hardened runtime with credential isolation, DLP, and a signed audit chain.
Raw MCP | Vinkius | |
|---|---|---|
| Server catalog | Find and host yourself | 4,000+ managed |
| Infrastructure | Self-hosted | Sandboxed V8 isolates |
| Credential handling | Plaintext in config | Vault + runtime injection |
| Data loss prevention | None | Configurable DLP policies |
| Kill switch | None | Global instant shutdown |
| Financial circuit breakers | None | Per-server limits + alerts |
| Audit trail | None | Ed25519 signed logs |
| SIEM log streaming | None | Splunk, Datadog, Webhook |
| Honeytokens | None | Canary alerts on leak |
| Custom domains | Not applicable | DNS challenge verified |
| GDPR compliance | Manual effort | Automated purge + export |
Why teams choose Vinkius for Matrix/Element in Mastra AI
The Matrix/Element MCP Server runs on Vinkius-managed infrastructure inside AWS — a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts. All 19 tools execute in hardened sandboxes optimized for native MCP execution.
Your AI agents in Mastra AI only access the data you authorize, with DLP that blocks sensitive information from ever reaching the model, kill switch for instant shutdown, and up to 60% token savings. Enterprise-grade infrastructure, zero maintenance.

* Every MCP server runs on Vinkius-managed infrastructure inside AWS - a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts optimized for native MCP execution. See our infrastructure
How Vinkius secures
Matrix/Element for Mastra AI
Every tool call from Mastra AI to the Matrix/Element MCP Server is protected by DLP redaction, cryptographic audit chains, V8 sandbox isolation, kill switch, and financial circuit breakers.
Frequently asked questions
How do I see the latest messages in my rooms?
Use the sync_client tool. It synchronizes your local state with the homeserver, retrieving all new events, messages, and room state changes since your last sync.
Can I search for people on other Matrix servers?
Yes, the search_user_directory tool allows you to search the directory available to your homeserver, helping you find users by their display name or Matrix ID.
Is it possible to manage room settings like the topic or name?
Absolutely. Use set_room_state to update room metadata. You can change the room name, topic, or other state events by providing the correct event_type and body.
How does Mastra AI connect to MCP servers?
Create an MCPClient with the server URL and pass it to your agent. Mastra discovers all tools and makes them available with full TypeScript types.
Can Mastra agents use tools from multiple servers?
Yes. Pass multiple MCP clients to the agent constructor. Mastra merges all tool schemas and the agent can call any tool from any server.
Does Mastra support workflow orchestration?
Yes. Mastra has a built-in workflow engine that lets you chain MCP tool calls with branching logic, error handling, and parallel execution.
createMCPClient not exported
Install: npm install @mastra/mcp
Explore More MCP Servers
View all →
Clarifai (Vision AI)
6 toolsManage AI inference via Clarifai — list apps, models, and workflows, and perform computer vision predictions directly from any AI agent.

99Minutos Express
12 toolsCall physical couriers via AI using 99Minutos. Extract immediate Last-mile shipping quotes and trace vehicle checkpoints dynamically.

Persona
27 toolsManage identity verification workflows via Persona — handle inquiries, manage accounts, and inspect verifications directly from your AI agent.

Abstract API
6 toolsEnrich and verify data — audit geolocation, emails, and VAT via AI.
