woow_emqx_mcp_server
MCP server for EMQX that exposes 39 tools across 7 categories for managing clusters, clients, topics, messaging, access control, diagnostics, and data integration, with a web GUI and layered safety controls.
README
woow_emqx_mcp_server
MCP server, Admin console and reverse proxy for EMQX, packaged the same way
as woow_n8n_mcp_server:
one container, one port, a web GUI in front of it.
39 tools across 7 categories, each individually switchable from the GUI.
Why this exists
The n8n bundle wraps a third-party MCP server (n8n-mcp from npm). EMQX has no
equivalent worth wrapping:
| Candidate | Verdict |
|---|---|
emqx/emqx-mcp-server |
Does not exist — the URL 404s |
Benniu/emqx-mcp-server |
5 tools, stdio only, every parameter is an opaque dict so the model has to guess field names |
| EMQX official MCP repos | All "MCP over MQTT" — MQTT as a transport for MCP, the opposite problem |
rodrigo-abena/emqx-admin-mcp |
22 tools but unmaintained and unverified; useful only as a tool-list reference |
So this repo also contains the MCP server itself, written against
FastMCP 3.4.5 (PrefectHQ/fastmcp — note the project moved from
jlowin/fastmcp, and most tutorials online still describe 2.x).
Architecture
AI client (Claude, Cursor, n8n agent)
│ http://host:8080/private_{token}/mcp
▼
:8080 FastAPI ─ React SPA (/) ─ Admin API (/api/*, JWT) ─ MCP proxy (token)
│
▼ spawned child process, bound to loopback only
127.0.0.1:3000 emqx-mcp-server (FastMCP 3.x, 39 tools)
│
▼
:18083 EMQX REST API v5 (HTTP Basic: API key / secret)
The MCP server binds 127.0.0.1, so the proxy's token check cannot be
bypassed — that is a property of the architecture, not of a config flag.
Reused parts
mcp_admin_core/ and frontend/ are vendored unchanged from
woow_n8n_mcp_server. Copy them in before building:
git clone https://github.com/WOOWTECH/woow_n8n_mcp_server /tmp/n8n-bundle
cp -r /tmp/n8n-bundle/mcp_admin_core /tmp/n8n-bundle/frontend .
cp /tmp/n8n-bundle/pyproject.toml core_pyproject.toml
Tool switches
Three levels of granularity — switching one thing off never switches everything off:
| Level | Effect | Stored as |
|---|---|---|
| Category | All tools in a section disappear | disabled_categories |
| Tool | One tool disappears | disabled_tools |
| Operation | Tool stays, but e.g. loses delete |
disabled_operations |
| Read-only | Every tool marked dangerous disappears | readonly |
Disabled tools are not registered at all, so they never reach the model's tool list — it cannot waste a turn attempting something that is switched off. Disabling every operation of a tool removes the tool entirely.
The GUI writes these through PUT /api/tools; env_from_tool_settings()
serialises them into the child process environment on restart.
The n8n bundle stores the same switches but never forwards them to the subprocess, so its GUI toggles have no real effect.
tests/test_admin_tools_api.pypins the fixed behaviour here.
Tool inventory
| Category | Tools | Dangerous |
|---|---|---|
| Cluster & Monitoring | 7 | 0 |
| Client Management | 6 | 3 |
| Topics & Subscriptions | 2 | 0 |
| Messaging | 5 | 3 |
| Access Control | 8 | 4 |
| Diagnostics | 5 | 2 |
| Data Integration | 6 | 1 |
| Total | 39 | 13 |
tests/test_mcp_surface.py asserts the registry and the server advertise
exactly the same set, so a GUI switch can never point at a missing tool.
Running it
Standalone MCP server (stdio, for Claude Desktop / Claude Code)
pip install -e ".[dev]"
export EMQX_MCP_BASE_URL=http://192.168.2.189:18083
export EMQX_MCP_API_KEY=... EMQX_MCP_API_SECRET=...
python -m emqx_mcp_server.server
{ "mcpServers": { "emqx": {
"command": "python", "args": ["-m", "emqx_mcp_server.server"],
"env": { "EMQX_MCP_BASE_URL": "http://192.168.2.189:18083",
"EMQX_MCP_API_KEY": "...", "EMQX_MCP_API_SECRET": "..." } } } }
Full bundle
docker compose up -d # http://localhost:8080, default login admin/admin
Remote clients then point at http://host:8080/private_{token}/mcp.
Getting EMQX credentials
EMQX dashboard → System Settings → API Keys → Create. Use the key as the username and the secret as the password (HTTP Basic).
Safety
Four independent layers, because EMQX tools can disconnect every device:
- Architecture — MCP server on loopback, proxy token required.
- Registration —
EMQX_MCP_READONLY=truemeans dangerous tools are never registered (not merely refused at call time). - Authorization — tools carry a
destructivetag forrestrict_tag("destructive", require_scopes(...)). - Hints —
ToolAnnotations(destructiveHint=True)makes Claude prompt for confirmation; descriptions start with[DESTRUCTIVE].
MCP annotations are hints from an untrusted server and are not a security boundary — layers 1–3 are the real controls.
Four endpoints are deliberately not exposed as tools: clearing all retained messages, clearing all ACL rules, forcing a node out of the cluster, and stopping a listener.
Verified against a live broker
Checked on 2026-08-03 against EMQX 5.8.8 Opensource (emqx@woowtechshowha.local,
1 node, 69 subscriptions). Confirmed correct: the dotted stat keys
(connections.count, retained.count), the {data, meta{count, hasnext}}
pagination envelope, /mqtt/retainer/messages, /listeners reporting
1883/8883/8083/8084, the password_based:built_in_database authenticator id,
: needing percent-encoding in authenticator ids, and the CLIENTID_NOT_FOUND
404 shape.
Three things only a live broker revealed:
Slashes cannot appear in a retained-message path.
GET /mqtt/retainer/message/{topic} answers 200 for woowe2eflat but an HTML
404 for woow/mcp/e2e — percent-encoded or not. Since every real topic is
hierarchical, emqx_get_retained falls back to scanning the listing, and
emqx_delete_retained clears the topic the MQTT-native way, by publishing an
empty retained payload. Both paths are pinned by tests/test_retained_topics.py.
Publishing answers 202, not 200.
With nothing subscribed EMQX returns {"message":"no_matching_subscribers", "reason_code":16}. Reporting a plain success would hide the most common reason
a message "does nothing", so emqx_publish surfaces
delivered_to_subscribers and broker_note.
Retained payloads come back base64-encoded.
ZmxhdC1vaw== rather than flat-ok. They are decoded before the model sees them.
Tests
python -m pytest -q # 17 tests, plus 11 live checks when credentials are set
Written test-first at three agreed seams:
test_gating.py— the three-level switch logic.test_mcp_surface.py— what an AI client actually sees, through FastMCP's in-memoryClient.test_admin_tools_api.py— the endpoints the React GUI calls.test_retained_topics.py— the EMQX quirks found during live verification.test_live_emqx.py— end-to-end against a real broker; skipped without credentials.
Layout
emqx_mcp_server/ the MCP server
registry.py 39 tool specs — shared with the GUI
gating.py category / tool / operation switches
server.py build_server(gate) assembles what survives
lifespan.py deps.py errors.py models.py settings.py
tools/ cluster clients topics messaging security
diagnostics integration
emqx_mcp_admin/ the admin layer
main.py create_app(extra_routers=[...])
store.py switch persistence + subprocess env
routers/ config tools tokens health logs
mcp_admin_core/ vendored from woow_n8n_mcp_server
frontend/ vendored from woow_n8n_mcp_server
tests/
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。