🔌 MQTT MCP Server
云端 AI(Claude/GPT/Cursor)← 远程操控 → 树莓派边缘网关 ← MQTT → 你的工厂设备
🌐 English | 中文
把树莓派插到你的工厂机柜里,Claude 就能直接读取传感器、控制 PLC、分析设备健康——用自然语言。 云端大模型不必部署在现场,小盒子只负责 MQTT ↔ AI 协议转换,轻量、安全、6.9MB 单文件。
Power your agent
Install from the publisher. Not a PlugMCP endpoint.
Host a copy with our keys and logs.
No packaged release in the registry yet. Follow the repository README.
Remote URL or a command on your machine? How the two installs differ
Run on PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
LaunchFrom the publisher
云端 AI(Claude/GPT/Cursor)← 远程操控 → 树莓派边缘网关 ← MQTT → 你的工厂设备
🌐 English | 中文
把树莓派插到你的工厂机柜里,Claude 就能直接读取传感器、控制 PLC、分析设备健康——用自然语言。 云端大模型不必部署在现场,小盒子只负责 MQTT ↔ AI 协议转换,轻量、安全、6.9MB 单文件。
MCP Server — 让 AI Agent 通过 MQTT 协议操控物理世界的 IoT 设备
作者:byl
MCP(Model Context Protocol)是 Anthropic(Claude 母公司)2025 年推出的开放标准——简单说,它就是"AI 的 USB 协议"。USB 让电脑能即插即用任何外设,MCP 让 AI 能即插即用任何外部工具。
没有 MCP 的时代:
AI 只能聊天,想查个数据库?对不起,你得自己写代码调 API
有 MCP 的时代:
AI ← MCP 协议 → 数据库、文件系统、MQTT设备、GitHub...
任何一个实现了 MCP 的服务,AI 都能直接操作
MQTT MCP Server 做了什么? 它在 MCP 协议和 MQTT 协议之间架了一座桥。AI 看到的是"8 个工具函数",实际上每个函数都在操控真实的物理设备。
AI Agent MQTT MCP Server 物理世界
"3号泵温度?" → mqtt_query_snapshot → MQTT 查询 → 87°C
"关掉 3 号泵" → mqtt_send_command → MQTT 指令 → 泵停机
"最近有什么异常?" → mqtt_get_alerts → 返回告警列表
MCP 的生态正在爆发:Claude Desktop、Cursor、Windsurf、Continue.dev 都已经内置 MCP 支持。你写一个 MCP Server,几十个 AI 客户端都能用。这就像 90 年代写一个 HTTP 网站——协议是新的,机会是新的。
你桌上的电脑 工厂现场的树莓派
┌─────────────────┐ ┌──────────────────────┐
│ Claude Desktop │ HTTP SSE │ mqtt-mcp-server │
│ 或 Cursor AI │←────远程────→│ (6.9MB Rust 二进制) │
│ │ │ ↓ MQTT │
│ "关掉3号泵" │ │ mosquitto broker │
│ ↓ │ │ ↓ │
│ AI 调用工具 │ │ PLC / 传感器 / 执行器│
└─────────────────┘ └──────────────────────┘
大模型不跑在树莓派上——它在你电脑上或云端。树莓派只是个"翻译官",把 AI 的指令翻译成 MQTT 消息发给设备,把设备数据翻译成 MCP 格式回给 AI。
# ARM64 树莓派
wget https://github.com/baiyanlong/mqtt-mcp-server/releases/latest/download/mqtt-mcp-server-arm64
# x86_64 Linux 服务器
wget https://github.com/baiyanlong/mqtt-mcp-server/releases/latest/download/mqtt-mcp-server-x86_64
或者源码安装:
cargo install mqtt-mcp-server
# 一行命令启动(不写配置文件也行)
mqtt-mcp-server \
--mode sse \
--listen 0.0.0.0:3000 \
--broker tcp://localhost:1883 \
--topics '#'
Claude Desktop 配置:
{
"mcpServers": {
"mqtt": {
"transport": "sse",
"url": "http://你的树莓派IP:3000/sse"
}
}
}
Cursor / Windsurf 同理。配完之后,你的 AI 就能操控物理设备了。
你: "3号泵现在温度多少?"
AI: [自动调用 mqtt_query_snapshot] → 87°C
"3号泵当前 87°C,已超过 85°C 阈值。要我分析趋势吗?"
你: "分析一下"
AI: [调用 mqtt_query_range + mqtt_analyze]
"过去5分钟以 2°C/分钟上升,疑似冷却系统故障。
建议:降低负载,检查冷却液回路。"
AI 自动选择工具、自动构造参数、自动解读结果——你不需要知道 MQTT topic 是什么。
设备自动注册:任何向 MQTT 发了消息的设备,不需要手动配置,自动出现在设备列表里。
AI 不是 24 小时盯着的,规则引擎替你站岗:
rules:
- name: "高温告警"
device: "pump/*"
metric: "temperature"
condition: "value > 80" # 超过 80°C 立刻告警
action: "alert"
ai_enhance: true # 触发后自动让 LLM 分析
- name: "设备离线"
device: "*"
metric: "status"
condition: "last_seen > 300s" # 5 分钟没数据
action: "alert"
启动后打开 http://树莓派IP:8080:
# 1. 下载 ARM64 二进制
wget https://github.com/baiyanlong/mqtt-mcp-server/releases/latest/download/mqtt-mcp-server-arm64
# 2. 装 Mosquitto(MQTT Broker)
sudo apt install -y mosquitto
# 3. 一键部署 systemd 服务
chmod +x install.sh && sudo ./install.sh
# 搞定。重启自动启动,崩溃自动重启。
详见 deploy/README.md。
客户自备 API Key,我们不替客户垫 token 费。
# 示例:接 DeepSeek
mqtt-mcp-server --mode sse --listen 0.0.0.0:3000 \
--ai --ai-provider deepseek --ai-model deepseek-chat \
--ai-key sk-xxx
Pro 版(多节点管理、云 Dashboard、OTA 升级)规划中。
MIT
MCP Server — 让 AI Agent 通过 MQTT 协议操控物理世界的 IoT 设备
Tools
No tool list yet. Remote servers get one after the first health check.
FAQ
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
No required environment variable is listed on this record.
Mqtt runs locally over stdio.
Last checked 2026-10-28. MCP Server — 让 AI Agent 通过 MQTT 协议操控物理世界的 IoT 设备