MCP server for the entire Shelly smart-home ecosystem (Gen1-Gen4 + BLU) — local-first, with cloud fallback. Unofficial community project.
Project description
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
uvx shelly-mcp # or: pip install shelly-mcp
Register in your MCP client:
{ "mcpServers": { "shelly": { "command": "uvx", "args": ["shelly-mcp"] } } }
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):
devices:
televize:
ip: 192.168.0.101
location: obývák # lets "turn off the living room" work
# password: "..." # only if the device has auth (or env SHELLY_PW_televize)
cloud:
enabled: false # optional off-LAN fallback
# auth_key via env SHELLY_CLOUD_AUTH_KEY
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)
| Local | Cloud | |
|---|---|---|
| Discovery, status, control | ✅ | ⚠️ control + status only |
| Energy live + history | ✅ | ⚠️ live only |
| Automation (schedules/scripts/webhooks/KVS) | ✅ | ❌ |
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shelly_mcp-0.1.2.tar.gz.
File metadata
- Download URL: shelly_mcp-0.1.2.tar.gz
- Upload date:
- Size: 269.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
628e070b82b8f5726f3bc6e79b21c6dda90d3aa6456d1f402c55e819a0f7cf2f
|
|
| MD5 |
3c22bf2f40a1f573d59a71a21c0a3fa3
|
|
| BLAKE2b-256 |
1ad8501ca99fea083863531d312ab07aae076816a21e447e81dbdf0bb3c7cf25
|
Provenance
The following attestation bundles were made for shelly_mcp-0.1.2.tar.gz:
Publisher:
release.yml on Buggy1111/shelly-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shelly_mcp-0.1.2.tar.gz -
Subject digest:
628e070b82b8f5726f3bc6e79b21c6dda90d3aa6456d1f402c55e819a0f7cf2f - Sigstore transparency entry: 1782561974
- Sigstore integration time:
-
Permalink:
Buggy1111/shelly-mcp@b9172165832203d2a7fef8e2407c69a7d887a77c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Buggy1111
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b9172165832203d2a7fef8e2407c69a7d887a77c -
Trigger Event:
push
-
Statement type:
File details
Details for the file shelly_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: shelly_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 58.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5254bf88a82f6e2c27c14f090b0ec387a7c641d1c184e5d106eb019ba5733f17
|
|
| MD5 |
6e9b6a3399c437e8034270849256527e
|
|
| BLAKE2b-256 |
9c1c40a656007ab0c27a844c0c654ea5c1455f74c6e5ff8e01907be1f5c9d999
|
Provenance
The following attestation bundles were made for shelly_mcp-0.1.2-py3-none-any.whl:
Publisher:
release.yml on Buggy1111/shelly-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shelly_mcp-0.1.2-py3-none-any.whl -
Subject digest:
5254bf88a82f6e2c27c14f090b0ec387a7c641d1c184e5d106eb019ba5733f17 - Sigstore transparency entry: 1782562034
- Sigstore integration time:
-
Permalink:
Buggy1111/shelly-mcp@b9172165832203d2a7fef8e2407c69a7d887a77c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Buggy1111
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b9172165832203d2a7fef8e2407c69a7d887a77c -
Trigger Event:
push
-
Statement type: