Back to MCP Servers

Thingsboard

The ThingsBoard MCP Server provides a natural language interface for LLMs and AI agents to interact with your ThingsBoard IoT platform.

other-tools-and-integrationsaillmagent
By thingsboard
9823Updated 3 months agoJavaApache-2.0

Installation

npx -y thingsboard-mcp

Configuration

{
  "mcpServers": {
    "thingsboard-mcp": {
      "command": "npx",
      "args": ["-y", "thingsboard-mcp"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

ThingsBoard MCP Server

License Docker Java

Connect AI agents to your ThingsBoard IoT platform via Model Context Protocol (MCP). Query devices, manage entities, analyze telemetry, and automate operations — all through natural language.

Works with Claude Desktop, Cursor, VS Code Copilot, Claude Code, and any MCP-compatible client.

Quick Start

You need a ThingsBoard instance (Cloud, EU Cloud, self-hosted CE/PE, or Edge) and an API key (ThingsBoard 4.3+) or username/password.

<details open> <summary><b>Claude Desktop</b></summary>

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "thingsboard": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "THINGSBOARD_URL", "-e", "THINGSBOARD_API_KEY", "thingsboard/mcp"],
      "env": {
        "THINGSBOARD_URL": "https://thingsboard.cloud",
        "THINGSBOARD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
</details> <details> <summary><b>Cursor</b></summary>

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):

{
  "mcpServers": {
    "thingsboard": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "THINGSBOARD_URL", "-e", "THINGSBOARD_API_KEY", "thingsboard/mcp"],
      "env": {
        "THINGSBOARD_URL": "https://thingsboard.cloud",
        "THINGSBOARD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
</details> <details> <summary><b>VS Code Copilot</b></summary>

Add to your VS Code settings.json or .vscode/mcp.json:

{
  "mcp": {
    "servers": {
      "thingsboard": {
        "command": "docker",
        "args": ["run", "-i", "--rm", "-e", "THINGSBOARD_URL", "-e", "THINGSBOARD_API_KEY", "thingsboard/mcp"],
        "env": {
          "THINGSBOARD_URL": "https://thingsboard.cloud",
          "THINGSBOARD_API_KEY": "YOUR_API_KEY"
        }
      }
    }
  }
}
</details> <details> <summary><b>Claude Code</b></summary>
claude mcp add thingsboard \
  -e THINGSBOARD_URL=https://thingsboard.cloud \
  -e THINGSBOARD_API_KEY=YOUR_API_KEY \
  -- docker run -i --rm -e THINGSBOARD_URL -e THINGSBOARD_API_KEY thingsboard/mcp
</details> <details> <summary><b>SSE Mode (any HTTP-based MCP client)</b></summary>

Start the server:

docker run --rm -p 8000:8000 \
  -e THINGSBOARD_URL=https://thingsboard.cloud \
  -e THINGSBOARD_API_KEY=YOUR_API_KEY \
  -e SPRING_AI_MCP_SERVER_STDIO=false \
  -e SPRING_WEB_APPLICATION_TYPE=servlet \
  thingsboard/mcp

Then point your MCP client to http://localhost:8000/sse.

</details>

Legacy auth: If your ThingsBoard version is older than 4.3, use THINGSBOARD_USERNAME and THINGSBOARD_PASSWORD instead of THINGSBOARD_API_KEY.

What You Can Do

Ask questions in natural language and get structured results from your ThingsBoard instance:

Query devices and entitiesAnalyze time-series data
Get My DevicesAnalyze Data
Generate and save telemetryGet anomaly analysis
Generate DataAnalysis Result

120+ tools across 10 tool groups:

  • Devices — create, update, delete, list, search by name/type/group
  • Assets — CRUD, list by tenant/customer, search
  • Customers — CRUD, list, search by title
  • Users — CRUD, list, admin/customer user management
  • Alarms — create, acknowledge, clear, delete, query by severity
  • Telemetry — read/write attributes and time-series, aggregation, TTL
  • Relations — create, delete, navigate entity relationships
  • OTA Packages — upload, download, assign firmware/software to devices
  • Entity Groups (PE) — manage groups, assign/remove entities
  • Entity Data Query — complex filtered queries across all entity types with attribute/telemetry filters

Installation

Docker (Recommended)

docker pull thingsboard/mcp

The Docker image supports two transport modes:

  • STDIO (default) — for clients that launch the server as a subprocess (Claude Desktop, Cursor, etc.)
  • SSE — for clients that connect over HTTP

See Quick Start for usage examples.

Download Binary

wget https://github.com/thingsboard/mcp-server/releases/download/v2.1.0/thingsboard-mcp-server-2.1.0.jar

Run with:

# STDIO mode
java -jar thingsboard-mcp-server-2.1.0.jar

# SSE mode
java -Dspring.ai.mcp.server.stdio=false -Dspring.main.web-application-type=servlet -jar thingsboard-mcp-server-2.1.0.jar
<details> <summary><b>Binary client configuration</b></summary>

If you're using the JAR file instead of Docker, use this in your claude_desktop_config.json:

{
  "mcpServers": {
    "thingsboard": {
      "command": "java",
      "args": ["-jar", "/absolute/path/to/thingsboard-mcp-server-2.1.0.jar"],
      "env": {
        "THINGSBOARD_URL": "https://thingsboard.cloud",
        "THINGSBOARD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
</details>

Build from Source

Requires Java 17+ and Maven 3.6+.

git clone https://github.com/thingsboard/mcp-server.git
cd mcp-server
mvn clean install -DskipTests
java -jar target/thingsboard-mcp-server-2.1.0.jar

Configuration

Environment Variables

VariableDescriptionDefault
THINGSBOARD_URLBase URL of your ThingsBoard instancerequired
THINGSBOARD_API_KEYAPI key for authentication (recommended for 4.3+)
THINGSBOARD_USERNAMEUsername for authentication (legacy)
THINGSBOARD_PASSWORDPassword for authentication (legacy)
THINGSBOARD_LOGIN_INTERVAL_SECONDSSession refresh interval1800
HTTP_BIND_ADDRESSHTTP bind address (SSE mode)127.0.0.1
HTTP_BIND_PORTHTTP port (SSE mode)8000
SPRING_AI_MCP_SERVER_STDIOEnable STDIO transporttrue
SPRING_WEB_APPLICATION_TYPEnone for STDIO, servlet for SSEnone
SPRING_AI_MCP_SERVER_SSE_ENDPOINTSSE endpoint path/sse
SPRING_AI_MCP_SERVER_SSE_MESSAGE_ENDPOINTSSE message endpoint path/mcp/message
<details> <summary><b>Advanced: connection and logging</b></summary>
VariableDescriptionDefault
THINGSBOARD_CONNECTION_MAX_RETRIESMax connection retry attempts3
THINGSBOARD_CONNECTION_RETRY_DELAY_SECONDSDelay between retries5
THINGSBOARD_CONNECTION_CONNECT_TIMEOUT_SECONDSHTTP connect timeout10
THINGSBOARD_CONNECTION_READ_TIMEOUT_SECONDSHTTP read timeout60
LOG_LEVEL_APPApplication log levelinfo
LOG_LEVEL_TOOLSTool execution log levelinfo
LOG_LEVEL_TOOL_RESPONSETool response log levelinfo
LOGGING_PATTERN_CONSOLELogback console pattern%d{yyyy-MM-dd HH:mm:ss} | %-5level | %logger{1} | %msg%n
LOGGING_CONSOLE_TARGETLog output targetSystem.err
</details>

Tool Groups

The server exposes 120+ tools which may exceed context limits for some clients. Disable groups you don't need:

VariableGroupToolsDefault
THINGSBOARD_TOOLS_EDQEntity Data Query + Guides40true
THINGSBOARD_TOOLS_TELEMETRYTelemetry & Attributes11true
THINGSBOARD_TOOLS_DEVICEDevices11true
THINGSBOARD_TOOLS_ASSETAssets8true
THINGSBOARD_TOOLS_ALARMAlarms9true
THINGSBOARD_TOOLS_OTAOTA Packages11true
THINGSBOARD_TOOLS_RELATIONRelations8true
THINGSBOARD_TOOLS_CUSTOMERCustomers7true
THINGSBOARD_TOOLS_USERUsers9true
THINGSBOARD_TOOLS_GROUPEntity Groups (PE only)10true

Example — reduce to ~50 tools for clients with limited context:

{
  "env": {
    "THINGSBOARD_TOOLS_EDQ": "false",
    "THINGSBOARD_TOOLS_OTA": "false",
    "THINGSBOARD_TOOLS_GROUP": "false",
    "THINGSBOARD_TOOLS_USER": "false"
  }
}

Available Tools

<details> <summary><b>Device Tools (11)</b></summary>
ToolDescription
createOrUpsertDeviceCreate or update a device by name. Primary tool for most device tasks.
saveDeviceCreate or update the device object from raw JSON. Advanced tool.
deleteDeviceDelete the device by id.
getDeviceByIdFetch the Device object based on the provided Device Id.
getDeviceCredentialsByDeviceIdGet device credentials by device id.
getTenantDevicesReturns a page of devices owned by tenant.
getTenantDeviceGet tenant device by name.
getCustomerDevicesReturns a page of devices assigned to customer.
getUserDevices (PE)Returns a page of devices available for the current user.
getDevicesByIdsGet devices by ids.
getDevicesByEntityGroupId (PE)Returns a page of devices in a specified entity group.
</details> <details> <summary><b>Asset Tools (8)</b></summary>
ToolDescription
saveAssetCreate or update the asset object.
deleteAssetDelete the asset by id.
getAssetByIdGet the Asset object by id.
getTenantAssetsReturns a page of assets owned by tenant.
getTenantAssetGet tenant asset by name.
getCustomerAssetsReturns a page of assets assigned to customer.
getUserAssets (PE)Returns a page of assets available for the current user.
getAssetsByEntityGroupId (PE)Returns a page of assets in a specified entity group.
</details> <details> <summary><b>Customer Tools (7)</b></summary>
ToolDescription
saveCustomerCreate or update the customer object.
deleteCustomerDelete the customer by id.
getCustomerByIdGet the Customer object by id.
getCustomersReturns a page of customers owned by tenant.
getTenantCustomerGet customer by title.
getUserCustomers (PE)Returns a page of customers available for the user.
getCustomersByEntityGroupId (PE)Returns a page of customers in a specified entity group.
</details> <details> <summary><b>User Tools (9)</b></summary>
ToolDescription
saveUserCreate or update the user object.
deleteUserDelete the user by id.
getUserByIdFetch the User object by id.
getUsersReturns a page of users owned by tenant or customer.
getTenantAdminsReturns a page of tenant administrator users.
getCustomerUsersReturns a page of users assigned to a customer.
getAllCustomerUsers (PE)Returns a page of all customer users for the current tenant.
getUsersForAssignReturns users that can be assigned to an alarm.
getUsersByEntityGroupId (PE)Returns a page of users in a specified entity group.
</details> <details> <summary><b>Alarm Tools (9)</b></summary>
ToolDescription
saveAlarmCreate or update the alarm object.
deleteAlarmDelete the alarm by id.
ackAlarmAcknowledge the alarm.
clearAlarmClear the alarm.
getAlarmInfoByIdGet alarm info by id (includes originator name).
getAlarmsGet a page of alarms for th

View source on GitHub