Skip to main content
Glama

st-mcpserver

This project provides a small Model Context Protocol server exposing a few SmartThings helper tools.

"mcpServers": {
  "SmartThings": {
    "type": "sse",
    "command": "uv",
    "args": [
        "run",
        "src/server.py"
    ],
    "env": {
        "TOKEN": "Your Token"
    }
  }
}

docker启动

{
  "mcpServers": {
    "smartthings": {
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TOKEN=Your token",
        "smartthings-mcp"
      ]
    }
  }
}


uv启动
{
  "mcpServers": {
    "smartthings": {
      "command": "/Users/wanghao/.pyenv/shims/uv",
      "args": [
        "run",
        "--python", "3.12.11",
        "--index-url", "https://test.pypi.org/simple/",
        "--extra-index-url", "https://pypi.org/simple/",
        "--with", "st-mcpserver",
        "smartthings-mcp-server"
      ],
      "env": {
        "TOKEN": "56485136-4bdc-44dc-90c6-31e5e565f37f"
      }
    }
  }
}

Docker

A Dockerfile is included for convenience. Build and run the image with:

docker build -t st-mcpserver .
docker run -e TOKEN=bea73953-3d65-4b2b-8147-997d3ea80e29 st-mcpserver

The container installs the production dependencies using uv and launches the server with uv run src/server.py.

Related MCP server: SmartThings MCP Server

Available tools

The server exposes the following MCP tools:

  • get_rooms – return a mapping of room UUIDs to names.

  • get_devices – list devices with optional filtering.

  • get_device_status – fetch status for a device by UUID.

  • execute_commands – 并发执行多个设备命令 (异步, 5-10x 性能提升)

  • get_device_history – query historical data with time aggregation.

  • get_hub_time – get current hub time.

并发执行命令

使用 httpx + asyncio 异步并发执行,10 设备从 3 秒降至 300ms。

请求格式

{
  "token": "your-token",
  "device_commands": [
    {
      "device_id": "device-uuid",
      "commands": [{"component": "main", "capability": "switch", "command": "on"}]
    }
  ]
}

返回格式

[
  {"device_id": "device-uuid", "result": {...}},
  {"device_id": "device-uuid", "error": "..."}
]

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A lightweight server for Samsung SmartThings, offering tools to manage devices and rooms. Features include room mapping, device listing, status checks, and command execution. #IoT, #Python, #HomeAutomation #Smartthings
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables comprehensive interaction with SmartThings devices, locations, scenes, and automation rules through the SmartThings API. It features intelligent two-level caching and supports multiple transport options including HTTP, SSE, and STDIO.
      2
      MIT