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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sanlim/home-assistant-switch-mcp-server

v1.0.14

Published

A MCP server for Home Assistant switch services.

Downloads

13

Readme

🚀 Home Assistant MCP Server

A Model Context Protocol (MCP) server providing Home Assistant integration for controlling smart home devices and getting entity states. Use this server as a tool provider in your MCP-compatible clients (like Claude, Cursor, and others) to interact with your Home Assistant instance. This is an unofficial repository.

One of the main motivations for this MCP server is security and control. Instead of exposing your entire Home Assistant REST API (which includes hundreds of endpoints and full system access), this server provides a curated set of specific tools that you can safely share with AI assistants.


🏠 Home Assistant Switch Tool

Example Usage:

🤖 What is MCP?

Model Context Protocol (MCP) is a standard for tool providers to communicate with AI clients via standard input/output. This server lets you plug Home Assistant tools into any MCP-compatible client.


⚡ Quick Start: Use in Your MCP Client

You can configure this server as a tool provider in your MCP Client such as Claude, Cursor, VsCode and others:

"home-assistant-mcp-server-switch-local": {
  "command": "npx",
  "args": [
    "@sanlim/home-assistant-mcp-server"
  ],
  "env": {
    "HOME_ASSISTANT_URL": "your_host:8123",
    "HOME_ASSISTANT_TOKEN": "your_long_lived_access_token_here"
  }
}

🛠️ Using a Local Build

  1. Clone this repository:
git clone https://github.com/alexandresanlim/home-assistant-switch-mcp-server.git
  1. Install and build:
npm install
npm run build
npm run server
  1. Configure your MCP client:
"home-assistant-mcp-server-debug": {
  "command": "node",
  "args": [
    "...replace_to_path_of_project/home-assistant-switch-mcp-server/build/main.js"
  ],
  "env": {
    "HOME_ASSISTANT_URL": "http:/localhost:8123",
    "HOME_ASSISTANT_TOKEN": "your_long_lived_access_token_here"
  }
}

The server will start and listen for MCP requests via standard input/output. 🎉


🔧 Configuration

Environment Variables

  • HOME_ASSISTANT_URL: Your Home Assistant instance URL (default: http://localhost:8123)
  • HOME_ASSISTANT_TOKEN: Your Home Assistant Long-Lived Access Token

Getting a Home Assistant Token

  1. Log into your Home Assistant frontend
  2. Go to your profile: http://YOUR_HA_URL/profile
  3. Scroll down to "Long-Lived Access Tokens"
  4. Create a new token and copy it

📚 Reference & Troubleshooting

  • Full API reference: Home Assistant REST API docs
  • If you have issues, make sure your build is up to date and your MCP client is configured to use stdio.
  • For questions or contributions, feel free to open an issue or pull request!

Made with ❤️ by a Home Assistant enthusiast. Enjoy!