In the Weeds: IoT Meets AI with ThingsBoard MCP
A technical deep-dive into connecting IoT devices to AI through ThingsBoard MCP — from smart home telemetry to industrial monitoring.
The Setup
This is an "In the Weeds" post. If you're here, you probably know what IoT means and you've at least heard of MQTT. If not, you might want to start with something like 10 Ways to Use AI Around the House and come back when you're ready to wire things up.
TThingsBoard MCP bridges the gap between your IoT infrastructure and AI assistants. ThingsBoard is an open-source IoT platform that handles device management, data collection, and visualization. The MCP server exposes that entire platform to AI — meaning your AI assistant can query device telemetry, manage assets, trigger alarms, and control devices through natural language.
That's a big deal. Here's why.
The Problem TThingsBoard MCP Solves
If you're running any kind of IoT deployment — smart home, industrial sensors, agricultural monitoring, fleet tracking — you've got data pouring in from devices constantly. Temperature readings. Motion events. Energy consumption. Soil moisture. GPS coordinates. Whatever your sensors measure.
The traditional workflow for doing anything with that data:
- Log into ThingsBoard dashboard
- Navigate to the right device or device group
- Find the right telemetry widget
- Mentally correlate data across multiple devices
- Make a decision
- Navigate to the control interface
- Execute the action
With ThingsBoard MCP, the workflow becomes:
- Ask your AI: "What's the average temperature across all warehouse sensors for the past 6 hours, and are any trending above threshold?"
- Get an answer with analysis
- Say "Turn on the cooling system in Warehouse 3"
- Done
The MCP server translates natural language into ThingsBoard API calls. It handles authentication, pagination, time-series queries, and device addressing. You talk to your AI. Your AI talks to ThingsBoard. Your devices respond.
What You Can Do
Device Telemetry Queries
The most immediate use case is querying device data without touching a dashboard. ThingsBoard MCP can:
- Fetch the latest telemetry values from any device or device group
- Query historical time-series data with custom time ranges
- Aggregate data across device groups (averages, min/max, sums)
- Compare telemetry across devices or time periods
Practical example: "Show me the power consumption for all first-floor devices over the past week, broken down by day." The MCP server queries ThingsBoard's telemetry API, aggregates the results, and your AI presents it in whatever format is most useful — a table, a summary, specific anomalies called out.
Device Management
Beyond reading data, you can manage your device fleet:
- List all devices, filter by type or group
- Check device connectivity status (which devices are online, which have gone silent)
- Update device attributes (configuration values, metadata)
- Provision new devices or decommission old ones
"Which sensors haven't reported in the last 24 hours?" is the kind of question that takes five minutes of dashboard clicking or one sentence with ThingsBoard MCP.
Alarm Management
ThingsBoard has a built-in alarm system. ThingsBoard MCP lets you:
- Query active alarms across your deployment
- Acknowledge or clear alarms through conversation
- Get summaries of alarm frequency and patterns
- Create or modify alarm rules
"Show me all critical alarms from the past week, grouped by device type" gives you an instant operational overview.
RPC and Device Control
This is where it gets interesting. ThingsBoard supports Remote Procedure Calls (RPC) to devices — essentially, sending commands. Through the MCP server, you can trigger these RPCs conversationally:
- Toggle relays or switches
- Set thermostat temperatures
- Trigger actuators
- Send configuration updates to devices
"Set the greenhouse thermostat to 72 degrees" translates to an RPC call to the specific device. The AI handles the device lookup, parameter formatting, and API call.
Architecture Deep Dive
The data flow looks like this:
You → AI Assistant → ThingsBoard MCP → ThingsBoard API → Device
Device → ThingsBoard → ThingsBoard MCP → AI Assistant → You
ThingsBoard MCP authenticates with your ThingsBoard instance using API tokens. It maps MCP tool calls to ThingsBoard REST API endpoints. The key endpoints it wraps:
/api/plugins/telemetry/— time-series data/api/device/— device CRUD operations/api/alarm/— alarm management/api/rpc/— device control/api/asset/— asset management/api/customer/— multi-tenancy
The MCP server handles pagination automatically. ThingsBoard limits API responses to prevent overload; the MCP server makes multiple requests and aggregates results so you get complete answers.
Smart Home Example
Let's walk through a real setup. Say you've got a home with:
- 4 temperature/humidity sensors (one per major room)
- 2 smart plugs (space heater and dehumidifier)
- 1 energy monitor on the main panel
- A motion sensor at the front door
All reporting to a ThingsBoard instance on your local network.
With ThingsBoard MCP connected to your AI assistant, you can have conversations like:
Morning check-in: "Good morning. What's the temperature in each room, and how much energy did we use overnight?"
Automation by conversation: "If the bedroom temperature drops below 65 tonight, turn on the space heater." (The AI can create a ThingsBoard rule chain for this, or you can set up Nn8n MCP to handle the automation logic.)
Anomaly detection: "Has our energy usage been unusual this week compared to last?" The AI queries the time-series data, compares the patterns, and flags anything worth investigating.
Maintenance awareness: "When was the last time each sensor reported in?" Quickly identify if a sensor's battery died or if it's lost connectivity.
Combining with Other MCP Servers
ThingsBoard MCP gets more powerful when combined with other tools:
- Nn8n MCP: Build automation workflows triggered by IoT events. Temperature crosses a threshold → n8n workflow fires → sends you a SSlack message and turns on cooling.
- MMCP Time: Accurate time-based queries and scheduling for IoT operations across time zones.
- SSlack MCP: Get IoT alerts in your team Slack channel. "Send me a Slack message whenever the server room temperature exceeds 80°F."
The composability of MCP servers is what makes this architecture compelling. Each server does one thing well. Combined, they create systems that would otherwise require custom development.
Performance Considerations
A few things to keep in mind:
Telemetry volume. If you have hundreds of devices reporting every second, time-series queries can return massive datasets. Be specific with your time ranges and aggregation periods. "Average temperature per hour for the last 24 hours" is much faster than "every temperature reading for the last month."
RPC latency. Device commands go through ThingsBoard's RPC system. If a device is on a cellular connection or sleeping, there may be delays. The MCP server will report the RPC status, but don't expect instant feedback from every device.
Authentication scope. ThingsBoard uses role-based access control. The API token you configure in ThingsBoard MCP determines what devices and operations are accessible. Use the principle of least privilege — give the MCP server access to what it needs and nothing more.
Getting Started
- Have a ThingsBoard instance running (cloud or self-hosted)
- Create an API token with appropriate permissions
- Install TThingsBoard MCP and configure it with your instance URL and token
- Connect it to your AI assistant
- Start asking questions about your devices
The documentation on the TThingsBoard MCP page covers installation step by step. If you're new to ThingsBoard itself, their open-source community edition is free and runs well on a Raspberry Pi for home setups.
IoT without AI is data collection. IoT with AI is intelligence. ThingsBoard MCP is the bridge.
Ratings & Reviews
0.0
out of 5
0 ratings
No reviews yet. Be the first to share your experience.
Tools in this post