emqx-mcp-server

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Allows interaction with MQTT clusters on EMQX Cloud or self-hosted clusters, enabling clients to list connected MQTT clients, retrieve client information, disconnect clients, and publish messages to MQTT topics

EMQX MCP 서버

EMQX MQTT 브로커 상호작용을 제공하는 모델 컨텍스트 프로토콜(MCP) 서버 구현입니다. MCP 클라이언트가 EMQX 클라우드 또는 자체 호스팅 클러스터의 MQTT 클러스터와 상호작용할 수 있도록 지원합니다.

특징

MQTT 클라이언트 관리

  • 클라이언트 목록: 유연한 필터링 옵션을 통해 연결된 모든 MQTT 클라이언트를 확인하세요.
  • 클라이언트 정보: 특정 클라이언트에 대한 자세한 정보를 검색합니다.
  • 연결 제어: 문제가 있거나 오래된 클라이언트를 브로커에서 연결 해제합니다.
  • 유연한 필터링: 노드, 사용자 이름, 클라이언트 ID, 연결 상태 등을 기준으로 클라이언트 필터링

MQTT 메시지 게시

  • 주제 기반 게시: 모든 MQTT 주제에 메시지 보내기
  • QoS 제어: 안정적인 전달을 위해 서비스 품질 수준(0, 1 또는 2)을 선택합니다.
  • 메시지 보존: 새 구독자에게 메시지를 보존하는 옵션
  • 사용자 정의 페이로드: 모든 메시지 콘텐츠 형식 지원

도구

리스트_mqtt_클라이언트

  • EMQX 클러스터에 연결된 MQTT 클라이언트 나열
  • 입력:
    • 페이지(번호, 선택 사항): 페이지 번호(기본값: 1)
    • limit(숫자, 선택 사항): 페이지당 결과(기본값: 100, 최대 10000)
    • node(문자열, 선택 사항): 특정 노드 이름으로 필터링
    • clientid(문자열, 선택 사항): 특정 클라이언트 ID로 필터링
    • 사용자 이름(문자열, 선택 사항): 특정 사용자 이름으로 필터링
    • ip_address(문자열, 선택 사항): 클라이언트 IP 주소로 필터링
    • conn_state(문자열, 선택 사항): 연결 상태로 필터링
    • clean_start(부울, 선택 사항): clean start 플래그로 필터링
    • proto_ver(문자열, 선택 사항): 프로토콜 버전으로 필터링
    • like_clientid(문자열, 선택 사항): 클라이언트 ID 패턴으로 퍼지 검색
    • like_username(문자열, 선택 사항): 사용자 이름 패턴으로 퍼지 검색
    • like_ip_address(문자열, 선택 사항): IP 주소 패턴으로 퍼지 검색

get_mqtt_client

  • 클라이언트 ID로 특정 MQTT 클라이언트에 대한 자세한 정보를 얻으세요
  • 입력:
    • clientid(문자열, 필수): 검색할 클라이언트의 고유 식별자

kick_mqtt_클라이언트

  • 클라이언트 ID로 MQTT 브로커에서 클라이언트 연결 해제
  • 입력:
    • clientid(문자열, 필수): 연결을 끊을 클라이언트의 고유 식별자

MQTT 메시지 게시

  • EMQX 클라우드 또는 자체 관리 배포에서 EMQX 클러스터에 MQTT 메시지 게시
  • 입력:
    • 주제(문자열, 필수): 게시할 MQTT 주제
    • payload(문자열, 필수): 게시할 메시지 내용
    • qos(숫자, 선택 사항): 서비스 품질 수준(0, 1 또는 2)(기본값: 0)
    • retain(부울, 선택 사항): 메시지를 보관할지 여부(기본값: false)

EMQX 클러스터 설정

EMQX MCP 서버 도구를 사용하기 전에 API 키와 클라이언트 인증을 올바르게 구성하여 EMQX 클러스터를 설정해야 합니다. 다음과 같은 몇 가지 옵션이 있습니다.

  1. EMQX 클라우드 서버리스 배포:
  • 시작하는 가장 쉬운 방법입니다.
  • EMQX Cloud에서 무료 서버리스 배포를 받으세요
  • EMQX Cloud Serverless 에 가입하세요
  1. EMQX 클라우드 전용 배포:
  • 프로덕션 워크로드에 대한 전담 리소스를 제공합니다.
  • 향상된 성능, 안정성 및 사용자 정의 옵션을 제공합니다.
  • 다양한 클라우드 공급자(AWS, GCP, Azure) 지원
  • 전문적인 SLA 및 지원이 포함됩니다.
  • EMQX Cloud Dedicated 에서 배포를 생성합니다.
  1. 셀프 호스팅 EMQX 플랫폼:
  • EMQX 플랫폼을 로컬로 다운로드하고 배포하세요
  • EMQX 플랫폼 의 설치 지침을 따르세요

Claude Desktop App을 사용하여 로컬로 실행

옵션 1: Smithery를 통해 설치

Smithery를 통해 Claude Desktop에 emqx-mcp-server를 자동으로 설치하려면:

지엑스피1

옵션 2: Docker

  1. 아직 Claude 데스크톱 앱을 설치하지 않았다면 지금 설치하세요.
  2. 이미지를 끌어오세요:
    docker pull benniuji/emqx-mcp-server
  3. claude_desktop_config.json 파일에 다음을 추가하세요.
    • MacOS의 경우: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • Windows의 경우: %APPDATA%/Claude/claude_desktop_config.json
    { "mcpServers": { "EMQX_MCP_Server": { "command": "docker", "args": [ "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" ] } } }

    참고: env 변수를 업데이트하세요: EMQX_API_URL , EMQX_API_KEY , EMQX_API_SECRET

  4. Claude 데스크톱 앱을 열거나 다시 시작하세요
  5. Claude에게 MQTT 브로커에 대해 뭔가를 해달라고 요청해보세요(예: 주제에 MQTT 메시지를 게시하도록 요청).

옵션 3: 수동 설치

먼저, uv 실행 파일이 설치되어 있는지 확인하세요. 설치되어 있지 않다면 여기 의 지침에 따라 설치하세요.

  1. 아직 Claude 데스크톱 앱을 설치하지 않았다면 지금 설치하세요.
  2. 이 저장소를 복제합니다.
  3. claude_desktop_config.json 파일에 다음을 추가하세요.
    • MacOS의 경우: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • Windows의 경우: %APPDATA%/Claude/claude_desktop_config.json GXP4

    참고: path/to/repo/src/emqx_mcp_server 실제 경로로 업데이트하고 환경 변수 EMQX_API_URL , EMQX_API_KEYEMQX_API_SECRET 을 수정하여 EMQX 인스턴스와 일치하도록 해야 합니다.

  4. Claude 데스크톱 앱을 열거나 다시 시작하세요
  5. Claude에게 MQTT 브로커에 대해 뭔가를 해달라고 요청해보세요(예: 주제에 MQTT 메시지를 게시하도록 요청).

예시 프롬프트

사용자:

Please list the clients connected to the MQTT broker.

법학 석사(LLM):

Here are the clients currently connected to your MQTT broker: Connected Client: - Client ID: mqttx_2232bdb1 - Username: test - Protocol: MQTT v5 ... There is currently 1 client connected to your MQTT broker. Would you like more detailed information about this specific client or would you like to perform another action with your MQTT broker?

사용자:

Yes, please provide the detail info of this client.

법학 석사(LLM):

I'll retrieve the detailed information for this client for you. ... Here's the detailed information for client "mqttx_2232bdb1": **Basic Information:** - **Client ID:** mqttx_2232bdb1 - **Username:** test ... **Connection Details:** - **Connected:** Yes - **Created At:** 2025-03-02T05:29:51.103+00:00 ... Would you like to perform any actions with this client, such as publishing a message to a topic or disconnecting the client?

사용자:

Please write a poem and send it to the topic '/poem' with QoS 1.

법학 석사(LLM):

I'll create a poem and publish it to the topic '/poem' with QoS 1. Let me do that for you. ... I've successfully published the poem to the topic '/poem' with QoS 1. The message has been delivered with ID: 00062F55A1EFB1156ABC481240B30000. The poem I sent was: - Signals in the ether, - Invisible threads that bind, - Devices speak in whispers, - Across the digital divide. - Messages like leaves falling, - From cloud to waiting ground, - Connected yet untethered, - Where silence makes no sound. - Brokers of the modern age, - Routing dreams from here to there, - In this web of connections, - We find ourselves everywhere. - Like stars in constellation, - Each point of light has worth, - The language of machines, - Redefining our Earth. Is there anything else you'd like to do with your MQTT broker?

사용자:

Please kick out the client mqttx_2232bdb1

법학 석사

I'll disconnect the client from the MQTT broker for you. ... The client has been successfully disconnected. The system returned: > Client mqttx_2232bdb1 has been disconnected The MQTT client with ID "mqttx_2232bdb1" is now disconnected from your broker. Is there anything else you would like to do with your MQTT broker?

특허

이 프로젝트는 Apache 라이선스 버전 2.0에 따라 라이선스가 부여되었습니다. 자세한 내용은 LICENSE 파일을 참조하세요.

ID: m7zgbcr053