thingsboard
Thingsboard MCP Server for using Thingsboard Data as context in LLM tools
claude mcp add --transport stdio anycontext-ai-thingsboard-mcp-server uvx thingsboard-mcp-server \ --env ENV_VERBOSE="set to true for verbose logging (optional)" \ --env THINGSBOARD_HOST="host or URL of Thingsboard instance" \ --env THINGSBOARD_TOKEN="token with access to Thingsboard" \ --env THINGSBOARD_NETWORK="optional network name if using TB networks"
How to use
This MCP server acts as an adapter between Thingsboard and the MCP framework. It reads configuration from a local .env file and uses uv to create and manage a virtual environment, install dependencies, and run the Thingsboard integration script. The server’s primary entry point is src/thingsboard.py, which handles authentication, connection recovery, and message routing between Thingsboard and MCP tools. To operate, ensure your .env file is created (copying .env.example) and populate it with your Thingsboard host, access token, and any required network or verbose settings. Once prepared, start the server with the provided command and monitor the logs for activity and potential connection issues. The MCP interface will expose available actions and events from Thingsboard, enabling you to incorporate device data, telemetry, and commands into your MCP workflows.
How to install
Prerequisites
- Python installed (version compatible with your project)
- Curl or PowerShell (for installation scripts)
- Internet access to fetch dependencies and the uv tool
Step-by-step installation
-
Install and set up uv (as described in the repo): Windows:
- Install uv powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- Create virtual environment uv venv
- Activate virtual environment .venv\Scripts\activate
Linux:
- Install uv curl -LsSf https://astral.sh/uv/install.sh | sh
- Create virtual environment uv venv
- Activate virtual environment source .venv/bin/activate
-
Install Python dependencies uv pip install -r pyproject.toml
-
Prepare environment variables
- Copy example env: cp .env.example .env
- Edit .env to include THINGSBOARD_HOST, THINGSBOARD_TOKEN, and any other required settings
-
Run the server uv run src/thingsboard.py
-
Optional: verify installation
- Check console output for initialization messages
- Confirm that the MCP server can connect to Thingsboard and that events/telemetry are flowing
Additional notes
Tips and common issues:
- Ensure your Thingsboard host URL and token are correct in .env; invalid credentials will prevent connection.
- If you see connection pool or retry messages, increase timeouts or verify network access to Thingsboard.
- On Windows, ensure the virtual environment activation path matches the shell you’re using; use PowerShell or CMD as appropriate.
- If you modify dependencies, re-run uv pip install -r pyproject.toml to refresh packages.
- The environment variable VERBOSE can be set to true to enable detailed logs for debugging.
- If you experience issues with uv installation, confirm your Internet access and that the installation script can be reached from your environment.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP