IoT messaging protocol
## MQTT IoT MCP Server: Lightweight Messaging Protocol The **MQTT IoT MCP Server** integrates MQTT messaging protocol into Google Antigravity, enabling AI-assisted IoT communication, topic management, and message handling for connected devices. ### Why MQTT MCP? - **Lightweight**: Minimal bandwidth for constrained IoT devices - **Pub/Sub Pattern**: Flexible publish-subscribe messaging model - **QoS Levels**: Guaranteed message delivery options - **Retained Messages**: Store last known values for subscribers - **Wildcard Topics**: Subscribe to multiple topics with wildcards ### Key Features #### 1. Publishing ```python from anthropic import Anthropic client = Anthropic() response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Publish command message to device topic with QoS 1" }] ) ``` #### 2. Subscribing ```python # Subscribe to topics response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Subscribe to all sensor topics and display incoming messages" }] ) ``` #### 3. Topic Management ```python # Manage topics response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "List all active topics and their retained messages" }] ) ``` #### 4. Broker Status ```python # Check broker response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Show MQTT broker statistics including connected clients" }] ) ``` ### Configuration ```json { "mcpServers": { "mqtt": { "command": "npx", "args": ["-y", "@anthropic/mcp-server-mqtt"], "env": { "MQTT_BROKER_URL": "mqtt://localhost:1883", "MQTT_USERNAME": "user", "MQTT_PASSWORD": "password" } } } } ``` ### Use Cases **IoT Messaging**: Enable communication between IoT devices. **Telemetry**: Collect sensor data from distributed devices. **Commands**: Send commands to remote devices. **Real-Time Updates**: Push real-time updates to subscribers. The MQTT MCP Server brings IoT messaging into your workflow.
{
"mcpServers": {
"mqtt": {
"mcpServers": {
"mqtt": {
"env": {
"MQTT_BROKER_URL": "mqtt://localhost:1883"
},
"args": [
"-y",
"mqtt-mcp"
],
"command": "npx"
}
}
}
}
}