smartthings-mcp

langowarny/smartthings-mcp

3.2

If you are the rightful owner of smartthings-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Lango SmartThings MCP Server is a Model Context Protocol server that integrates with Samsung SmartThings Public API, providing tools, resources, and real-time events in an LLM-friendly manner.

Tools
22
Resources
0
Prompts
0

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:

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

Manual Installation

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

Running

Stdio

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

StreamableHTTP

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

Test request:

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

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

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