MQTT MCP Server
Allows subscribing to MQTT topics, reading buffered messages, unsubscribing, and listing active subscriptions via an MQTT broker.
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., "@MQTT MCP Server Read the latest messages from sensors/temperature"
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.
MQTT MCP Server
An MCP (Model Context Protocol) server that enables Cursor to read messages from an MQTT broker.
Features
Subscribe to MQTT topics (supports wildcards
+and#)Read buffered messages from subscribed topics
List active subscriptions
Configurable message buffer size
Related MCP server: OMNI-MQTT-MCP
Installation
Install dependencies:
npm installBuild the project:
npm run buildCopy
.env.exampleto.envand configure your MQTT broker settings:
cp .env.example .envConfiguration
Edit the .env file with your MQTT broker details:
Variable | Description | Default |
| MQTT broker URL (mqtt:// or mqtts://) |
|
| Username for authentication | (none) |
| Password for authentication | (none) |
| Client ID for MQTT connection |
|
| Max messages to buffer per topic |
|
Cursor Configuration
Add this MCP server to your Cursor settings (.cursor/mcp.json or global settings):
{
"mcpServers": {
"mqtt": {
"command": "node",
"args": ["C:/path/to/mqtt-mcp/dist/index.js"],
"env": {
"MQTT_BROKER_URL": "mqtt://your-broker:1883",
"MQTT_USERNAME": "your_username",
"MQTT_PASSWORD": "your_password"
}
}
}
}Alternatively, if using a .env file in the project directory:
{
"mcpServers": {
"mqtt": {
"command": "node",
"args": ["C:/path/to/mqtt-mcp/dist/index.js"],
"cwd": "C:/path/to/mqtt-mcp"
}
}
}Available Tools
mqtt_subscribe
Subscribe to an MQTT topic to start receiving messages.
Parameters:
topic(required): The MQTT topic to subscribe toqos(optional): Quality of Service level (0, 1, or 2). Default: 0
Example:
Subscribe to "sensors/temperature"
Subscribe to "devices/+/status" (single-level wildcard)
Subscribe to "home/#" (multi-level wildcard)mqtt_unsubscribe
Unsubscribe from an MQTT topic.
Parameters:
topic(required): The MQTT topic to unsubscribe from
mqtt_read_messages
Read buffered messages from subscribed topics.
Parameters:
topic(optional): Specific topic to read from. If omitted, reads from all topicslimit(optional): Maximum messages to return. Default: 10clear(optional): Clear buffer after reading. Default: false
mqtt_list_subscriptions
List all active subscriptions and their message counts.
Parameters: None
Usage Example
First, subscribe to a topic:
"Subscribe to the MQTT topic sensors/temperature"
Wait for messages to arrive, then read them:
"Read the latest messages from sensors/temperature"
Check all active subscriptions:
"List my MQTT subscriptions"
Unsubscribe when done:
"Unsubscribe from sensors/temperature"
License
MIT
Available Tools
5 toolsmqtt_list_subscriptionsB
List all active MQTT topic subscriptions and their message counts.
Inputs: no named parameters.
mqtt_publishB
Publish a message to an MQTT topic. Useful for sending test data or triggering actions on the broker.
Inputs: topic (required), message (required), qos, retain.
mqtt_read_messagesA
Read buffered messages from a subscribed topic. Returns the most recent messages received since subscribing. Supports MQTT wildcards: '+' for single level, '#' for multi-level (e.g., 'sensors/#' returns messages from all topics under 'sensors/').
Inputs: clear, limit, topic.
mqtt_subscribeB
Subscribe to an MQTT topic to start receiving messages. Supports MQTT wildcards: '+' for single level, '#' for multi-level.
Inputs: topic (required), qos.
mqtt_unsubscribeB
Unsubscribe from an MQTT topic to stop receiving messages.
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 5 tools
Each tool targets a distinct MQTT operation: subscribe, unsubscribe, publish, read buffered messages, and list active subscriptions. The read and list tools are clearly separated by their descriptions, and no two tools appear to do the same thing.
All tool names use the mqtt_ prefix and snake_case, which is highly consistent. The only minor deviation is that some names include an explicit object (read_messages, list_subscriptions) while others rely on implicit context (subscribe, unsubscribe, publish), but the pattern remains predictable.
Five tools is well-scoped for an MQTT interaction server, covering the essential subscribe, unsubscribe, publish, read, and list operations without unnecessary bloat. Each tool earns its place and the set feels complete for typical messaging tasks.
The core MQTT lifecycle is covered: subscribe, unsubscribe, publish, read buffered messages, and list subscriptions. Minor gaps exist, such as no explicit tool to clear buffered messages or manage connection state, but these are workaround-able or handled outside the tool surface.
Maintenance
Related MCP Connectors
Authenticated event topics for agent-to-agent messaging with per-agent credentials and audit logs.
The stock market, in SQL — scan, replay, or subscribe across ~12k US tickers and top 100 cryptos.
Historical tick, order book and settlement data for Polymarket and Predict.fun crypto up/down markets, plus smart-money lists and backtest quotes, over a read-only MCP server.
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to interact with MQTT brokers through publish, subscribe, and query operations. Provides fine-grained topic permissions with wildcard support for secure IoT device communication and sensor data access.13 PyPI2BSD 3-Clause
- AlicenseBqualityDmaintenanceEnables AI assistants to publish and subscribe to MQTT topics with configurable transport options (STDIO, Streamable HTTP, SSE), supporting both local development and web deployments with flexible broker authentication.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables MQTT broker operations like connect, subscribe, and publish through MCP over SSE transport.6MIT
- AlicenseAqualityDmaintenanceEnables interacting with MQTT brokers to publish, subscribe, and manage connections, with a real-time web UI for visual feedback.61MIT