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 💡
@alexarevalo.ai/mcp-server-ticktick
A Model Context Protocol (MCP) server designed to integrate with the TickTick task management platform, enabling intelligent context-aware task operations and automation.
@apify/mcp-server-rag-web-browser
A MCP Server for the RAG Web Browser Actor
wayland-mcp
Provides screenshot, image analysis, mouse, and keyboard control tools for modern Linux desktops running Wayland.
mcp-filesystem-extended
A Node.js MCP server for comprehensive filesystem operations, including reading, writing, patching, searching, and managing files and directories.
systemsage
A powerful cross-platform system management and monitoring tool that provides comprehensive system insights and management capabilities through Model Context Protocol (MCP)
webmvc-mcp-server
A collection of OpenRewrite recipes to automatically convert Spring Web REST APIs into Spring AI Model Context Protocol (MCP) server tools, extracting documentation for AI agent accessibility.