lightwave-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lightwave-mcpturn off the kitchen light"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
lightwave-mcp
An MCP server that lets an AI agent discover and control LightwaveRF Smart Series ("Link Plus") smart home devices - light switches/dimmers, relays, and smart power sockets - so a request like "turn off the kitchen light" made to an MCP-connected agent results in the physical device being controlled.
Disclaimer: this is an independent, community project. It is not affiliated with, endorsed by, or supported by LightwaveRF Technology Ltd. You need your own LightwaveRF Link Plus account and hardware to use it. LightwaveRF's public API is provided at their discretion and may change without notice.
How it works
LightwaveRF publishes an official, documented REST API at https://publicapi.lightwaverf.com/
(separate from the undocumented protocol their own mobile app uses internally). This server
talks to that public API directly over plain HTTPS - there's no persistent connection, no
websocket, and no third-party LightwaveRF client library involved.
AI agent (Claude, etc.)
| MCP tool calls (stdio)
v
lightwave-mcp server
| HTTPS + bearer token
v
https://publicapi.lightwaverf.com
|
v
Your LightwaveRF Link Plus hub -> physical devicesAuthentication. LightwaveRF uses a Basic token + rotating refresh token pair, generated
once by hand from your account. The server exchanges these for a short-lived access token
via POST https://auth.lightwaverf.com/token. Refresh tokens are single-use: every
refresh returns a new one that must be used next time. src/lightwave_mcp/auth.py
(TokenManager) handles this - it caches the live, rotating pair in a local JSON file
(.lightwave_token_cache.json, gitignored) so restarts don't reuse an already-consumed
refresh token, and it fails with a clear, actionable error if the pair ever goes dead rather
than retrying silently.
Discovery. On startup (and whenever refresh_devices is called), the server:
GET /v1/structures- lists the LightwaveRF "structures" (homes) on the accountGET /v1/structure/{id}- lists devices and their featureSets/features in each structureGET /v1/hierarchy/{id}- maps featureSets to room names, so devices can be reported with their room (e.g. "Kitchen")
Each device exposes a set of typed "features" (switch, dimLevel, socketSetup, etc.).
src/lightwave_mcp/devices.py classifies each featureSet into "light" (has dimLevel),
"outlet" (has socketSetup), or "switch" (has switch only) - anything else (thermostats,
TRVs, covers, sensors, remotes) is out of scope and filtered out of discovery entirely. A
DeviceRegistry builds an id- and name-indexed lookup so tools can resolve a device by either
its LightwaveRF id or the name you gave it in the Lightwave app, and raises a clear error if a
name is ambiguous (two devices sharing a name) or unrecognized.
Control. State reads and writes go through /v1/feature/:featureId (and the batch
variants /v1/features/read / /v1/features/write) - there's no push/streaming state, so the
server reads live on every call rather than trusting a cache.
Errors. Anything a calling agent needs to react to (device not found, ambiguous name,
wrong device type for an operation, out-of-range brightness, an underlying HTTP failure) is
raised as an MCP ToolError with a specific, actionable message, instead of a raw stack trace.
Related MCP server: mcp-server-tuya
Setup
1. Get a LightwaveRF API token pair
Go to my.lightwaverf.com (or the Link Plus app) and sign in.
Open Settings -> API Integration -> Get Token. You'll be asked for your account password again.
You'll be given two values: a Basic token and a Refresh token. Copy both - the refresh token is only shown once here (the server keeps it up to date after that; see "How it works" above).
Treat both values as secrets - anyone with them can control every device on your account.
2. Configure and install
cp .env.example .envEdit .env:
LIGHTWAVE_BASIC_TOKEN=<basic token from step 1>
LIGHTWAVE_REFRESH_TOKEN=<refresh token from step 1>python -m venv .venv
.venv/Scripts/activate # or `source .venv/bin/activate` on macOS/Linux
pip install -e ".[dev]".env and the rotating .lightwave_token_cache.json it produces are both gitignored -
never commit either.
3. Try it directly
python -m lightwave_mcpStarts the stdio MCP server. It fails fast with a clear error if the token pair is missing or invalid, rather than starting up with zero devices.
4. Register with an MCP client (e.g. Claude Code)
claude mcp add lightwave -e LIGHTWAVE_BASIC_TOKEN=<basic token> -e LIGHTWAVE_REFRESH_TOKEN=<refresh token> -- python -m lightwave_mcpThen, from a session:
list_devices- see every switch, relay, socket, and light discovered in your hometurn_on/turn_off- control one, by name (e.g. "Kitchen Light") or idset_brightness- dim a light (0-100); turn it on firstget_device_state- check a single device's current staterefresh_devices- re-discover if you've added/removed devices in the Lightwave app
Tools
Tool | Description |
| List all in-scope devices with current state |
| Current state of one device |
| Turn a device on |
| Turn a device off |
| Set a light's brightness, 0-100 |
| Re-run discovery |
device accepts either the name shown by list_devices (case-insensitive) or its id. If a
name matches more than one device, the error lists the ids to disambiguate with.
Project layout
src/lightwave_mcp/
auth.py TokenManager - token exchange/refresh/caching against auth.lightwaverf.com
client.py LightwaveClient - thin async HTTP wrapper over publicapi.lightwaverf.com
devices.py Device classification, room enrichment, id/name resolution
server.py FastMCP tool definitions + startup/shutdown lifecycle
__main__.py Entry point (stdio transport)
tests/
test_client.py TokenManager/LightwaveClient against mocked HTTP (respx)
test_devices.py Classification and registry resolution logic
test_server_tools.py MCP tool functions against a fake client
test_integration_live.py Real discovery round trip; skipped unless real tokens are setDevelopment
pip install -e ".[dev]"
pytesttests/test_integration_live.py performs a real discovery round trip against your actual
LightwaveRF account and is skipped automatically unless LIGHTWAVE_BASIC_TOKEN and
LIGHTWAVE_REFRESH_TOKEN are set in the environment - it never runs in CI unless you add
real secrets there deliberately.
Security notes
Never commit
.envor.lightwave_token_cache.json- both hold live credentials..gitignorealready excludes them.If you ever suspect a token has leaked, revoke it by generating a fresh pair from
my.lightwaverf.com -> Settings -> API Integration -> Get Token- this invalidates the old refresh token.This server only exposes switches, relays, sockets, and dimmable lights by design; it never reads or writes thermostats, TRVs, or other device types, even though the underlying API account may have access to them.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables control of LIFX smart lights through natural language, including power control, color adjustment, lighting effects, and scene management using the LIFX HTTP API.9122ISC
- AlicenseAqualityDmaintenanceEnables AI assistants to control Tuya/Smart Life smart home devices via tools like on/off, brightness, color, and custom commands.101MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to control Govee smart devices, including lights, via natural language. Supports turning on/off, changing colors, adjusting brightness, and activating scenes through the Govee API or local network.91MIT
- FlicenseAqualityDmaintenanceEnables AI agents to control Homey smart home devices, trigger flows, and query zones via the Homey API.19
Related MCP Connectors
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Connect AI agents to bank accounts, transactions, balances, and investments.
Universal AI API Orchestrator — 1,554 tools, 96 services. One install.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bennythecoder/lightwaverf_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server