IntegrateIntegrate
Integrations

Tuya Integration

Manage Tuya list devices, get device, get device status, send device commands, list scenes

The Tuya integration provides access to manage Tuya list devices, get device, get device status, send device commands, list scenes through the Integrate MCP server.

Installation

The Tuya integration is included with the SDK:

import { tuyaIntegration } from "integrate-sdk/server";

Setup

1. Create a Tuya OAuth App

  1. Create an OAuth application for Tuya
  2. Configure your redirect URI
  3. Note your Client ID and Client Secret

2. Configure the Integration on Your Server

Add the Tuya integration to your server configuration. The integration automatically reads TUYA_CLIENT_ID and TUYA_CLIENT_SECRET from your environment variables:

import { createMCPServer, tuyaIntegration } from "integrate-sdk/server";

export const { client: serverClient } = createMCPServer({
  apiKey: process.env.INTEGRATE_API_KEY,
  integrations: [
    tuyaIntegration({
      scopes: ["device:read", "device:write", "home:read", "scene:read", "scene:write"], // Optional
    }),
  ],
});

You can override the environment variables by passing explicit values:

tuyaIntegration({
  clientId: process.env.CUSTOM_TUYA_ID,
  clientSecret: process.env.CUSTOM_TUYA_SECRET,
      scopes: ["device:read", "device:write", "home:read", "scene:read", "scene:write"], // Optional
});

3. Client-Side Usage

The default client automatically includes all integrations. You can use it directly:

import { client } from "integrate-sdk";

await client.authorize("tuya");
const result = await client.tuya.listDevices({
  user_id: "value",
});

console.log(result);

If you're using a custom client, add the integration to the integrations array:

import { createMCPClient, tuyaIntegration } from "integrate-sdk";

const customClient = createMCPClient({
  integrations: [tuyaIntegration()],
});

Configuration Options

Prop

Type

Default Scopes

These defaults are applied unless you override scopes in the integration config:

  • device:read
  • device:write
  • home:read
  • scene:read
  • scene:write

Tools

tuya_list_devices

List devices

Prop

Type

tuya_get_device

Get device

Prop

Type

tuya_get_device_status

Get device status

Prop

Type

tuya_send_device_commands

Send device commands

Prop

Type

tuya_list_scenes

List scenes

Prop

Type

Notes

  • Category: Lifestyle
  • Authentication mode: OAuth

On this page