MCP server for Shelly Plug
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"shelly-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A standalone MCP stdio server that wraps the Shelly Plus Plug S Gen2 RPC API. It exposes three tools (switch_set, switch_status, plug_info) for controlling the relay and reading telemetry, and manages the plug's status LED as a startup/shutdown side effect — the LED switches to a dim blue/red preset while the server is attached and restores the user's original config on exit.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in other
MCP server for Spanning Cloud Backup — M365/GWS/Salesforce backups, restores, audit.
AI agent control of 3D printers — 432 tools for OctoPrint, Moonraker, Bambu, Prusa, Elegoo
MCP server for Kaseya Autotask PSA — companies, tickets, projects, time entries, and more.
On-chain provenance lookup for AnchorRegistry. Resolve AR-IDs, hashes, and full trees. Authless.
MCP Security Weekly
Get CVE alerts and security updates for Shelly Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A standalone MCP stdio server that wraps the Shelly Plus Plug S Gen2
RPC API. It exposes three tools (switch_set, switch_status,
plug_info) for controlling the relay and reading telemetry, and
manages the plug's status LED as a startup/shutdown side effect — the
LED switches to a dim blue/red preset while the server is attached and
restores the user's original config on exit.
docker build -t shelly-mcp-server .
The image is a multi-stage build (golang:1.26-alpine builder →
gcr.io/distroless/static:nonroot runtime) and lands at ~10–15 MB.
claude mcp add --transport stdio --scope user shelly-plug -- \
docker run --rm -i -e SHELLY_HOST=<plug-host> shelly-mcp-server
Restart your MCP client and run /mcp to confirm the three tools are
listed.
All variables are read once at startup. Invalid values exit 1 with a stderr message naming the offending variable; there are no silent defaults for malformed input.
| Variable | Default | Description |
|---|---|---|
SHELLY_HOST | required | Plug IPv4 address or hostname. No URL scheme, no path. IPv6 must be bracketed ([::1]). Leading/trailing whitespace trimmed; values containing / or :// are rejected. |
SHELLY_TIMEOUT_MS | 5000 | Per-RPC timeout in milliseconds. Must parse as a positive integer. |
SHELLY_LED_AUTO_MANAGE | true | Strict parse: only the literals true or false (case-sensitive) are accepted. When true, paint the MCP LED preset at startup and restore the original config at shutdown. |
SHELLY_AUTO_OFF_ON_SHUTDOWN | true | Same strict parse rule. When true, the relay is turned off during graceful shutdown. Set to false if the plug powers something you do not want killed on server restart. |
Stop-grace caveat. Shutdown runs the LED restore and the optional
auto-off in parallel, bounded by SHELLY_TIMEOUT_MS. If you raise
SHELLY_TIMEOUT_MS above 8000, configure your container runtime's
stop grace period to SHELLY_TIMEOUT_MS + 2s (e.g.
docker run --stop-timeout 12 …) or the LED restore can be SIGKILLed
mid-RPC and leave the plug on the MCP preset.
switch_set — Change the plug's relay state on or off. Returns
the prior state, the resulting state, and live power telemetry.
Parameters: state ("on" or "off").switch_status — Read the current relay state and live power
telemetry without changing anything. Use this when you need to know
whether the plug is on, its power draw, voltage, current, or
temperature. No parameters.plug_info — Return identifying metadata for the Shelly plug:
name, model, generation, firmware version. No parameters.Local Go (1.26+) is supported but not required:
go vet ./...
gofmt -l .
go test ./...
golangci-lint run ./...
The integration tests under internal/shelly/ are gated on a
//go:build integration tag and require a real plug:
SHELLY_HOST=<plug-host> go test -tags integration ./internal/shelly/...
Licensed under AGPL-3.0-or-later. See LICENSE.
This project is not affiliated with, endorsed by, or sponsored by Allterco Robotics AD or the Shelly brand. "Shelly" is used solely as a descriptive identifier for the hardware this server integrates with.