Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MQTT_PORT | No | The MQTT broker port | 1883 |
| MQTT_PASSWORD | No | The MQTT password for authentication | |
| MQTT_USERNAME | No | The MQTT username for authentication | |
| MQTT_CLIENT_ID | No | The MQTT client ID | mcp-mqtt-client |
| MQTT_BROKER_ADDRESS | No | The MQTT broker address | localhost |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| mqtt_publish | Publishes a message to a specific MQTT topic.
Args:
topic: The MQTT topic to publish to.
message: The message payload to send.
qos: The Quality of Service level (0, 1, or 2). Defaults to 0.
retain: Whether the message should be retained by the broker. Defaults to False.
Returns:
A confirmation message string. |
| mqtt_subscribe | Subscribes to an MQTT topic and receives a specified number of messages or waits for a timeout.
Args:
topic: The MQTT topic to subscribe to (can include wildcards like + or #).
num_messages: The maximum number of messages to receive. Defaults to 1.
timeout: The maximum time (in seconds) to wait for messages. Defaults to 10.
Returns:
A list of dictionaries, where each dictionary represents a received message
with 'topic' and 'payload' keys. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |