MQTT MCP Server
Allows subscribing to MQTT topics, reading buffered messages, unsubscribing, and listing active subscriptions via an MQTT broker.
Click on "Install 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 ServerRead 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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/brennanreamer/MQTT-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server