npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ha-mcp-server

v0.3.4

Published

MCP server for saving and controlling Home Assistant light scenes. Works with any MCP-compatible client.

Downloads

1,623

Readme

Home Assistant Scene MCP

A Model Context Protocol (MCP) server for controlling Home Assistant lights and managing scenes. Complements the official Home Assistant MCP by providing detailed light control with colors and scene management.

Features

  • Show Lights - View all lights with full details:
    • State, brightness, RGB colors, color temperature
    • Color mode and supported modes
    • Available effects (colorloop, etc.)
    • Color temperature range (min/max Kelvin)
  • Adjust Light - Control lights (on/off, brightness, RGB color, color temperature, effects)
  • Create Scene - Save current lighting as a scene with two modes:
    • exclusive - Turns off other lights when activated
    • additive - Only affects lights in the scene
  • List Scenes - View all saved scenes
  • Activate Scene - Activate a saved scene (with IKEA Tradfri support)
  • Update Scene - Update an existing scene with current light states
  • Delete Scene - Remove a scene
  • Blackout - Turn off all lights

Why This MCP?

The official Home Assistant MCP is limited - it can't show light colors or provide detailed state information. This MCP fills that gap:

| Feature | Official HA MCP | This MCP | |---------|-----------------|----------| | Show light colors | ❌ | ✅ | | Show brightness | Limited | ✅ Full detail | | Show color modes | ❌ | ✅ | | Show effects | ❌ | ✅ | | Set RGB colors | ❌ | ✅ | | Color temperature | ❌ | ✅ | | Set effects | ❌ | ✅ | | Create scenes | ❌ | ✅ | | IKEA Tradfri fixes | ❌ | ✅ |

Installation

npm install -g ha-mcp-server

Or clone and build:

git clone https://github.com/Koneisto/HomeAssistant-Light-MCP.git
cd HomeAssistant-Light-MCP
npm install
npm run build

Configuration

Add to Claude Desktop config:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "ha-scenes": {
      "command": "ha-mcp-server",
      "env": {
        "HA_URL": "http://your-home-assistant-ip:8123",
        "HA_TOKEN": "your-long-lived-access-token"
      }
    }
  }
}

Get your Home Assistant token

  1. Go to Home Assistant → Profile (bottom left)
  2. Scroll to "Long-Lived Access Tokens"
  3. Click "Create Token"
  4. Copy the token

Usage Examples

Show lights

"Show me all the lights"

"What lights are on?"

Control lights

"Turn on living room light"

"Set bedroom to 50% brightness"

"Make the kitchen light red"

"Set studio lights to warm white"

"Start colorloop on the hallway light"

Create a scene

"Save this as Movie Night"

Activate a scene

"Activate Movie Night"

Update a scene

"Update Evening Lights with current settings"

Blackout

"Turn off all lights"

Tools Reference

| Tool | Description | |------|-------------| | scene_show_lights | Show all lights with state, brightness, colors, effects, color modes | | scene_adjust_light | Control a light (on/off, brightness, color, effects) | | scene_create | Create a new scene from current light states | | scene_list | List all scenes | | scene_activate | Activate a scene | | scene_update | Update existing scene with current lights | | scene_delete | Delete a scene | | scene_blackout | Turn off all lights | | scene_configure | Set Home Assistant URL and token |

Light Properties

scene_show_lights returns:

  • state - on/off
  • brightness / brightness_pct - 0-255 / 0-100%
  • rgb_color - [R, G, B] values
  • color_temp_kelvin - Color temperature
  • color_mode - Current mode (xy, color_temp, rgb, hs)
  • supported_color_modes - What the light supports
  • effect - Active effect (if any)
  • effect_list - Available effects
  • color_temp_range - Min/max Kelvin (if supported)

Scene Modes

  • Exclusive: Turns off all lights not in the scene. Good for room-specific scenes.
  • Additive: Only affects lights in the scene. Good for accent lighting.

IKEA Tradfri Support

IKEA Tradfri lights have a known issue when switching between RGB color mode and color temperature (Kelvin) mode. The bulbs need time to process the mode change before accepting brightness or color values.

Note: Home Assistant's native scenes don't work reliably with Tradfri lights due to these timing issues. This MCP provides a workaround by managing scenes independently with proper delays.

This MCP automatically handles Tradfri lights by:

  • Detecting Tradfri devices by manufacturer name
  • Adding a 500ms delay between mode switch and subsequent commands
  • Properly sequencing color/temperature changes with brightness adjustments

Without these fixes, Tradfri lights often ignore commands or produce incorrect colors when switching modes.

Security

Your Data Stays Local

  • All communication happens directly between your computer and your Home Assistant instance
  • No data is sent to external servers or third parties
  • The MCP server runs locally on your machine via stdio (no open network ports)

No Tracking

  • We don't care enough to track you

Token Safety

  • Your Home Assistant token is stored only on your local machine
  • Use environment variables to avoid storing tokens in files
  • The token is only sent to your own Home Assistant instance
  • You can revoke the token anytime from Home Assistant settings

What This Server Can Access

  • Only lights and scenes in your Home Assistant
  • Cannot access other Home Assistant entities (sensors, locks, cameras, etc.)
  • Cannot make changes outside of light control and scene management

License

MIT

Author

Koneisto


Built by people with questionable priorities