emqx.com
emqx.com logo

EMQX

Integrates with EMQX MQTT broker to enable real-time IoT device management, client monitoring, and message publishing fo...

Created byApr 23, 2025

EMQX MCP Server

A Model Context Protocol (MCP) server implementation that provides EMQX MQTT broker interaction. Enabling MCP clients to interact with the MQTT clusters on EMQX Cloud or self-hosted clusters

Features

MQTT Client Management

  • Client Listing: View all connected MQTT clients with flexible filtering options
  • Client Information: Retrieve detailed information about specific clients
  • Connection Control: Disconnect problematic or stale clients from the broker
  • Flexible Filtering: Filter clients by node, username, client ID, connection state, and more

MQTT Message Publishing

  • Topic-based Publishing: Send messages to any MQTT topics
  • QoS Control: Select Quality of Service level (0, 1, or 2) for reliable delivery
  • Message Retention: Option to persist messages for new subscribers
  • Custom Payloads: Support for any message content format

Tools

list_mqtt_clients

  • List MQTT clients connected to your EMQX Cluster
  • Inputs:

get_mqtt_client

  • Get detailed information about a specific MQTT client by client ID
  • Inputs:

kick_mqtt_client

  • Disconnect a client from the MQTT broker by client ID
  • Inputs:

publish_mqtt_message

  • Publish an MQTT Message to Your EMQX Cluster on EMQX Cloud or Self-Managed Deployment
  • Inputs:

Setup EMQX Cluster

Before using the EMQX MCP Server tools, you need to set up an EMQX cluster with properly configured API Key and client authentication. There are several options:
  1. EMQX Cloud Serverless Deployment:
  • The easiest way to get started with.
  • Obtain a free serverless deployment from EMQX Cloud
  1. EMQX Cloud Dedicated Deployment:
  • Provides dedicated resources for production workloads
  • Offers enhanced performance, reliability, and customization options
  • Supports various cloud providers (AWS, GCP, Azure)
  • Includes professional SLA and support
  1. Self-hosted EMQX Platform:
  • Download and deploy EMQX Platform locally

Running locally with the Claude Desktop App

Option 1: Installing via Smithery

To install emqx-mcp-server for Claude Desktop automatically via Smithery:

Option 2: Docker

  1. Install Claude Desktop App if you haven't done so yet.
  1. Pull the image:
  1. Add the following to your claude_desktop_config.json file: Note: Update the env variables:EMQX_API_URL, EMQX_API_KEY, EMQX_API_SECRET
  1. Open or Restart Claude Desktop App
  1. Try asking Claude to do something with the MQTT broker (e.g. ask it to publish an MQTT message to a topic).

Option 3: Manual Installation

First, ensure you have the uv executable installed. If not, you can install it by following the instructions here.
  1. Install Claude Desktop App if you haven't done so yet.
  1. Clone this repository.
  1. Add the following to your claude_desktop_config.json file: Note: Make sure to update path/to/repo/src/emqx_mcp_server to the actual path and modify the environment variables EMQX_API_URL, EMQX_API_KEY, and EMQX_API_SECRET to match your EMQX instance.
  1. Open or Restart Claude Desktop App
  1. Try asking Claude to do something with the MQTT broker (e.g. ask it to publish an MQTT message to a topic).

Example Prompts

User:
LLM:
User:
LLM:
User:
LLM:
User:
LLM

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details.

EMQX MCP Server

A Model Context Protocol (MCP) server implementation that provides EMQX MQTT broker interaction. Enabling MCP clients to interact with the MQTT clusters on EMQX Cloud or self-hosted clusters

Features

MQTT Client Management

  • Client Listing: View all connected MQTT clients with flexible filtering options
  • Client Information: Retrieve detailed information about specific clients
  • Connection Control: Disconnect problematic or stale clients from the broker
  • Flexible Filtering: Filter clients by node, username, client ID, connection state, and more

MQTT Message Publishing

  • Topic-based Publishing: Send messages to any MQTT topics
  • QoS Control: Select Quality of Service level (0, 1, or 2) for reliable delivery
  • Message Retention: Option to persist messages for new subscribers
  • Custom Payloads: Support for any message content format

Tools

list_mqtt_clients

  • List MQTT clients connected to your EMQX Cluster
  • Inputs:

get_mqtt_client

  • Get detailed information about a specific MQTT client by client ID
  • Inputs:

kick_mqtt_client

  • Disconnect a client from the MQTT broker by client ID
  • Inputs:

publish_mqtt_message

  • Publish an MQTT Message to Your EMQX Cluster on EMQX Cloud or Self-Managed Deployment
  • Inputs:

Setup EMQX Cluster

Before using the EMQX MCP Server tools, you need to set up an EMQX cluster with properly configured API Key and client authentication. There are several options:
  1. EMQX Cloud Serverless Deployment:
  • The easiest way to get started with.
  • Obtain a free serverless deployment from EMQX Cloud
  1. EMQX Cloud Dedicated Deployment:
  • Provides dedicated resources for production workloads
  • Offers enhanced performance, reliability, and customization options
  • Supports various cloud providers (AWS, GCP, Azure)
  • Includes professional SLA and support
  1. Self-hosted EMQX Platform:
  • Download and deploy EMQX Platform locally

Running locally with the Claude Desktop App

Option 1: Installing via Smithery

To install emqx-mcp-server for Claude Desktop automatically via Smithery:

Option 2: Docker

  1. Install Claude Desktop App if you haven't done so yet.
  1. Pull the image:
  1. Add the following to your claude_desktop_config.json file: Note: Update the env variables:EMQX_API_URL, EMQX_API_KEY, EMQX_API_SECRET
  1. Open or Restart Claude Desktop App
  1. Try asking Claude to do something with the MQTT broker (e.g. ask it to publish an MQTT message to a topic).

Option 3: Manual Installation

First, ensure you have the uv executable installed. If not, you can install it by following the instructions here.
  1. Install Claude Desktop App if you haven't done so yet.
  1. Clone this repository.
  1. Add the following to your claude_desktop_config.json file: Note: Make sure to update path/to/repo/src/emqx_mcp_server to the actual path and modify the environment variables EMQX_API_URL, EMQX_API_KEY, and EMQX_API_SECRET to match your EMQX instance.
  1. Open or Restart Claude Desktop App
  1. Try asking Claude to do something with the MQTT broker (e.g. ask it to publish an MQTT message to a topic).

Example Prompts

User:
LLM:
User:
LLM:
User:
LLM:
User:
LLM

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details.