SmartThings MCP Server
Allows interaction with the SmartThings platform, providing tools to manage devices, scenes, locations, notifications, and automations (Rules/Routines) with full CRUD operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SmartThings MCP ServerTurn off the living room lights."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SmartThings MCP Server
An MCP server for Samsung SmartThings, exposing devices, scenes, notifications and full CRUD on Rules (Routines) over streamable-HTTP.
Built with FastMCP. OAuth2 with automatic token refresh — no expiring Personal Access Tokens anywhere.
Why
Most SmartThings MCP servers only read devices and fire scenes. This one also creates, updates, deletes and executes Rules, the automation engine behind Routines — which is what you actually need to let an LLM build home automations.
Related MCP server: SmartThingsMCP
⚠️ Rules vs Routines — read this before filing a bug
Thing | Visible via API? | Manageable? |
Rules created by this server ( | ✅ | ✅ full CRUD + execute |
Routines created in the SmartThings phone app | ❌ never | ❌ app only |
list_rules returning [] is expected if you have only ever created Routines in
the mobile app. It is not an authentication failure. This is a documented Samsung
platform limitation that no client can work around:
"Automatic routines ("rules") you create in the SmartThings app are a superset of what you can create with the Rules API. Routines created in the app will not appear when sending a GET request to
https://api.smartthings.com/v1/rules/." — SmartThings docs
Tools
Group | Tools |
Devices |
|
Scenes |
|
Locations |
|
Notifications |
|
Rules |
|
Scenes are read-only by design. SmartThings exposes no write scope for scenes
(w:scenes is rejected outright), so scenes can be listed and executed but never
authored through the API.
Listing and controlling devices
Building an automation
Device names, IDs and rule IDs in these examples are fictional.
Setup
Create an OAuth-In SmartApp with these scopes:
r:devices:* x:devices:* r:scenes:* x:scenes:* r:locations:* r:rules:* w:rules:* x:rules:*Configure credentials:
cp .env.example .env # fill in SMARTTHINGS_CLIENT_ID and SMARTTHINGS_CLIENT_SECRETAuthorize once to mint the refresh token:
python oauth_setup.pyThis opens a local loopback listener (default port
9444) and writesdata/tokens.json. If your SmartThings app requires a public HTTPS callback instead, useoauth_capture.pywithOAUTH_REDIRECT_URIset.Run it:
docker compose up -d --buildThe server listens on
http://localhost:8085/mcp.
Client configuration
{
"mcpServers": {
"smartthings": {
"type": "http",
"url": "http://localhost:8085/mcp"
}
}
}The server is stateless streamable-HTTP: POST JSON-RPC with
Accept: application/json, text/event-stream. No mcp-session-id header is
required; responses are returned as SSE (event: message\ndata: {...}).
Writing rules
rule_json is a JSON string containing the Rules API actions array only —
name and locationId are added by the tool.
Schema: https://developer.smartthings.com/docs/rules/rules-api
A harmless rule, safe to use when validating execute_routine:
[{"if": {"equals": {"left": {"integer": 1}, "right": {"integer": 1}},
"then": [{"sleep": {"duration": {"value": {"integer": 1}, "unit": "Second"}}}]}}]A real rule — when one switch turns on, turn another off:
[{"if": {"equals": {
"left": {"device": {"devices": ["<deviceId>"], "component": "main",
"capability": "switch", "attribute": "switch"}},
"right": {"string": "on"}},
"then": [{"command": {"devices": ["<otherDeviceId>"],
"commands": [{"component": "main", "capability": "switch", "command": "off"}]}}]}}]⚠️
execute_routineruns the rule's actions for real, immediately. It does not simulate. If any of your devices are power switches for machines you care about, validate with thesleeprule above rather than acommandaction.
Authentication notes
OAuth2 only. data/tokens.json must contain all three of access_token,
refresh_token, and a real future expires_at. A background keep-alive loop
(KEEPALIVE_HOURS, default 12h) refreshes proactively so the refresh token never goes
stale through disuse.
Personal Access Tokens are intentionally not supported. Since December 2024, SmartThings PATs expire 24 hours after creation, making them unusable for a long-running server. There is no PAT fallback and no PAT setting — every request, including all Rules calls, uses the auto-refreshing OAuth token.
Troubleshooting
401 on rules calls. In order:
Check
data/tokens.jsonhas all three keys and a futureexpires_at.Confirm
locationIdis being sent — SmartThings returns a bare-HTML 401 (not a 400) whenlocationIdis missing from/rulesrequests, which makes a simple missing-parameter bug look like an auth failure.Restart the container to force a refresh.
Last resort: re-run
oauth_setup.py.
Endpoint quirks (already handled — don't "correct" them back):
create:
POST /rules?locationId=...execute:
POST /rules/execute/{ruleId}?locationId=...(not/rules/{id}/execute)
Container reports unhealthy. The MCP endpoint only answers POST, so an
HTTP healthcheck against / returns 404. Use the TCP check in docker-compose.yml.
Env changes not taking effect. docker compose up -d --force-recreate — a plain
docker restart will not re-read .env.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables control and monitoring of SmartThings smart home devices through natural language, supporting switches, sensors, refrigerators, and other IoT devices with real-time status queries and command execution.
- AlicenseNot gradedqualityCmaintenanceEnables 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.MIT
- AlicenseBqualityBmaintenanceEnables control of ECHONETLite home automation devices like air conditioners and sensors via MCP, supporting HVAC management and real-time monitoring.141MIT
- AlicenseBqualityAmaintenanceEnables control of Matter smart-home devices via REST and MCP APIs, supporting lights, sensors, and AC units with federation capabilities.23MIT
Related MCP Connectors
Manage SRG+ hubs, channels, content, assets, users, and workspaces from any MCP-aware AI agent.
Create and manage CodeQR short links, QR codes, and analytics from any MCP client.
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gil906/samrtthings-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server