SmartThings MCP

效率与工作流

by langowarny

跨地点控制 SmartThings 设备与场景,获取实时状态和历史记录,并即时下发命令;还能管理房间、规则、日程和事件订阅,实现自动化。

什么是 SmartThings MCP

跨地点控制 SmartThings 设备与场景,获取实时状态和历史记录,并即时下发命令;还能管理房间、规则、日程和事件订阅,实现自动化。

README

Lango SmartThings MCP Server

smithery badge

A Model Context Protocol (MCP) server that exposes Samsung SmartThings Public API as LLM-friendly tools, resources and real-time events.

Features

  • Lazy Loading: Tools are discoverable without authentication - only validates API keys when tools are invoked
  • Wraps common SmartThings operations as MCP Tools
    • Devices: list_devices, get_device, get_device_status, list_device_capabilities, send_device_command
    • Locations & Rooms: list_locations, list_rooms, create_room, delete_room
    • Scenes & Rules: list_scenes, execute_scene, list_rules
    • Hubs: list_hubs, get_hub_health
    • Subscriptions: list_subscriptions, create_subscription, delete_subscription
    • Schedules: list_schedules, create_schedule, delete_schedule
    • History: get_device_history
    • Capabilities: get_capability
  • Exposes device / status / location data as MCP Resources with read-through cache
  • Supports all official MCP-Go transports
    • Stdio (CLI / local), StreamableHTTP, Server-Sent Events (SSE)
  • Periodic poller publishes live device status to SSE clients
  • Zero external dependencies apart from mcp-go and zap logger

Requirements

  • Go ≥ 1.23
  • A valid SmartThings PAT (Personal Access Token)

Getting a Personal Access Token (PAT)

  1. Go to SmartThings Personal Access Tokens.
  2. Log in with your Samsung Account.
  3. Click Generate new token.
  4. Enter a name for your token and select the authorized scopes (e.g., devices, locations, scenes, rules, schedules).
  5. Click Generate token.
  6. Copy and save the token immediately (it won't be shown again).

Environment Variables

NameDefaultDescription
smartThingsToken, SMARTTHINGS_TOKENBearer token for SmartThings API. Required for SmartThings operations, but server will start without it for tool discovery
stBaseUrl, ST_BASE_URLhttps://api.smartthings.comOverride for testing / mock servers
MCP_LOG_LEVELinfodebug

Installation

Installing via Smithery

To install smartthings-mcp for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @langowarny/smartthings-mcp --client claude

Manual Installation

bash
git clone https://github.com/langowarny/smartthings-mcp.git
cd smartthings-mcp
go mod download

Running

Stdio

bash
SMARTTHINGS_TOKEN=123ab456-xxx... go run ./cmd/server -transport stdio

StreamableHTTP

bash
SMARTTHINGS_TOKEN=123ab456-xxx... \
  go run ./cmd/server -transport stream -host 0.0.0.0 -port 8081

Test request:

bash
curl -X POST http://localhost:8081/mcp/tools/call \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_devices"}}'

SSE

bash
SMARTTHINGS_TOKEN=123ab456-xxx... \
  go run ./cmd/server -transport sse -host 0.0.0.0 -port 8081

# Open event stream
echo -e 'GET /mcp/sse HTTP/1.1\nHost: localhost:8081\n\n' | nc localhost 8081

The server emits smartthings/device_status notifications every 30 seconds.

Tool Catalogue

ToolParamsDescription
list_deviceslocation_id?List user devices
get_devicedevice_idDevice metadata
get_device_statusdevice_idLive status
list_device_capabilitiesdevice_idSupported capabilities
send_device_commanddevice_id, component, capability, command, arguments?[]Issue command
list_locationsList locations
list_roomslocation_idList rooms in a location
create_roomlocation_id, nameCreate a new room
delete_roomlocation_id, room_idDelete a room
list_scenesList all scenes
execute_scenescene_idTrigger scene
list_rulesList automation rules
list_hubsList hubs
get_hub_healthhub_idGet hub health status
list_subscriptionsinstalled_app_idList subscriptions
create_subscriptioninstalled_app_id, device_id, ...Subscribe to device events
delete_subscriptioninstalled_app_id, subscription_idDelete subscription
list_schedulesinstalled_app_idList schedules
create_scheduleinstalled_app_id, name, cronCreate cron schedule
delete_scheduleinstalled_app_id, schedule_idDelete schedule
get_device_historydevice_idGet recent device events
get_capabilitycapability_id, versionGet capability definition

Resource Patterns

URI TemplateDescriptionMIME
st://devices/{device_id}Device metadataapplication/json
st://devices/{device_id}/statusLive statusapplication/json
st://locations/{location_id}Location metadataapplication/json

Development

bash
go vet ./...
go test ./...
go run ./cmd/server -transport stream

Logs are emitted via Uber Zap; adjust MCP_LOG_LEVEL for verbosity.

License

MIT © 2025 Lango Warny

常见问题

SmartThings MCP 是什么?

跨地点控制 SmartThings 设备与场景,获取实时状态和历史记录,并即时下发命令;还能管理房间、规则、日程和事件订阅,实现自动化。

相关 Skills

表格处理

by anthropics

Universal
热门

围绕 .xlsx、.xlsm、.csv、.tsv 做读写、修复、清洗、格式整理、公式计算与格式转换,适合修改现有表格、生成新报表或把杂乱数据整理成交付级电子表格。

做 Excel/CSV 相关任务很省心,能直接读写、修复、清洗和格式转换,尤其擅长把乱七八糟的表格整理成交付级文件。

效率与工作流
未扫描109.6k

PDF处理

by anthropics

Universal
热门

遇到 PDF 读写、文本表格提取、合并拆分、旋转加水印、表单填写或加解密时直接用它,也能提取图片、生成新 PDF,并把扫描件通过 OCR 变成可搜索文档。

PDF杂活别再来回切工具了,文本表格提取、合并拆分到OCR识别一次搞定,连扫描件也能变可搜索。

效率与工作流
未扫描109.6k

Word文档

by anthropics

Universal
热门

覆盖Word/.docx文档的创建、读取、编辑与重排,适合生成报告、备忘录、信函和模板,也能处理目录、页眉页脚、页码、图片替换、查找替换、修订批注及内容提取整理。

搞定 .docx 的创建、改写与精排版,目录、批量替换、批注修订和图片更新都能自动化,做正式文档尤其省心。

效率与工作流
未扫描109.6k

相关 MCP Server

文件系统

编辑精选

by Anthropic

热门

Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。

这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。

效率与工作流
82.9k

by wonderwhy-er

热门

Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。

这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。

效率与工作流
5.8k

EdgarTools

编辑精选

by dgunning

热门

EdgarTools 是无需 API 密钥即可解析 SEC EDGAR 财报的开源 Python 库。

这个工具解决了金融数据获取的痛点——直接让 AI 读取结构化财报,比如让 Claude 分析苹果的 10-K 文件。适合量化分析师或金融开发者快速构建数据管道。但注意,它依赖 SEC 网站稳定性,高峰期可能延迟。

效率与工作流
1.9k

评论