Tuya MCP Server
Home → Docs
An MCP server that lets AI assistants control your Tuya smart home devices over the internet.
Connection
Endpoint: POST /mcp (Streamable HTTP transport)
Credentials are passed as HTTP headers on every request:
| Header | Required | Description |
X-Tuya-Access-Id | Yes | Your Tuya IoT Platform Access ID |
X-Tuya-Access-Secret | Yes | Your Tuya IoT Platform Access Secret |
X-Tuya-Region | No | us (default), eu, cn, or in |
Device Discovery & Info
| Tool | Description |
list_devices | List all devices — name, id, category, online status |
get_device_status | Current status/properties of a device (on/off, brightness, etc.) |
get_device_info | Detailed metadata — firmware, model, IP, signal |
get_device_specification | Capability schema — available commands, value types and ranges |
Device Control
| Tool | Description |
control_device | Send commands to a device (on/off, brightness, color, mode, etc.) |
control_device_group | Send commands to all devices in a group |
Scenes & Automations
| Tool | Description |
list_scenes | List tap-to-run scenes in a home |
trigger_scene | Execute a scene |
list_automations | List automation rules in a home |
enable_automation | Turn on an automation rule |
disable_automation | Turn off an automation rule |
Home & Spaces
| Tool | Description |
list_homes | List all homes linked to the account |
list_rooms | List rooms in a home |
list_device_groups | List device groups in a home |
Typical Workflow
1. list_homes → get your home_id
2. list_devices → find devices and their IDs
3. get_device_specification → see what commands a device accepts
4. control_device → send commands (e.g. turn on a light)
5. list_scenes → find scenes
6. trigger_scene → run "Movie Night" or "Good Morning"
Setup
{
"mcpServers": {
"tuya": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-server.herokuapp.com/mcp",
"--header",
"X-Tuya-Access-Id:${TUYA_ACCESS_ID}",
"--header",
"X-Tuya-Access-Secret:${TUYA_ACCESS_SECRET}",
"--header",
"X-Tuya-Region:${TUYA_REGION}"
],
"env": {
"TUYA_ACCESS_ID": "your_access_id",
"TUYA_ACCESS_SECRET": "your_access_secret",
"TUYA_REGION": "us"
}
}
}
}