mqttx -sse
An implementation of the Model-Context Protocol (MCP) that enables MQTT operations over Server-Sent Events (SSE) transport.
claude mcp add --transport stdio ysfscream-mqttx-mcp-sse-server node server.js \ --env PORT="4000" \ --env MCP_VERSION="2024-11-05"
How to use
This MCP server exposes MQTT operations over Server-Sent Events (SSE) using the MCP protocol. Clients connect to the SSE endpoint to establish a persistent session and then issue JSON-RPC commands to manage MQTT connections, subscriptions, and publications. The server supports initializing an MCP session, listing available tools, and calling MQTT-related tools such as mqttConnect, mqttSubscribe, and mqttPublish, enabling real-time MQTT interactions via MCP transport.
How to install
Prerequisites:
- Node.js v14 or later
- npm
-
Clone the repository git clone https://github.com/yourusername/mqttx-sse-server.git cd mqttx-sse-server
-
Install dependencies npm install
-
Configure environment (optional)
- PORT: Port to run the server (default 4000)
- MCP_VERSION: MCP protocol version to advertise (e.g., 2024-11-05)
-
Start the server npm start
The server will start on port 4000 by default and expose the SSE endpoint at /mqttx/sse.
Additional notes
Notes and tips:
- The MCP tools exposed include mqttConnect, mqttSubscribe, and mqttPublish for interacting with MQTT brokers.
- Use the SSE endpoint GET /mqttx/sse to establish a persistent connection for real-time updates.
- Use POST /mqttx/message?sessionId= to send JSON-RPC commands once the SSE connection is established.
- Ensure your MQTT broker is reachable from the server environment and that firewall rules allow outbound MQTT connections if required.
- If you encounter connection issues, verify the PORT environment variable and that the MCP_VERSION matches the client expectations.
- For debugging, inspect server logs for tool invocation requests and responses to trace JSON-RPC exchanges.
Related MCP Servers
fastapi_mcp
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!
mcp-telegram
MCP Server for Telegram
mongodb-lens
🍃🔎 MongoDB Lens: Full Featured MCP Server for MongoDB Databases
api
MCP server from hostinger/api-mcp-server
midnight
Midnight MCP server giving AI assistants access to Midnight blockchain — search contracts, analyze code, explore docs
metabase-ai-assistant
🚀 The most powerful MCP Server for Metabase - 111+ tools for AI SQL generation, dashboard automation & enterprise BI. Works with Claude, Cursor, ChatGPT.