Get the FREE Ultimate OpenClaw Setup Guide →

thingsboard

Thingsboard MCP Server for using Thingsboard Data as context in LLM tools

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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

  1. 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:

  2. Install Python dependencies uv pip install -r pyproject.toml

  3. Prepare environment variables

    • Copy example env: cp .env.example .env
    • Edit .env to include THINGSBOARD_HOST, THINGSBOARD_TOKEN, and any other required settings
  4. Run the server uv run src/thingsboard.py

  5. 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

Sponsor this space

Reach thousands of developers