概要
What is Mqtt Mcp?
Mqtt Mcp is a lightweight Model Context Protocol server that connects LLM agents to MQTT devices, enabling seamless integration of AI-driven workflows with Building Automation (BAS), Industrial Control (ICS), and Smart Home systems. It allows agents to monitor real-time sensor data, actuate devices, and orchestrate complex automation tasks.
How to use Mqtt Mcp?
Install uv, clone the repository, run uv sync to install dependencies, then start the server with uv run mqtt-mcp. The server defaults to the Streamable HTTP transport on port 8000. For Bearer Token authentication, provide an RSA public key in PEM format in the .env file.
Key features of Mqtt Mcp
- Maps MQTT topics to MCP resources and tools
- Supports receiving and publishing MQTT messages
- Bearer token authentication via RSA public key
- Interactive prompts for guiding LLM interactions
- Docker deployment support
- Example integrations with OpenAI Agents SDK and OpenAI Python library
Use cases of Mqtt Mcp
- Monitor real-time sensor data from MQTT-enabled devices
- Actuate devices (e.g., lights, valves) via publish operations
- Orchestrate automation tasks across BAS, ICS, or smart home systems
- Integrate with OpenAI agents to add MQTT capabilities
FAQ from Mqtt Mcp
What transport does Mqtt Mcp use by default?
It uses the Streamable HTTP transport on port 8000.
How do I authenticate with Mqtt Mcp?
Enable Bearer Token authentication by providing an RSA public key in PEM format in the .env file.
What are the runtime dependencies?
Python with FastMCP 2.0 and uv for project and dependency management.
Can Mqtt Mcp be deployed as a Docker container?
Yes. Build the image with docker build -t mqtt-mcp . and run it, mapping port 8080 to the server’s port 8000.
Does Mqtt Mcp support both sending and receiving messages?
Yes. Receiving is exposed as both a resource and a tool; publishing is exposed as a tool. Both accept configurable host, port, and topic parameters.