- Home
- MCP servers
- MCP2MQTT
MCP2MQTT
- python
357
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"mcp2everything-mcp2mqtt": {
"command": "uv",
"args": [
"run",
"src/mcp2mqtt/server.py"
]
}
}
}mcp2mqtt bridges your physical IoT devices with AI models through the Model Context Protocol (MCP) and MQTT. You can control hardware with natural language, get real-time AI responses, and connect devices via MQTT for seamless intercommunication.
How to use
You interact with your IoT setup through an MCP client that speaks MCP and MQTT. Start by connecting your devices to an MQTT broker and configuring your MCP client to talk to the mcp2mqtt server. Your commands flow through the MCP pipeline to hardware actions, while the server relays device state back to you and enables AI-generated prompts to control parameters in real time.
How to install
Prerequisites you need before installation are Python and the uv toolchain for running the MCP server, plus an MCP-compatible client like Claude Desktop or Cline.
-
Clone the project repository to your development machine.
-
Create a Python virtual environment and install development dependencies.
-
Run the MCP server using the standard entry, or start with a specific configuration file if you want to load a dedicated setup.
-
Start your MCP client and point it at the running server to begin sending commands.
Additional sections
Configuration details include MQTT connectivity and command routing. The server exposes commands via MQTT topics and supports loading multiple configuration profiles for different devices. You can tailor prompts, resource management, and tool invocation to your hardware and AI provider.
Security considerations include using MQTT authentication (username and password) and restricting topics to your trusted devices and clients. Regularly review access controls and rotate credentials.
Troubleshooting tips: check MQTT broker availability, verify the MCP client configuration, and monitor logs for errors during device command processing. If a command fails, look for the error message prefixed by ERROR to identify the issue.