tuya-infrared-mcp
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., "@tuya-infrared-mcpTurn on the air conditioner"
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.
Tuya Infrared MCP Server
English | 中文
A Model Context Protocol (MCP) server that allows AI assistants to control devices through Tuya infrared remote control.
Features
🎮 Control devices via Tuya infrared remote control
🔌 MCP protocol support (Streamable HTTP)
🌐 RESTful API with health check endpoint
⚙️ Easy configuration via environment variables
🔒 Secure credential management
Related MCP server: MCP Remote Control
Prerequisites
Node.js >= 14.0.0
Tuya IoT Platform account
Tuya infrared remote control device
Learned IR codes for your target device
Quick Start
1. Install Dependencies
npm install2. Configure Environment Variables
Copy .env.example to .env and fill in your credentials:
cp .env.example .envEdit .env:
TUYA_BASE_URL=https://openapi.tuyacn.com
TUYA_ACCESS_ID=your_access_id_here
TUYA_ACCESS_SECRET=your_access_secret_here
TUYA_DEVICE_ID=your_device_id_here
TUYA_REMOTE_ID=your_remote_id_here
TUYA_CATEGORY_ID=13
KEY_SWITCH=your_switch_key_here
KEY_MODE_15MIN=your_mode_key_here
PORT=30363. Run Server
npm startServer will run on http://localhost:3036
How to Get Tuya Credentials
Step 1: Create Tuya IoT Platform Account
Go to Tuya IoT Platform
Register and create a new project
Choose "Custom Development"
Select data center (e.g., China)
Step 2: Get API Credentials
Go to your project dashboard
Navigate to "Overview" → "Authorization Key"
Copy
Access IDandAccess Secret
Step 3: Enable Infrared API Service
Go to "Service API" tab
Search for "Infrared Remote Control" (万能红外开放能力)
Enable the service
Step 4: Link Your Device
Add your Tuya infrared remote to Tuya Smart App
Go to project "Devices" tab
Click "Link Tuya App Account"
Link your Tuya Smart App account
Your device will appear in the device list
Step 5: Get Device Information
Use the test script to get device info:
const { TuyaContext } = require('@tuya/tuya-connector-nodejs');
const context = new TuyaContext({
baseUrl: 'https://openapi.tuyacn.com',
accessKey: 'your_access_id',
secretKey: 'your_access_secret'
});
// Get device list
const devices = await context.request({
path: '/v1.0/devices',
method: 'GET'
});
console.log(devices);Step 6: Learn IR Codes
Use Tuya Smart App to learn IR codes from your device's remote
Use API to get learned keys:
// Get remote list
const remotes = await context.request({
path: `/v1.0/infrareds/${DEVICE_ID}/remotes`,
method: 'GET'
});
// Get learned keys for a remote
const keys = await context.request({
path: `/v1.0/infrareds/${DEVICE_ID}/remotes/${REMOTE_ID}/keys`,
method: 'GET'
});
console.log(keys);MCP Configuration
For Claude Desktop / Claude Code
Add to your MCP configuration file:
{
"mcpServers": {
"tuya-infrared": {
"transport": {
"type": "streamable-http",
"url": "http://localhost:3036/mcp"
}
}
}
}For Remote Access
If running on a server:
{
"mcpServers": {
"tuya-infrared": {
"transport": {
"type": "streamable-http",
"url": "http://your-server-ip:3036/mcp"
}
}
}
}Note: Make sure to open port 3036 in your firewall.
API Endpoints
Health Check
GET /healthResponse:
{
"status": "ok",
"service": "tuya-infrared-mcp"
}MCP Endpoint
POST /mcp
Content-Type: application/jsonAvailable MCP Tools
send_infrared
Send infrared signal to control your device.
Parameters:
action(string): Action typeswitch: Toggle power switchmode_15min: Change to 15-minute mode
Example:
// In AI assistant
send_infrared({ action: "switch" })
send_infrared({ action: "mode_15min" })Limitations
Infrared signal requires line-of-sight
Distance limitation (typically 1-3 meters)
Remote control must be powered on
Cannot work through walls or obstacles
Troubleshooting
"Sign Invalid" Error
Check if your Access Secret is correct
Make sure you linked your Tuya Smart App account to the project
"API Not Subscribed" Error
Enable "Infrared Remote Control" service in your project
Connection Timeout
Check if port 3036 is open
Verify server is running
Check firewall settings
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments
Built with Tuya IoT Platform
Based on Model Context Protocol
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
AlicenseBqualityFmaintenanceA control server that enables AI assistants to interact with Ecovacs robot vacuums through MCP protocol, supporting device listing, cleaning control, charging control, and status queries.424MIT- FlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to control TVs on a local network through natural language commands. It currently supports Roku devices, allowing users to launch apps, manage playback, and navigate menus.5
- Alicense-qualityDmaintenanceA powerful MCP server that enables AI assistants to discover, commission, and control Matter-compatible smart home devices through a standardized interface.98MIT
- Alicense-qualityCmaintenanceAn MCP server that enables AI assistants to control Home Assistant via natural language, including device control, automation management, and system configuration.MIT
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for AI dialogue using various LLM models via AceDataCloud
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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/1124823599331l-boop/tuya-infrared-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server