dendrite-admin-mcp
MCP server exposing Dendrite Matrix homeserver admin APIs as tools, enabling an LLM agent to manage users, rooms, registration tokens, send server notices, and more.
README
dendrite-admin-mcp
An MCP (Model Context Protocol) server that exposes Dendrite's admin API as tools, so an LLM agent can administer a Dendrite Matrix homeserver: manage users, evacuate/purge rooms, send server notices, manage registration tokens, and more.
Setup
npm install
cp .env.example .env # fill in DENDRITE_BASE_URL and DENDRITE_ADMIN_TOKEN
npm run build
Configuration
| Env var | Required | Purpose |
|---|---|---|
DENDRITE_BASE_URL |
yes | Base URL of the homeserver's client-facing port, e.g. https://matrix.example.com |
DENDRITE_ADMIN_TOKEN |
yes | Access token of a Dendrite server admin user; sent as a Bearer token to all /_dendrite/admin and most /_synapse/admin endpoints |
DENDRITE_REGISTRATION_SHARED_SECRET |
no | registration_shared_secret from dendrite.yaml; only needed for the register_user tool, which authenticates via HMAC instead of the admin token |
Transports
This server supports two MCP transports, selected via MCP_TRANSPORT:
stdio(default) — for a client that spawns this process directly (e.g. a local Claude Code / editor MCP config). No network exposure.http— runs a stateless Streamable HTTP MCP server onMCP_HTTP_HOST:MCP_HTTP_PORT(default0.0.0.0:3939), for remote clients over LAN/Tailscale. RequiresMCP_AUTH_TOKEN; every request to/mcpmust sendAuthorization: Bearer <token>. Generate one withopenssl rand -hex 32.
Running
npm run build && npm start
For local development with auto-reload:
npm run dev
To poke at the tools interactively (stdio transport):
npm run inspector
Running with Docker
cp .env.example .env # fill in DENDRITE_BASE_URL, DENDRITE_ADMIN_TOKEN,
# set MCP_TRANSPORT=http and MCP_AUTH_TOKEN
docker compose up -d --build
This builds the image, starts the container with restart: unless-stopped, and publishes port 3939. A /healthz endpoint (no auth required) backs the container healthcheck.
Tools
| Tool | Dendrite endpoint |
|---|---|
evacuate_room |
POST /_dendrite/admin/evacuateRoom/{roomID} |
purge_room |
POST /_dendrite/admin/purgeRoom/{roomID} |
download_room_state |
GET /_dendrite/admin/downloadState/{serverName}/{roomID} |
evacuate_user |
POST /_dendrite/admin/evacuateUser/{userID} |
reset_password |
POST /_dendrite/admin/resetPassword/{userID} |
refresh_devices |
POST /_dendrite/admin/refreshDevices/{userID} |
whois |
GET /_matrix/client/v3/admin/whois/{userId} |
register_user |
GET+POST /_synapse/admin/v1/register (shared-secret HMAC flow) |
list_registration_tokens / get_registration_token / create_registration_token / update_registration_token / delete_registration_token |
/_dendrite/admin/registrationTokens* |
send_server_notice |
POST /_synapse/admin/v1/send_server_notice |
fulltext_reindex |
GET /_dendrite/admin/fulltext/reindex |
purge_room and evacuate_* are irreversible/disruptive — see CLAUDE.md for guidance on when an agent should confirm before calling them.
Connecting a remote client (HTTP transport)
Once deployed with MCP_TRANSPORT=http, point a client at http://<host>:3939/mcp with
an Authorization: Bearer <MCP_AUTH_TOKEN> header. <host> can be a LAN IP or a
Tailscale IP/MagicDNS name — whichever the client can reach.
Claude Code:
claude mcp add --transport http dendrite-admin --scope user \
http://<host>:3939/mcp \
--header "Authorization: Bearer <MCP_AUTH_TOKEN>"
opencode (~/.config/opencode/opencode.jsonc for a user-wide server):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"dendrite-admin": {
"type": "remote",
"url": "http://<host>:3939/mcp",
"headers": { "Authorization": "Bearer <MCP_AUTH_TOKEN>" }
}
}
}
Codex CLI (~/.codex/config.toml):
[mcp_servers.dendrite-admin]
url = "http://<host>:3939/mcp"
bearer_token_env_var = "DENDRITE_ADMIN_MCP_TOKEN"
bearer_token_env_var names an environment variable Codex reads at startup —
export it in your shell profile, e.g. export DENDRITE_ADMIN_MCP_TOKEN=<MCP_AUTH_TOKEN>.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。