- Home
- MCP servers
- MQTTX SSE
MQTTX SSE
- javascript
5
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You run an MCP SSE server that lets you interact with MQTT brokers through the Model-Context Protocol over Server-Sent Events. It provides real-time MQTT operations via MCP tools, enabling you to connect to brokers, subscribe to topics, and publish messages, all coordinated through a persistent SSE session for instant updates.
How to use
You establish a long‑running SSE connection to receive real-time updates and issue MQTT actions through the JSON‑RPC endpoint. Start by creating a session with your MCP client, then list available tools, connect to an MQTT broker, subscribe to topics, and publish messages. Use the session‑scoped endpoints to perform actions and receive live data as messages arrive on subscribed topics.
How to install
Prerequisites: Node.js v14 or later and npm.
Clone the project, install dependencies, and start the server with the following commands.
# Clone the repository
git clone https://github.com/yourusername/mqttx-sse-server.git
cd mqttx-sse-server
# Install dependencies
npm install
# Run the server
npm start
Configuration and usage notes
To use this MCP server with MQTTX, configure the MCP server URL so your client can reach the SSE endpoint and JSON‑RPC interface. The server exposes an HTTP MCP endpoint you can point your MCP client at, and it runs a local MQTT‑capable MCP implementation over SSE.
Configuration details
MCP server configuration (HTTP) is provided as a ready‑to‑use example that you can reference in your MCP client settings. The server exposes an HTTP endpoint for MCP communications.
{
"mcpServers": {
"mqttx-server": {
"url": "http://localhost:4000/mqttx/sse"
}
}
}
Available tools
mqttConnect
Connect to a specified MQTT broker by host, port, and clientId to establish a session and enable subsequent MQTT operations.
mqttSubscribe
Subscribe to a topic with a given QoS to receive real-time messages as they arrive.
mqttPublish
Publish a payload to a topic with specified QoS and retain settings.