Asynchronous MCP (Model Context Protocol) server for ThingsBoard API integration
ThingsBoard MCP Server provides a comprehensive set of tools for working with ThingsBoard through the MCP protocol. The server supports all major operations with devices, assets, telemetry, alarms, and other ThingsBoard components.
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā Cursor IDE ā ā MCP Server ā ā ThingsBoard ā
ā (Client) āāāāāŗā (FastMCP) āāāāāŗā (API Server) ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāā
ā Tool Registry ā
ā (Categories) ā
āāāāāāāāāāāāāāāāāāāā
# docker-compose.yml
version: '3.8'
services:
thingsboard-mcp:
image: allexd2010/thingsboard-mcp:latest
container_name: thingsboard-mcp
environment:
TB_HOST: your-thingsboard-host
TB_PORT: 9090
TB_USERNAME: [email protected]
TB_PASSWORD: yourpassword
TB_SSL: false
TB_TIMEOUT: 30
FASTMCP_HOST: 0.0.0.0
FASTMCP_PORT: 8000
FASTMCP_LOG_LEVEL: INFO
ports:
- "8000:8000"
restart: unless-stopped
docker run -d \
--name thingsboard-mcp \
-p 8000:8000 \
-e TB_HOST=your-thingsboard-host \
-e TB_PORT=9090 \
-e [email protected] \
-e TB_PASSWORD=yourpassword \
-e FASTMCP_HOST=0.0.0.0 \
-e FASTMCP_PORT=8000 \
allexd2010/thingsboard-mcp:latest
# Check status
docker ps
# View logs
docker logs thingsboard-mcp
# Test availability
curl http://localhost:8000/sse
| Variable | Description | Default Value |
|---|---|---|
TB_HOST | ThingsBoard host | localhost |
TB_PORT | ThingsBoard port | 9090 |
TB_USERNAME | Username | [email protected] |
TB_PASSWORD | Password | tenant |
TB_SSL | Use SSL connection | false |
TB_TIMEOUT | Connection timeout | 30 |
FASTMCP_HOST | MCP server host | 0.0.0.0 |
FASTMCP_PORT | MCP server port | 8000 |
FASTMCP_LOG_LEVEL | Logging level | INFO |
docker run -d \
--name thingsboard-mcp \
-p 8000:8000 \
-e TB_HOST=localhost \
-e TB_PORT=9090 \
-e [email protected] \
-e TB_PASSWORD=tenant \
allexd2010/thingsboard-mcp:latest
docker run -d \
--name thingsboard-mcp \
-p 8000:8000 \
-e TB_HOST=demo.thingsboard.io \
-e TB_PORT=443 \
-e [email protected] \
-e TB_PASSWORD=yourpassword \
-e TB_SSL=true \
allexd2010/thingsboard-mcp:latest
# Get categories list
docker exec thingsboard-mcp python src/app.py --list-categories
# Get services list
docker exec thingsboard-mcp python src/app.py --list-services
# Run with specific categories
docker exec thingsboard-mcp python src/app.py --categories entities monitoring
# Container status
docker ps thingsboard-mcp
# Server logs
docker logs thingsboard-mcp
# Environment variables
docker exec thingsboard-mcp env | grep -E "(TB_|FASTMCP_)"
# Test ThingsBoard connection
docker exec thingsboard-mcp curl -I http://$TB_HOST:$TB_PORT
# Real-time logs
docker logs -f thingsboard-mcp
# Resource usage
docker stats thingsboard-mcp
# Error search
docker logs thingsboard-mcp | grep -i error
| Tag | Description |
|---|---|
latest | Latest stable version |
1.0 | Version 1.0 |
dev | Development version |
python:3.11-slim// mcp-config.json
{
"mcpServers": {
"thingsboard-mcp": {
"command": "docker",
"args": ["exec", "-i", "thingsboard-mcp", "python", "src/app.py", "--categories", "monitoring"],
"env": {
"PYTHONPATH": "/app"
}
}
}
}
User: "Show all devices"
Cursor: [Uses MCP tool to get device list]
User: "Create new device named 'Sensor001'"
Cursor: [Uses MCP tool to create device]
Content type
Image
Digest
sha256:aba883f4dā¦
Size
142.9 MB
Last updated
about 1 year ago
docker pull allexd2010/thingsboard-mcp:1.0