{"_id":"ha-mcp-server","_rev":"84-84c824edc8f48e7b8927c57dc3c3c398","name":"ha-mcp-server","dist-tags":{"latest":"0.7.2"},"versions":{"0.7.1":{"name":"ha-mcp-server","version":"0.7.1","keywords":["mcp","home-assistant","lights","scenes","smart-home","model-context-protocol"],"author":{"name":"Koneisto"},"license":"MIT","_id":"ha-mcp-server@0.7.1","maintainers":[{"name":"koneisto","email":"systems@koneisto.fi"}],"homepage":"https://github.com/Koneisto/HomeAssistant-Light-MCP","bugs":{"url":"https://github.com/Koneisto/HomeAssistant-Light-MCP/issues"},"bin":{"ha-mcp-server":"dist/index.js"},"dist":{"shasum":"259ca54bbbc91eddd9636c022e68711a3fd6f9c6","tarball":"https://registry.npmjs.org/ha-mcp-server/-/ha-mcp-server-0.7.1.tgz","fileCount":4,"integrity":"sha512-LY2Fd82HCU5WzuHWQJ+v+YNEMh1kmwjm9W5ed4eKHZzXsaHiRaa+eL31gpefK9CnNkcY07K8ubXiGz82chUXVA==","signatures":[{"sig":"MEYCIQCbkJToF9N3YBM1ud4tGZe3hH/fjkg0zR5KX3x4lqCZqwIhAMdIk8O4YI+TstR//hzjyVSnF/ij4g1vkTPobgYo5s3m","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84313},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"db3bdd68f9f2e5e3ac31011a687e5fdc8690ad23","mcpName":"io.github.Koneisto/HomeAssistant-Light-MCP","scripts":{"build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"koneisto","email":"systems@koneisto.fi"},"repository":{"url":"git+https://github.com/Koneisto/HomeAssistant-Light-MCP.git","type":"git"},"_npmVersion":"11.6.3","description":"MCP server for controlling Home Assistant lights and managing scenes. Lights only by design for safety.","directories":{},"_nodeVersion":"23.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.10.0"},"_npmOperationalInternal":{"tmp":"tmp/ha-mcp-server_0.7.1_1765228062125_0.8237312965166304","host":"s3://npm-registry-packages-npm-production"}},"0.7.2":{"name":"ha-mcp-server","version":"0.7.2","mcpName":"io.github.Koneisto/HomeAssistant-Light-MCP","description":"MCP server for controlling Home Assistant lights and managing scenes. Lights only by design for safety.","main":"dist/index.js","bin":{"ha-mcp-server":"dist/index.js"},"type":"module","scripts":{"build":"tsc","start":"node dist/index.js"},"keywords":["mcp","home-assistant","lights","scenes","smart-home","model-context-protocol"],"author":{"name":"Koneisto"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Koneisto/HomeAssistant-Light-MCP.git"},"homepage":"https://github.com/Koneisto/HomeAssistant-Light-MCP","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"devDependencies":{"@types/node":"^20.10.0","typescript":"^5.3.0"},"gitHead":"f4a390a8e6c7ff7692da274a29e28b39eeca1884","types":"./dist/index.d.ts","_id":"ha-mcp-server@0.7.2","bugs":{"url":"https://github.com/Koneisto/HomeAssistant-Light-MCP/issues"},"_nodeVersion":"23.7.0","_npmVersion":"11.6.3","dist":{"integrity":"sha512-QXBm/tTOA7v18nx0nSxO0VEatPVYIncnIP/CZzUb6HEMdAuykcEQ1qKEvyf3eI5VzsJOYQqQxDTty6TDKFyymg==","shasum":"a4a9245b5363efe9ffe1ff9dcf28368d00dd683e","tarball":"https://registry.npmjs.org/ha-mcp-server/-/ha-mcp-server-0.7.2.tgz","fileCount":4,"unpackedSize":92520,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDz5IRbOgKRDf2mhKyx6q5vjJa+MHbXnj5lUnkoRfI5YwIgThW+X5GNk5c1O4TvC5Elt3Hi1ovFNmVBO3nW/aEJpJM="}]},"_npmUser":{"name":"koneisto","email":"systems@koneisto.fi"},"directories":{},"maintainers":[{"name":"koneisto","email":"systems@koneisto.fi"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ha-mcp-server_0.7.2_1765231887536_0.08042054008175126"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-05T20:06:57.208Z","modified":"2025-12-08T22:11:27.885Z","0.0.6":"2025-12-05T20:06:57.341Z","0.0.7":"2025-12-05T20:14:27.043Z","0.0.8":"2025-12-05T20:33:59.671Z","0.0.9":"2025-12-05T20:37:30.122Z","0.1.0":"2025-12-05T21:10:28.268Z","0.1.1":"2025-12-05T21:18:31.249Z","0.1.2":"2025-12-05T21:32:24.013Z","0.1.3":"2025-12-05T21:55:18.419Z","0.1.4":"2025-12-05T21:58:33.607Z","0.2.0":"2025-12-05T22:00:12.746Z","0.2.1":"2025-12-05T22:02:06.100Z","0.2.2":"2025-12-05T22:03:02.421Z","0.2.3":"2025-12-05T22:08:45.345Z","0.2.4":"2025-12-05T22:10:06.788Z","0.2.5":"2025-12-05T22:16:10.666Z","0.2.6":"2025-12-05T22:19:30.530Z","0.2.7":"2025-12-05T22:27:25.144Z","0.2.8":"2025-12-05T22:39:22.887Z","0.2.9":"2025-12-05T22:40:21.684Z","0.3.0":"2025-12-05T22:48:13.639Z","0.3.1":"2025-12-05T22:49:55.005Z","0.3.2":"2025-12-05T23:06:47.821Z","0.3.3":"2025-12-05T23:10:30.834Z","0.3.4":"2025-12-06T00:46:25.107Z","0.4.0":"2025-12-08T17:01:03.989Z","0.4.1":"2025-12-08T17:03:50.625Z","0.4.2":"2025-12-08T17:05:58.886Z","0.5.0":"2025-12-08T17:07:59.855Z","0.6.0":"2025-12-08T17:08:47.740Z","0.6.1":"2025-12-08T18:07:35.327Z","0.6.2":"2025-12-08T18:52:00.340Z","0.6.3":"2025-12-08T18:54:28.136Z","0.6.4":"2025-12-08T18:56:12.765Z","0.6.5":"2025-12-08T19:03:55.592Z","0.6.6":"2025-12-08T19:13:26.003Z","0.6.7":"2025-12-08T19:15:08.618Z","0.6.8":"2025-12-08T19:39:47.098Z","0.6.9":"2025-12-08T19:42:05.859Z","0.6.10":"2025-12-08T19:43:32.359Z","0.7.0":"2025-12-08T21:06:03.238Z","0.7.1":"2025-12-08T21:07:42.300Z","0.7.2":"2025-12-08T22:11:27.670Z"},"bugs":{"url":"https://github.com/Koneisto/HomeAssistant-Light-MCP/issues"},"author":{"name":"Koneisto"},"license":"MIT","homepage":"https://github.com/Koneisto/HomeAssistant-Light-MCP","keywords":["mcp","home-assistant","lights","scenes","smart-home","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/Koneisto/HomeAssistant-Light-MCP.git"},"description":"MCP server for controlling Home Assistant lights and managing scenes. Lights only by design for safety.","maintainers":[{"name":"koneisto","email":"systems@koneisto.fi"}],"readme":"# Home Assistant Light MCP\n\nA 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.\n\n## Design Philosophy: Lights Only\n\nThis MCP **intentionally controls only lights** - not switches, not other entities. This is a deliberate safety decision:\n\n- **Switches can control critical systems** - HVAC, heaters, air conditioning, water pumps\n- **Accidental activation could be dangerous** - turning on a heater while away, disabling AC in summer\n- **Lights are safe** - worst case is lights turn on/off unexpectedly\n\nIf you need to control switches or other entities, use the official Home Assistant MCP or automations with appropriate safeguards.\n\n## Features\n\n- **Show Lights** - View all lights with full details:\n  - State, brightness, RGB colors, color temperature\n  - Color mode and supported modes\n  - Available effects (colorloop, etc.)\n  - Color temperature range (min/max Kelvin)\n- **Adjust Light** - Control lights (on/off, brightness, RGB color, color temperature, effects)\n- **Create Scene** - Save current lighting as a scene with two modes:\n  - `exclusive` - Turns off other lights when activated\n  - `additive` - Only affects lights in the scene\n- **List Scenes** - View all saved scenes\n- **Activate Scene** - Activate a saved scene (with IKEA Tradfri support)\n- **Update Scene** - Update an existing scene with current light states\n- **Delete Scene** - Remove a scene\n- **Blackout** - Turn off all lights (with optional exclusions)\n\n## Why This MCP?\n\nThe official Home Assistant MCP is limited - it can't show light colors or provide detailed state information. This MCP fills that gap:\n\n| Feature | Official HA MCP | This MCP |\n|---------|-----------------|----------|\n| Show light colors | No | Yes |\n| Show brightness | Limited | Full detail |\n| Show color modes | No | Yes |\n| Show effects | No | Yes |\n| Set RGB colors | No | Yes |\n| Color temperature | No | Yes |\n| Set effects | No | Yes |\n| Create scenes | No | Yes |\n| IKEA Tradfri fixes | No | Yes |\n\n## Installation\n\n```bash\nnpm install -g ha-mcp-server\n```\n\nOr clone and build:\n```bash\ngit clone https://github.com/Koneisto/HomeAssistant-Light-MCP.git\ncd HomeAssistant-Light-MCP\nnpm install\nnpm run build\n```\n\n## Configuration\n\nAdd to your MCP client configuration:\n\n### Claude Desktop\n\nEdit config file:\n- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n**Option 1: Using npx (recommended, no global install needed)**\n```json\n{\n  \"mcpServers\": {\n    \"ha-light-scenes\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ha-mcp-server\"],\n      \"env\": {\n        \"HA_URL\": \"http://your-home-assistant-ip:8123\",\n        \"HA_TOKEN\": \"your-long-lived-access-token\"\n      }\n    }\n  }\n}\n```\n\n**Option 2: Global install**\n```bash\nnpm install -g ha-mcp-server\n```\n```json\n{\n  \"mcpServers\": {\n    \"ha-light-scenes\": {\n      \"command\": \"ha-mcp-server\",\n      \"env\": {\n        \"HA_URL\": \"http://your-home-assistant-ip:8123\",\n        \"HA_TOKEN\": \"your-long-lived-access-token\"\n      }\n    }\n  }\n}\n```\n\n### Other MCP Clients\n\nThe same configuration structure works with any MCP-compatible client.\n\n### Get your Home Assistant token\n\n1. Go to Home Assistant → Profile (bottom left)\n2. Scroll to \"Long-Lived Access Tokens\"\n3. Click \"Create Token\"\n4. Copy the token\n\n## Usage Examples\n\n### Show lights\n> \"Show me all the lights\"\n\n> \"What lights are on?\"\n\n### Control lights\n> \"Turn on living room light\"\n\n> \"Set bedroom to 50% brightness\"\n\n> \"Make the kitchen light red\"\n\n> \"Set studio lights to warm white\"\n\n> \"Start colorloop on the hallway light\"\n\n### Create a scene\n> \"Save this as Movie Night\"\n\n### Activate a scene\n> \"Activate Movie Night\"\n\n### Update a scene\n> \"Update Evening Lights with current settings\"\n\n### Blackout\n> \"Turn off all lights\"\n\n> \"Turn off all lights except the balcony\"\n\n## Tools Reference\n\n| Tool | Description |\n|------|-------------|\n| `scene_show_lights` | Show all lights with state, brightness, colors, effects, color modes |\n| `scene_adjust_light` | Control a light (on/off, brightness, color, effects) |\n| `scene_create` | Create a new scene from current light states |\n| `scene_list` | List all scenes |\n| `scene_activate` | Activate a scene |\n| `scene_update` | Update existing scene with current lights |\n| `scene_delete` | Delete a scene |\n| `scene_blackout` | Turn off all lights (supports exclusions) |\n| `scene_diagnose` | Diagnose lights and scenes, check connectivity |\n| `scene_fix` | Fix scene problems, restore from backup |\n| `scene_configure` | Set Home Assistant URL and token |\n\n### Light Properties\n\n`scene_show_lights` returns:\n- `state` - on/off\n- `brightness` / `brightness_pct` - 0-255 / 0-100%\n- `rgb_color` - [R, G, B] values\n- `color_temp_kelvin` - Color temperature\n- `color_mode` - Current mode (xy, color_temp, rgb, hs)\n- `supported_color_modes` - What the light supports\n- `effect` - Active effect (if any)\n- `effect_list` - Available effects\n- `color_temp_range` - Min/max Kelvin (if supported)\n\n## Scene Modes\n\n- **Exclusive**: Turns off all lights not in the scene. Good for room-specific scenes.\n- **Additive**: Only affects lights in the scene. Good for accent lighting.\n\n## Local Backup & Multi-Instance Support\n\nThis MCP maintains a local backup of scenes you create:\n- **Automatic backup**: Scenes are saved to `~/.config/ha-mcp-server/scenes-backup.json`\n- **Multi-instance aware**: Detects when another MCP instance (or HA UI) modifies scenes\n- **Smart conflict resolution**: Merges changes from multiple sources\n- **Restore capability**: Can restore scenes if Home Assistant loses them\n\n### Diagnostics (`scene_diagnose`)\n\nAnalyzes your lights and scenes to identify problems:\n- Tests light connectivity and response times\n- Detects connection types (Zigbee, WiFi, Bluetooth)\n- Finds scenes with null values or missing lights\n- Compares Home Assistant state with local backup\n- Reports new lights not yet in exclusive scenes\n\nExample: *\"Run diagnostics on my lights\"*\n\n### Fix & Repair (`scene_fix`)\n\nFour actions to repair scene problems:\n\n| Action | Description |\n|--------|-------------|\n| `fix_all` | Auto-fix all scenes: remove null values, add missing lights to exclusive scenes |\n| `fix_scene` | Fix a specific scene by name |\n| `test_scene` | Activate a scene and report what went wrong |\n| `restore_from_backup` | Restore scenes from local backup if Home Assistant lost them |\n\nExample: *\"Fix all my scenes\"* or *\"Restore Evening Lights from backup\"*\n\n## IKEA Tradfri Support\n\nIKEA 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.\n\n**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.\n\nThis MCP automatically handles Tradfri lights by:\n- Detecting Tradfri devices by manufacturer name\n- Adding a 500ms delay between mode switch and subsequent commands\n- Properly sequencing color/temperature changes with brightness adjustments\n\nWithout these fixes, Tradfri lights often ignore commands or produce incorrect colors when switching modes.\n\n## Security\n\n### Your Data Stays Local\n- All communication happens directly between your computer and your Home Assistant instance\n- No data is sent to external servers or third parties\n- The MCP server runs locally on your machine via stdio (no open network ports)\n\n### No Tracking\n- We don't care enough to track you\n\n### Token Safety\n- Your Home Assistant token is stored only on your local machine\n- Use environment variables to avoid storing tokens in files\n- The token is only sent to your own Home Assistant instance\n- You can revoke the token anytime from Home Assistant settings\n\n### What This Server Can Access\n- Only lights and scenes in your Home Assistant\n- Cannot access other Home Assistant entities (sensors, locks, cameras, etc.)\n- Cannot make changes outside of light control and scene management\n\n## License\n\nMIT\n\n## Author\n\n[Koneisto](https://github.com/Koneisto)\n\n---\n*Built by people with questionable priorities*\n","readmeFilename":"README.md"}