A comprehensive SDK that empowers developers to integrate their custom capabilities with Tuya Cloud through the standardized Model Context Protocol (MCP), ensuring seamless connectivity and interoperability.
🚀 Quick Start • 📖 Documentation • 🛠️ Examples
- 🔌 Easy Integration: Simple SDK for connecting Tuya Developer Platform to MCP servers
- 🐍 Multi-Language Support: Available in Python and Go
- 🔒 Secure Authentication: Robust authentication with Tuya Cloud
- 📱 Real-time Communication: WebSocket-based real-time interaction
- 🎯 Production Ready: Comprehensive error handling and retry mechanisms
The Tuya MCP SDK bridges the gap between Custom MCP Server and Tuya Developer Platform by implementing the Model Context Protocol standard:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Your App │───▶│ MCP SDK │───▶│ MCP Gateway │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ MCP Server │
└──────────────────┘
- Tuya Developer Account with MCP service enabled
- Python >= 3.10 and pip >= 21.3, or Go >= 1.24
- Access credentials (Access ID, Access Secret, Endpoint)
- Visit Tuya Developer Platform
- Navigate to MCP Management → Custom MCP Service
- Create a new MCP service and note down your credentials
- Follow the detailed setup instructions
# Clone the repository
git clone https://github.com/tuya/tuya-mcp-sdk.git
cd tuya-mcp-sdk/mcp-python
# Install dependencies
pip install -e .
# Run the example
python examples/quick_start.pyPython SDK Usage:
from mcp_sdk import create_mcpsdk
# Initialize SDK
async with create_mcpsdk(
endpoint="your-endpoint",
access_id="your-access-id",
access_secret="your-access-secret",
custom_mcp_server_endpoint="http://localhost:8765/mcp"
) as sdk:
# Your MCP server is now connected to Tuya Cloud!
await sdk.run()# Navigate to Go SDK
cd tuya-mcp-sdk/mcp-golang
# Install dependencies
go mod tidy
# Run the example
go run examples/main.goGo SDK Usage:
import "mcp-sdk/pkg/mcpsdk"
// Initialize SDK
mcpsdk, err := sdk.NewMCPSdk(
sdk.WithMCPServerEndpoint("http://localhost:8765/mcp"),
sdk.WithAccessParams("access-id", "access-secret", "endpoint"),
)
if err != nil {
log.Fatal(err)
}
// Start the SDK
err = mcpsdk.Run()| Resource | Description |
|---|---|
| 📋 Setup Instructions | Complete setup guide for Tuya Developer Platform |
| 🐍 Python SDK Docs | Python SDK documentation and examples |
| 🐹 Go SDK Docs | Go SDK documentation and examples |
| 🏗️ Architecture | System architecture diagrams |
tuya-mcp-sdk/
├── 📄 README.md # This file
├── 📄 License # Apache 2.0 License
├── 📁 docs/ # Documentation
│ ├── instructions.md # Setup instructions
│ └── architecture_diagram/ # Architecture diagrams
├── 📁 mcp-python/ # Python SDK
│ ├── src/mcp_sdk/ # Core SDK modules
│ ├── examples/ # Python examples
│ └── README.md # Python-specific docs
└── 📁 mcp-golang/ # Go SDK
├── pkg/ # Go packages
├── examples/ # Go examples
└── README.md # Go-specific docs
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- 📚 Documentation: Check our docs for detailed guides
- 🐛 Bug Reports: Open an issue
- 💬 Questions: Tuya Developer Community
- 🏢 Enterprise: Contact Tuya Support