LIFX LAN MCP

A Model Context Protocol (MCP) server for allowing an LLM to control LIFX lights over your local area network (LAN), without cloud connectivity.
Note that the MCP server must be running on the same wifi network as your LIFX lights in order for the tool to work.
Features
- List all available LIFX lights on your network
- Get the current state of lights (color, on/off, labels)
- Turn lights on/off
- Change light colors
- Local network operation (no cloud required, server must be running on the same network)
- Configurable transport (sse or stdio)
Installation
NPX (configuring via local stdio) - default
Add this, or similar, to your LLM MCP config file (ex. for Claude Desktop this is claude_desktop_config.json).
{
"mcpServers": {
"lifx-lan-mcp": {
"command": "npx",
"args": [
"-y",
"lifx-lan-mcp"
]
}
}
}
Running the Server
The server can be run in two modes: stdio (default) or HTTP server mode. The server supports both the 2025-03-26 and 2024-11-05 protocol versions.
Stdio Mode (Default)
Stdio mode is the simplest way to run the server, where it communicates directly with the LLM through standard input/output. This is the default mode and requires no additional configuration. In this mode, the MCP server is started directly by the client with which it's communicating.
# Run in stdio mode (default)
npx lifx-lan-mcp
# Or explicitly specify stdio mode
npx lifx-lan-mcp --mode stdio
HTTP Server Mode
WARNING: HTTP SERVER MODE IS DANGEROUS. It currently doesn't support authentication, which means attackers could trick your LLM into giving it data or alternatively allow malicious clients to control your LIFX lights. Use at your own risk until authentication is supported.
HTTP server mode allows the server to run as a standalone service that can be accessed over HTTP. This is useful when you want to run the server separately from the LLM client, ex. over a network.
# Run in HTTP server mode on default port (3000)
npx lifx-lan-mcp --mode sse
# Run in HTTP server mode on a specific port
npx lifx-lan-mcp --mode sse --port 8080
Protocol Versions
The HTTP server supports two protocol versions:
-
2025-04-21 Protocol (Latest)
- Uses
/mcpendpoint for all operations - Supports both HTTP and SSE transports
- Example client configuration:
{ "mcpServers": { "lifx-lan-mcp": { "url": "http://localhost:3000/mcp" } } } - Uses
-
2025-03-26 Protocol (Legacy)
- Uses
/sseendpoint for establishing connections - Uses
/messageendpoint for sending messages - Example client configuration:
{ "mcpServers": { "lifx-lan-mcp": { "url": "http://localhost:3000/sse" } } } - Uses
Tools
-
lifx_lan_list_lights
- List all Lifx lights currently available on the user's local area network (LAN)
- Each light is specified by a unique string label
- Includes additional information about the light, such as group and location
- Inputs: None required
-
lifx_lan_get_lights_state
- Get the current state of one or more LIFX lights, including colors, on/off state, groups and locations
- Inputs:
labels(string[]): Array of light labels to get state for
-
lifx_lan_set_lights_color
- Set the color of one or more Lifx lights
- Inputs:
labels(string[]): Array of light labels to set color forcolor(object): Color specificationhue(number): Hue value (0.0-1.0)saturation(number): Saturation value (0.0-1.0)brightness(number): Brightness value (0.0-1.0)kelvin(number, optional): Color temperature in Kelvin (1500-9000, defaults to 3500)
duration(number, optional): Transition duration in milliseconds
-
lifx_lan_turn_on_lights
- Turn on one or more Lifx lights, optionally at specific color
- Inputs:
labels(string[]): Array of light labels to turn oncolor(object, optional): Color specification if changing colorhue(number, optional): Hue value (0.0-1.0)saturation(number, optional): Saturation value (0.0-1.0)brightness(number, optional): Brightness value (0.0-1.0)kelvin(number, optional): Color temperature in Kelvin
duration(number, optional): Transition duration in milliseconds
-
lifx_lan_turn_off_lights
- Turn off one or more Lifx lights
- Inputs:
labels(string[]): Array of light labels to turn offduration(number, optional): Transition duration in milliseconds
Development
Prerequisites
- Node.js
- TypeScript
- LIFX lights on your local network
Building from Source
- Clone the repository:
git clone https://github.com/simon-duchastel/lifx-lan-mcp.git
cd lifx-lan-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
The MCP definition is found in index.ts, which contains all of the tools available to the LLM. The APIs which the tools call are availabe in the src/ folder.
Development Scripts
npm run prepare- Compile the project (buildsdist/index.js)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
Feel free to reach out at [email protected] or by opening a GitHub issue.
If you find this project useful, you can buy me a coffee.
Recommend MCP Servers 💡
Skyvern
Skyvern's MCP server connects AI applications to the browser, enabling form filling, file downloading, and web research.
ecovacs-robot-mcp
An official Model Context Protocol (MCP) server by Ecovacs-AI, enabling AI agents to control and query Ecovacs robot vacuums for tasks like cleaning, charging, and status checks.
mcp-server-article
通过AI生成文章并自动发布到CSDN、掘金、博客园的MCP Server服务
oddlyspaced/ultimate-android-mcp
A feature-rich MCP server enabling LLMs to automate connected Android devices/emulators via ADB-powered functionalities like app management, UI interaction, and device monitoring.
mcp-server-screeny
Privacy-focused macOS MCP server for AI agents to capture screenshots of user-approved windows
mcp-server-apache-airflow
A Model Context Protocol (MCP) server implementation for Apache Airflow, enabling seamless integration with MCP clients. This project provides a standardized way to interact with Apache Airflow through the Model Context Protocol.