What is Sonoff MCP Server?
Sonoff MCP Server, by the GitHub user mrkutin, lets an MCP client control Sonoff devices through the eWeLink Cloud API (CoolKit Open Platform v2). It has five tools: list_devices, get_device, switch_device, get_sensor_data and set_thermostat. Devices are addressed by a partial, case-insensitive name, and the server reads each device's eWeLink parameters to treat switches, thermostats and sensors through one model; the README names the THR316D, MINIR4, SV and BASICR2.
It is a Python 3.12 FastMCP server run with Docker Compose behind your own HTTPS reverse proxy, so hosted clients such as claude.ai can reach it, with OAuth 2.0 and PKCE between the client and the server. Its author uses it as the device layer behind an AI phone assistant. The code has nine commits between February and July 2026; the repository appeared on GitHub on 13 November 2026 with no stars, no releases and no licence file.
How to install Sonoff MCP Server
git clone https://github.com/mrkutin/sonoff-mcp && cp .env.example .env && docker compose up -dIs Sonoff MCP Server worth it?
There is no vendor MCP server for Sonoff, and the one earlier community eWeLink server we found, 991glasses/ewelink-mcp-server, has had no commit since June 2025. This one is current and small: five tools that list devices, read temperature and humidity, switch devices on or off and set a thermostat to heat, cool, dry or off with thresholds. Switching a thermostat on or off also turns off its automatic mode. A Sonoff relay can be wired to anything from a lamp to a heater or a pump, so switch_device is as consequential as whatever is on the other end.
Every command goes to the cloud. The chain is AI client, your server, eWeLink's cloud in the eu, us, as or cn region, then the device; nothing talks to devices on your network directly, so commands fail when the internet or eWeLink is down, and device data sits under eWeLink's privacy policy. The server owner authorises an eWeLink account once through a setup page, and the server keeps that account's tokens in a file on a Docker volume, along with the MCP tokens it issues, written with 0600 permissions.
Access control is the weak point. Client sign-in is real OAuth with PKCE, but the login page asks for a single client ID and secret set in the server's environment, so anyone who knows them controls every device on the eWeLink account; there are no users, scopes or read-only tools. An optional MCP_API_KEY acts as a bearer token that never expires, added for machine-to-machine calls. The code shows care, with timing-safe comparisons, HTML escaping and a region whitelist, but it has had no outside review, no tests in the repository and only one author.
The missing licence matters as much as the code. Without one, the author has granted no right to copy or modify it, so a business should ask before building on it. For a homeowner with a few Sonoff devices it is a readable example of a remote MCP connector done carefully; for most people, Home Assistant with the SonoffLAN integration and its own MCP server gives local control and finer permissions.
Where it earns its place
A developer with a Sonoff THR316D thermostat and two smart relays
Turn the heating on from Claude on the way home
Register a free personal app at dev.ewelink.cc, run the container behind an HTTPS proxy, authorise eWeLink once, then add the server as a Claude connector. Expect an evening of setup; there is no hosted version.
A maker building a voice or phone assistant
Give an LLM a small, safe set of device actions
Call the five tools with MCP_API_KEY, as the author's own phone assistant does. Rotate that key yourself, since it never expires, and keep relays on critical loads off the eWeLink account the server uses.
Before you commit
- Setup
- Register an app at dev.ewelink.cc for an app ID and secret, copy .env.example to .env with those, an MCP client ID and secret and your public URL, run docker compose up -d behind a TLS reverse proxy, then open /ewelink/setup once to authorise your eWeLink account.
- Integrations
- Five tools: list_devices, get_device, switch_device, get_sensor_data and set_thermostat. Streamable HTTP for Claude Code, claude.ai and other remote MCP clients. Upstream is eWeLink Cloud API v2 only; no LAN control and no eWeLink CUBE support.
- Data and privacy
- Holds an eWeLink app secret, the account's OAuth tokens and its own MCP tokens on a Docker volume (token files written 0600). Device names, states and readings pass through eWeLink's cloud and to the AI provider. Anyone with the MCP client secret or MCP_API_KEY can switch every device on the account.
- Cost at scale
- Free apart from hosting. eWeLink's personal developer tier is free but OAuth-only, with a limited number of API calls and no stability guarantee; commercial use needs eWeLink's paid enterprise tier, priced on request.
- Limits
- One eWeLink account per server and one shared client credential. Offline devices get two retries two seconds apart, then an error. MCP access tokens last 24 hours and refresh tokens are not supported, so clients sign in again daily.
What’s good
- Works with hosted clients through OAuth 2.0 and PKCE
- Name-based device lookup across switches and thermostats
- Retries commands to devices that drop offline
- Short, readable codebase with security fixes in its history
What’s not
- One shared client secret controls every device
- No read-only mode, scopes or per-device limits
- Cloud-only; fails when eWeLink or the internet is down
- No licence, releases, tests or other users yet
Best for
Developers with Sonoff devices on eWeLink who want a small, readable remote MCP connector to adapt for their own use.
Sonoff MCP Server alternatives
Sonoff MCP Server: common questions
- Is Sonoff MCP Server worth it?
- A tidy personal project that does switch real Sonoff devices from Claude, but one shared password, no read-only mode and no licence make it a starting point rather than something to install as is. We rate it 2.9 out of 5.
- How much does Sonoff MCP Server cost?
- Free to run; the source has no licence file. eWeLink's personal developer tier is free, with limited API calls.
- What are the downsides of Sonoff MCP Server?
- One shared client secret controls every device; no read-only mode, scopes or per-device limits; cloud-only; fails when eWeLink or the internet is down; no licence, releases, tests or other users yet.
- Who is Sonoff MCP Server best for?
- Developers with Sonoff devices on eWeLink who want a small, readable remote MCP connector to adapt for their own use.
- How much does Sonoff MCP Server cost for a team or in production?
- Free apart from hosting. eWeLink's personal developer tier is free but OAuth-only, with a limited number of API calls and no stability guarantee; commercial use needs eWeLink's paid enterprise tier, priced on request.
- Is Sonoff MCP Server safe for company data?
- Holds an eWeLink app secret, the account's OAuth tokens and its own MCP tokens on a Docker volume (token files written 0600). Device names, states and readings pass through eWeLink's cloud and to the AI provider. Anyone with the MCP client secret or MCP_API_KEY can switch every device on the account.
- What are the best Sonoff MCP Server alternatives?
- The closest alternatives we have reviewed are Home Assistant MCP Server, HA-MCP and Aqara MCP Server.
Answers checked Nov 16, 2026.