Are you the author? Sign in to claim
MCP server for controlling Nanoleaf smart lights through Warp terminal
A Model Context Protocol (MCP) server for controlling Nanoleaf smart lights. This server provides tools to control your Nanoleaf devices through Warp terminal or any MCP-compatible client.
get_nanoleaf_info - Get detailed device informationturn_on_nanoleaf / turn_off_nanoleaf - Control power stateset_brightness - Adjust brightness (0-100)set_color - Set color using hue (0-360) and saturation (0-100)set_effect - Apply lighting effectsget_effects - List all available effectsdiscover_nanoleaf - Discover devices on networkconnect_to_ip - Connect to specific IP addressauthorize_nanoleaf - Authorize with device in pairing modeFor the easiest setup experience, use the included setup script:
./setup.sh
This script will:
git clone <repository-url>
cd nanoleaf-mcp-server
docker build -t nanoleaf-mcp-server-nanoleaf-mcp-server .
Option A: Auto-discovery
docker run --rm -i --network=host nanoleaf-mcp-server echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "discover_nanoleaf", "arguments": {}}}'
Option B: Manual IP scan
# Scan your network for devices responding on Nanoleaf port
nmap -p 16021 192.168.1.0/24
Option C: Check router admin panel for connected devices
Put your Nanoleaf device in pairing mode:
Get the auth token immediately (within 30 seconds):
# Replace 192.168.1.100 with your device's IP
curl -X POST http://192.168.1.100:16021/api/v1/new
You should get a response like:
{"auth_token":"YourAuthTokenHere123456789"}
Create a .env file in the project directory:
NANOLEAF_IP=192.168.1.100
NANOLEAF_AUTH_TOKEN=YourAuthTokenHere123456789
NANOLEAF_PORT=16021
NANOLEAF_PROTOCOL=http
# Test with environment variables
docker run --rm -i --network=host --env-file .env nanoleaf-mcp-server echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_nanoleaf_info", "arguments": {}}}'
If successful, you'll see detailed information about your Nanoleaf device!
Test all functionality with the example script:
./examples.sh
This will demonstrate all available features including turning lights on/off, changing colors, and applying effects.
Here's a complete working example with real values (replace with your own):
<DEVICE_IP>:16021<AUTH_TOKEN>{
"mcpServers": {
"nanoleaf": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--network=host",
"-e", "NANOLEAF_IP=<DEVICE_IP>",
"-e", "NANOLEAF_AUTH_TOKEN=<AUTH_TOKEN>",
"-e", "NANOLEAF_PORT=16021",
"-e", "NANOLEAF_PROTOCOL=http",
"nanoleaf-mcp-server-nanoleaf-mcp-server"
],
"env": {}
}
}
}
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "set_effect", "arguments": {"effect": "Cyberpunk 2077"}}}' | docker run --rm -i --network=host -e NANOLEAF_IP=<DEVICE_IP> -e NANOLEAF_AUTH_TOKEN=<AUTH_TOKEN> nanoleaf-mcp-server-nanoleaf-mcp-server
Add this to your Warp MCP servers configuration (replace the values with your actual device IP and auth token):
{
"mcpServers": {
"nanoleaf": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--network=host",
"-e", "NANOLEAF_IP=192.168.1.100",
"-e", "NANOLEAF_AUTH_TOKEN=YourAuthTokenHere123456789",
"-e", "NANOLEAF_PORT=16021",
"-e", "NANOLEAF_PROTOCOL=http",
"nanoleaf-mcp-server-nanoleaf-mcp-server"
],
"env": {}
}
}
}
Important:
192.168.1.100 with your Nanoleaf device's IP addressYourAuthTokenHere123456789 with your actual auth tokennanoleaf-mcp-server-nanoleaf-mcp-serverIf you encounter path-related issues, you can also use this alternative approach:
{
"mcpServers": {
"nanoleaf": {
"command": "bash",
"args": ["-c", "cd /path/to/nanoleaf-mcp-server && docker run --rm -i --network=host --env-file .env nanoleaf-mcp-server-nanoleaf-mcp-server"],
"env": {}
}
}
}
Once configured, you can use the Nanoleaf tools directly in Warp:
# Turn on
curl -X PUT http://your-ip:16021/api/v1/your-token/state \
-H "Content-Type: application/json" \
-d '{"on":{"value":true}}'
# Turn off
curl -X PUT http://your-ip:16021/api/v1/your-token/state \
-H "Content-Type: application/json" \
-d '{"on":{"value":false}}'
curl -X PUT http://your-ip:16021/api/v1/your-token/state \
-H "Content-Type: application/json" \
-d '{"brightness":{"value":50}}'
curl -X PUT http://your-ip:16021/api/v1/your-token/effects \
-H "Content-Type: application/json" \
-d '{"select":"Northern Lights"}'
nmap -p 16021 192.168.1.0/24--network=host).env file exists and has correct values--env-file .env--env-filenanoleaf-mcp-server-nanoleaf-mcp-serverecho '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_nanoleaf_info", "arguments": {}}}' | docker run --rm -i --network=host -e NANOLEAF_IP=your-ip -e NANOLEAF_AUTH_TOKEN=your-token nanoleaf-mcp-server-nanoleaf-mcp-server
docker images | grep nanoleafTested with:
Should work with most Nanoleaf devices that support the v1 API.
Feel free to submit issues, feature requests, or pull requests!
MIT License - see LICENSE file for details.
Run analytics queries on ClickHouse — explore schemas, execute SQL, fetch results
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases