BE

benniu/emqx-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

27 stars 8 forks 质量 67 趋势 11Apache-2.0

模型上下文协议(MCP)服务器实现,提供 EMQX MQTT 代理交互。

概览

一种模型上下文协议(MCP)服务器实现,提供 EMQX MQTT 代理交互。使 MCP 客户端能够与 EMQX 云或自托管集群上的 MQTT 集互 - 客户端列表:查看所有连接的MQTT客户端,提供灵活过滤选项 - 客户端信息:获取特定客户端的详细信息 - 连接控制:断开与代理商的故障或过时客户端连接 - 灵活过滤:按节点、用户名、客户端ID、连接状态等过滤客户端 - 基于主题的发布:向任意MQTT主题发送消息 - QoS控制:选择服务质量级别(0、1或2)以确保可靠传递 - 消息保留:为新订阅者持久化消息的选项 - 自定义负载:支持任何消息内容格式 - 实时订阅:通过服务器发送事件(SSE)订阅MQTT主题 - 时长控制:配置收听消息时长(1-300秒) - 消息限制:设置最大消息数量......

概述(AI 翻译)

模型上下文协议(MCP)服务器实现,提供 EMQX MQTT 代理交互。 使MCP客户端能够与EMQX云或自托管集群上的MQTT集互

特色

MQTT 客户管理

  • 客户端列表:查看所有连接的MQTT客户端,并提供灵活筛选选项
  • 客户端信息:检索特定客户端的详细信息
  • 连接控制:断开有问题或过时的客户端与代理商的连接
  • 灵活过滤:按节点、用户名、客户端ID、连接状态等筛选客户端

MQTT 消息出版

  • 基于主题的发布:向任何MQTT主题发送消息
  • 服务质量控制:选择服务质量等级(0、1或2),以确保可靠交付
  • 消息保留:为新订阅者保留消息的选项
  • 自定义有效载荷:支持任何消息内容格式

MQTT 主题订阅(SSE)

  • 实时订阅:通过服务器发送事件(SSE)订阅MQTT主题
  • 时长控制:配置监听消息的时间长度(1-300秒)
  • 消息限制:设置每个订阅收集的最大消息数量

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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

MQTT Topic Subscription (SSE)

  • Real-time Subscription: Subscribe to MQTT topics via Server-Sent Events (SSE)
  • Duration Control: Configure how long to listen for messages (1-300 seconds)
  • Message Limiting: Set maximum number of messages to collect per subscription
  • Automatic Parsing: Messages are automatically parsed from SSE event stream

Tools

list_mqtt_clients

  • List MQTT clients connected to your EMQX Cluster
  • Inputs:
    • page (number, optional): Page number (default: 1)
    • limit (number, optional): Results per page (default: 100, max 10000)
    • node (string, optional): Filter by specific node name
    • clientid (string, optional): Filter by specific client ID
    • username (string, optional): Filter by specific username
    • ip_address (string, optional): Filter by client IP address
    • conn_state (string, optional): Filter by connection state
    • clean_start (boolean, optional): Filter by clean start flag
    • proto_ver (string, optional): Filter by protocol version
    • like_clientid (string, optional): Fuzzy search by client ID pattern
    • like_username (string, optional): Fuzzy search by username pattern
    • like_ip_address (string, optional): Fuzzy search by IP address pattern

get_mqtt_client

  • Get detailed information about a specific MQTT client by client ID
  • Inputs:
    • clientid (string, required): The unique identifier of the client to retrieve

kick_mqtt_client

  • Disconnect a client from the MQTT broker by client ID
  • Inputs:
    • clientid (string, required): The unique identifier of the client to disconnect

publish_mqtt_message

  • Publish an MQTT Message to Your EMQX Cluster on EMQX Cloud or Self-Managed Deployment
在 GitHub 查看完整 README

安装

docker run -i --rm -e EMQX_API_URL=https://your-emqx-cloud-instance.com:8443/api/v5 -e EMQX_API_KEY=<YOUR-API-KEY> -e EMQX_API_SECRET=<YOUR-API-SECRET> benniuji/emqx-mcp-server
新手?先看 mcpskill.org 教程 →