AIoT MCP Server
OfficialProvides tools to discover IoT devices and rules from an MQTT broker, publish messages to device topics, and query device state via MQTT topics.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AIoT MCP Server show me devices in room1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AIoT MCP Server
Artificial intelligence Internet of Things (AIoT) is a new paradigm of IoT. It is a combination of artificial intelligence and IoT.
MQTT is particularly well-suited for AIoT networks for several key reasons:
Its publish/subscribe pattern allows for flexible, decoupled communication between AI agents and IoT devices
The lightweight protocol minimizes network overhead, perfect for resource-constrained IoT devices
Topic-based hierarchical structure enables natural organization of device groups and capabilities
Retained messages maintain device state, allowing AI agents to quickly understand system context
Last Will and Testament (LWT) feature helps detect offline devices automatically
This repo demonstrates a MCP server which fetches device context from MQTT broker for MCP client to use.
AIoT Agent Network Protocol
Agents MUST use the following MQTT topic convention:
$ai/{DOMAIN}/{GROUP}/d/{DEVICE_ID}: Topic pattern for device registration and discovery$ai/{DOMAIN}/{GROUP}/r/{RULE_ID}: Topic pattern for rule registration and discovery
Agents MUST register clients or rules as retained messages on the corresponding topics. Agents MUST use readable text to describe the device or rule. Agents MAY use natural language to describe the device or rule.
This is ALL.
Related MCP server: mcp2mqtt
Prompt
The assistant's prompt is defined in assistant-prompt.md. This file contains the instructions and capabilities given to the AI assistant for interacting with IoT devices through MQTT.
Tools
Discover
Discovers devices and rules in a group using MQTT topic filter. When querying the status of a group, provide the device GROUP as the argument.
Example request:
{
"group": "room1"
}Example response:
[
{
"topic": "$ai/room1/123",
"message": "I am a temperature sensor..., I publish ... to topic room1/123/status"
},
{
"topic": "$ai/room1/456",
"message": "I am an air conditioner..., I subscribe to topic room1/456/command, expect payload to be on/off"
}
]Publish
Publishes a message to a device using MQTT topic and payload.
Example request:
{
"topic": "room1/456/command",
"payload": "on",
"qos": 0,
"retain": false
}Query
Queries a specific topic for its current state.
Example request:
{
"topic": "room1/123/status"
}Configuration
The server can be configured using environment variables:
MQTT_BROKER_URL: MQTT broker URL (default: mqtt://127.0.0.1:1883)MQTT_USERNAME: MQTT username (optional)MQTT_PASSWORD: MQTT password (optional)
Running The Server
Claude Desktop configuration:
{
"mcpServers": {
"aiot": {
"command": "npx",
"args": [ "tsx", "/path/to/this/repo/src/index.ts" ]
}
}
}Available Tools
3 toolsdiscoverA
Discover devices and rules in a group using MQTT topic filter. When asked status of a group, provide the device GROUP as the argument. If no group is provided, discover all devices and rules in the domain.
Inputs: group.
publishA
Publish a message to a device using MQTT topic and payload. When asked to control a device, you should use this tool with the topic argument discovered from the "discover" tool. For example, a device might describe itself subscribing to a topic livingroom/456/command, then this is the topic to be used to control the device.
Inputs: topic (required), payload (required), qos, retain.
queryA
When asked status of a device, provide the device TOPIC as the argument. The topic can be found in previous messages from the "discover" tool. For example, a device might describe itself publishing its status to a topic livingroom/456/status, then this is the topic to be used to query the status of the device.
Inputs: topic (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct purpose: discover finds devices/rules, publish sends commands, query retrieves status. No overlap in functionality; the descriptions clearly differentiate them.
All tool names are single verbs in lowercase, following a consistent imperative style (discover, publish, query). No mixing of conventions or styles.
Three tools is well-scoped for an MQTT-based AIoT server, covering discovery, control, and status query. Each tool earns its place without unnecessary bloat or missing core operations.
The core lifecycle of discovering, controlling, and querying devices is covered. A minor gap is the lack of explicit rule management (create/update/delete), but rules are discovered via the discover tool, and the primary IoT interactions are complete.
Maintenance
Related MCP Connectors
Real-time planetary signal engine and Model Context Protocol (MCP) server for autonomous AI agents.
AI agent registry — search, discover, register, and connect agents via MCP.
Connect AI agents to Replynodes over the Model Context Protocol.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.23MIT
- AlicenseBqualityNot gradedmaintenanceAn MCP server that bridges the physical world and AI models by enabling natural language control of IoT hardware via the MQTT protocol. It supports real-time device monitoring, command publishing, and response handling for seamless integration between AI clients and physical devices.3MIT
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol server for Node-RED integration, enabling AI agents to manage flows, install modules, and monitor Node-RED instances via natural language.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables LLM agents to securely monitor and control MQTT devices for building automation, industrial control, and smart home systems through a standardized MCP interface.25MIT