
Shelly Smart Home
io.github.Buggy1111由 GitHub 账号 Buggy1111 发布v0.1.3更新于 Oct 25, 2026
Local-first MCP server for Shelly smart-home devices (Gen1-Gen4): control, energy, automation.
概览
面向 Shelly 智能家居设备(Gen1–Gen4)的本地优先 MCP 服务器,让助手在局域网内发现、读取、控制和自动化设备。
- 可以做什么
- 发现设备并读取版本、信息、状态、配置、组件与方法,配置输出中的凭据会被遮蔽,状态经过规范化。控制开关、灯(RGBW/CCT/白光)和窗帘,所有变更操作都会记录审计日志。读取实时与历史能耗数据。提供只读的通用 RPC 引擎和带门控的写入引擎,覆盖完整 API。在 Gen2+ 设备上管理定时计划、系统操作、键值存储、Webhook、设备端脚本和虚拟组件。定义并运行存放在本地场景文件中的命名多设备场景。
- 适用场景
- 当你希望助手操作自己局域网内的 Shelly 智能家居硬件——开关灯、移动窗帘、查看能耗或设置定时与场景——而不是仅依赖云端集成时使用。适合拥有 Shelly 设备、想要本地控制并可选云端回退以在局域网外访问的用户。
- 运行要求
- 以 Python 包形式在本地运行(uvx 或 pip install)。运行机器需与设备处于同一局域网;在 WSL 或容器中 mDNS 自动发现通常不可用,因此可在用户配置目录下的配置文件中按 IP 配置设备。设备密码可在配置中按设备设置,或通过 SHELLY_PW_ 环境变量提供;云端回退需要 SHELLY_CLOUD_AUTH_KEY。配置文件若含密钥必须 chmod 600。
安装
在 SourceWeft 中
- 打开 控制台中的 Shelly Smart Home,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
shelly-mcp
mcp-name: io.github.Buggy1111/shelly-mcp
MCP server for the entire Shelly smart-home ecosystem — read, control, and automate Shelly devices of every generation (Gen1 → Gen4; BLU via its gateway or the generic RPC engine, dedicated BLU tools are on the roadmap) from any MCP client (Claude Desktop, Claude Code, Cursor, …). Local-first (zero rate-limit, ~10 ms, full API), with cloud fallback for off-LAN access.
⚠️ Unofficial community project. Not affiliated with, endorsed by, or sponsored by Allterco Robotics / Shelly. "Shelly" is a trademark of its respective owner.
🚧 Alpha / in development. See
docs/for the full design.
Why
The only existing Shelly MCP servers are cloud-only and minimal. shelly-mcp unifies Gen1 and Gen2+ behind one tool surface, covers energy monitoring and automation (schedules, scripts, webhooks, KVS), and auto-discovers any device's capabilities — including hardware released after this server was written.
Install
Register in your MCP client:
Configure
Auto-discovery (mDNS) finds devices on your local subnet — shelly_discover and you're running. For named devices ("turn off the kitchen"), devices on other subnets, passwords, or the cloud fallback, create ~/.config/shelly-mcp/config.yaml (chmod 600):
Full reference: config.example.yaml and docs/04-CONFIG-AND-DEPLOY.md.
What data leaves your machine
None, beyond the calls to your own Shelly devices (on your LAN) and — only if you enable it — your own Shelly Cloud account. No telemetry, no phone-home.
Capabilities (local vs cloud)
Tools, resources & prompts
Read (safe): shelly_version · shelly_discover · shelly_list_devices · shelly_get_info · shelly_get_status (normalized) · shelly_get_config (credentials masked) · shelly_list_components · shelly_list_methods
Control (audited): shelly_switch_set · shelly_switch_toggle · shelly_light_set (RGBW/CCT/white) · shelly_cover_move
Energy: shelly_energy_live · shelly_energy_history
Generic engine (total coverage): shelly_rpc (read-only) · shelly_rpc_write (mutations, confirm:true + data-loss double-gate)
System / schedules (gated): shelly_system_reboot|update|set_auth · shelly_schedule_list|create|update|delete
Automation (Gen2+ local-only): shelly_kvs_* (key-value store) · shelly_webhook_* (event→HTTP) · shelly_script_* (on-device JS — list/get_code/create/put_code/start/stop/eval/delete, chunked upload) · shelly_virtual_* (virtual components). Deletes + arbitrary-code paths (script_put_code/eval) are confirm:true-gated.
Scenes (deterministic, named): shelly_scene_list|get|run|create|delete — define a multi-device routine once and run it by name (shelly_scene_run "film"), identical every time and schedulable from any client. Stored in ~/.config/shelly-mcp/scenes.yaml (see scenes.example.yaml); scenes and schedules accept only plain control methods (Switch/Light/RGB(W)/CCT/Cover) — never Script.Eval, SetAuth, or anything destructive (ADR-007, docs/06-SCENES.md).
Resources: shelly://devices, shelly://device/{name}/status — Prompts: shelly_evening_scene, shelly_energy_report, shelly_diagnose
Safety: reads are
readOnlyHint; every mutation is audit-logged; the generic write tool and destructive system tools require explicitconfirm:true, and irreversible methods (factory reset, wipe-all) need a secondi_understand_data_lossgate — so even a hijacked LLM can't silently destroy a device.
Troubleshooting
- "Device unreachable" — confirm the IP (
shelly_discover, your router's client list, or the Shelly app → device → Settings → Device information), and that the machine running the server is on the same LAN. In WSL/containers, mDNS discovery usually doesn't work — configure devices byipin the config file instead (that path needs no mDNS). - "Auth required" — the device has a password: add
password:under the device in the config (orSHELLY_PW_<name>env var). - Cloud-only device refuses automation tools — expected: the Shelly Cloud API can't manage schedules/scripts/webhooks/KVS; connect locally for those.
- Config refuses to load — if it contains a secret, it must be
chmod 600(deliberate, fail-closed).
Docs
Full design in docs/ (indexed): overview, architecture (+ADRs), tool surface, security, scenes, config/deploy, build plan, project log, roadmap, the launch runbook, and the complete Shelly API catalog.
License
MIT — see LICENSE.
来源:README.md,提交 48372bd
工具
0版本历史
2- v0.1.3最新Oct 16, 2026
- v0.1.2Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分