MQTT MCP Server

MQTT MCP Server

Enables Cursor to subscribe to MQTT topics and read buffered messages from an MQTT broker.

Category
Visit Server

README

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

Installation

  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Copy .env.example to .env and configure your MQTT broker settings:
cp .env.example .env

Configuration

Edit the .env file with your MQTT broker details:

Variable Description Default
MQTT_BROKER_URL MQTT broker URL (mqtt:// or mqtts://) mqtt://localhost:1883
MQTT_USERNAME Username for authentication (none)
MQTT_PASSWORD Password for authentication (none)
MQTT_CLIENT_ID Client ID for MQTT connection cursor-mqtt-mcp-{timestamp}
MAX_MESSAGES_PER_TOPIC Max messages to buffer per topic 100

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 to
  • qos (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 topics
  • limit (optional): Maximum messages to return. Default: 10
  • clear (optional): Clear buffer after reading. Default: false

mqtt_list_subscriptions

List all active subscriptions and their message counts.

Parameters: None

Usage Example

  1. First, subscribe to a topic:

    "Subscribe to the MQTT topic sensors/temperature"

  2. Wait for messages to arrive, then read them:

    "Read the latest messages from sensors/temperature"

  3. Check all active subscriptions:

    "List my MQTT subscriptions"

  4. Unsubscribe when done:

    "Unsubscribe from sensors/temperature"

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured