Labsco
srnetadmin logo

Nanoleaf MCP Server

from srnetadmin

A server for controlling Nanoleaf smart lights using the Model Context Protocol.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Nanoleaf MCP Server

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.

Nanoleaf Server MCP server

Features

  • ๐Ÿ” Auto-discovery of Nanoleaf devices on your network
  • ๐Ÿ”— Direct IP connection for specific device targeting
  • ๐Ÿ” Authorization support for secure device pairing
  • ๐Ÿ’ก Full control of lights, brightness, colors, and effects
  • ๐Ÿณ Dockerized for easy deployment
  • ๐Ÿ–ฅ๏ธ Warp terminal integration
  • ๐Ÿ”’ Security-audited dependencies with regular vulnerability checks

Available Tools

  • get_nanoleaf_info - Get detailed device information
  • turn_on_nanoleaf / turn_off_nanoleaf - Control power state
  • set_brightness - Adjust brightness (0-100)
  • set_color - Set color using hue (0-360) and saturation (0-100)
  • set_effect - Apply lighting effects
  • get_effects - List all available effects
  • discover_nanoleaf - Discover devices on network
  • connect_to_ip - Connect to specific IP address
  • authorize_nanoleaf - Authorize with device in pairing mode

Working Example

Here's a complete working example with real values (replace with your own):

  1. Device discovered at: <DEVICE_IP>:16021
  2. Auth token obtained: <AUTH_TOKEN>
  3. Warp configuration:
{
  "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": {}
    }
  }
}
  1. Test command:
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

Warp Terminal Integration

Add to Warp MCP Configuration

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:

  • Replace 192.168.1.100 with your Nanoleaf device's IP address
  • Replace YourAuthTokenHere123456789 with your actual auth token
  • Make sure you've built the Docker image with tag nanoleaf-mcp-server-nanoleaf-mcp-server

Alternative Configuration (if path issues occur)

If 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": {}
    }
  }
}

Using in Warp

Once configured, you can use the Nanoleaf tools directly in Warp:

  • Ask to turn lights on/off
  • Change brightness and colors
  • Apply cool effects like "Northern Lights" or "Cyberpunk"
  • Get device information

Device Compatibility

Tested with:

  • Nanoleaf Canvas
  • Nanoleaf Light Panels
  • Nanoleaf Hexagons

Should work with most Nanoleaf devices that support the v1 API.

Documentation

  • Dependency Audit Report - Detailed security audit and dependency update information
  • Setup Scripts - Automated setup and testing scripts included
  • Docker Configuration - Containerized deployment for easy management