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:

HeaderRequiredDescription
X-Tuya-Access-IdYesYour Tuya IoT Platform Access ID
X-Tuya-Access-SecretYesYour Tuya IoT Platform Access Secret
X-Tuya-RegionNous (default), eu, cn, or in

Device Discovery & Info

ToolDescription
list_devicesList all devices — name, id, category, online status
get_device_statusCurrent status/properties of a device (on/off, brightness, etc.)
get_device_infoDetailed metadata — firmware, model, IP, signal
get_device_specificationCapability schema — available commands, value types and ranges

Device Control

ToolDescription
control_deviceSend commands to a device (on/off, brightness, color, mode, etc.)
control_device_groupSend commands to all devices in a group

Scenes & Automations

ToolDescription
list_scenesList tap-to-run scenes in a home
trigger_sceneExecute a scene
list_automationsList automation rules in a home
enable_automationTurn on an automation rule
disable_automationTurn off an automation rule

Home & Spaces

ToolDescription
list_homesList all homes linked to the account
list_roomsList rooms in a home
list_device_groupsList 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"
      }
    }
  }
}