ESP32 -air-conditioner
Turn your Air Conditioner on/off and control it from a Chatbot application using this MCP server running on an ESP32 microcontroller
claude mcp add --transport stdio mrlaki5-esp32-mcp-air-conditioner arduino --upload ESP32-MCP-air-conditioner.ino \ --env AC_IR_PIN="GPIO_NUM" \ --env WIFI_SSID="your-ssid" \ --env IR_PROTOCOL="required if using IR control (e.g., NEC, RC6)" \ --env AC_POWER_PIN="GPIO_NUM" \ --env MCP_SERVER_IP="0.0.0.0" \ --env WIFI_PASSWORD="your-password" \ --env MCP_SERVER_PORT=" MCP port if applicable"
How to use
This MCP server runs on an ESP32 and exposes MCP-compatible endpoints to control an air conditioner via IR or a relay. After flashing the Arduino-based firmware, the ESP32 connects to your Wi‑Fi network and becomes a bridge between your chatbot or MCP client and the AC. Use the MCP client to send intents like power on/off, set temperature, or change modes. The server maps those intents to IR signals or relay commands so you can control the AC remotely from chat or voice interfaces. You can customize the supported commands in the Arduino sketch to fit your specific AC model and its remote protocol.
How to install
Prerequisites:
- A ESP32 development board
- USB cable to program the ESP32
- Arduino IDE installed or a compatible ESP32 toolchain
- ESP32 board support added to the Arduino IDE
- Optionally IRremoteESP8266 and ArduinoJson libraries (installed via Library Manager)
Step-by-step:
- Clone this repository to your computer.
- Open ESP32-MCP-air-conditioner.ino in the Arduino IDE.
- Configure Wi‑Fi credentials and any AC-specific settings in the code (WIFI_SSID, WIFI_PASSWORD, IR/relay pin assignments, and MCP settings).
- Connect the ESP32 to your computer via USB.
- Select the correct ESP32 board and port in the Arduino IDE.
- Upload the sketch to the ESP32.
- Power the ESP32 and ensure it connects to your Wi‑Fi network. Use your MCP client or chatbot to send control commands to the ESP32's IP address.
If you prefer, you can adapt the provided sketch to a different development workflow, but the steps above outline the typical Arduino-based deployment.
Additional notes
Notes and tips:
- Ensure the IR LED or relay wiring matches the pins defined in the sketch (AC_POWER_PIN, AC_IR_PIN).
- Some air conditioners use different IR protocols; update IR_PROTOCOL in the code if needed.
- If the ESP32 cannot reach your Wi‑Fi network, check router settings and ensure the ESP32 is on the same network.
- The mcp.json configuration file referenced by the firmware is required by the MCP framework; ensure it’s present and correctly formatted in your project.
- If you encounter library conflicts, install compatible versions via the Arduino Library Manager (ArduinoJson and IRremoteESP8266 are common requirements).
- For chatbot integration, expose intents like power_on, power_off, set_temperature, and set_mode; map them to the corresponding MCP commands in the sketch.
Related MCP Servers
xiaozhi-esp32
An MCP-based chatbot | 一个基于MCP的聊天机器人
py-xiaozhi
A Python-based Xiaozhi AI for users who want the full Xiaozhi experience without owning specialized hardware.
xiaozhi-esp32 -java
小智ESP32的Java企业级管理平台,提供设备监控、音色定制、角色切换和对话记录管理的前后端及服务端一体化解决方案
Unreal_mcp
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal Engine through the native C++ Automation Bridge plugin. Built with TypeScript, C++, and Rust (WebAssembly) for ultra-high-performance game development automation.
esp
Centralize ESP32 related commands and simplify getting started with seamless, LLM-driven interaction and help.
openfoam
LLM-powered OpenFOAM MCP server for intelligent CFD education with Socratic questioning and expert error resolution