Labsco
langowarny logo

SmartThings MCP

โ˜… 4

from langowarny

Samsung Smartthings Model Context Protocol Server

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedPaid serviceNeeds API keys

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

Environment Variables

NameDefaultDescription
smartThingsToken, SMARTTHINGS_TOKENโ€“Bearer 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

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_locationsโ€“List locations
list_roomslocation_idList rooms in a location
create_roomlocation_id, nameCreate a new room
delete_roomlocation_id, room_idDelete a room
list_scenesโ€“List all scenes
execute_scenescene_idTrigger scene
list_rulesโ€“List automation rules
list_hubsโ€“List 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

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

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