# Home Assistant Switch Mcp Server

> This MCP is focused on switch functionality for Home Assistant, including operations like turning lights on or off.

- **Type:** MCP server
- **Install:** `agentstack add mcp-alexandresanlim-home-assistant-switch-mcp-server`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [alexandresanlim](https://agentstack.voostack.com/s/alexandresanlim)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [alexandresanlim](https://github.com/alexandresanlim)
- **Source:** https://github.com/alexandresanlim/home-assistant-switch-mcp-server

## Install

```sh
agentstack add mcp-alexandresanlim-home-assistant-switch-mcp-server
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 🚀 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:**

https://github.com/user-attachments/assets/e7061d6a-faac-4d62-8a73-1449e7d156af

## 🤖 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:

```json
"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:**

```bash
git clone https://github.com/alexandresanlim/home-assistant-switch-mcp-server.git
```

2. **Install and build:**

```bash
npm install
npm run build
npm run server
```

3. **Configure your MCP client:**

```json
"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](https://developers.home-assistant.io/docs/api/rest/)
- 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!

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [alexandresanlim](https://github.com/alexandresanlim)
- **Source:** [alexandresanlim/home-assistant-switch-mcp-server](https://github.com/alexandresanlim/home-assistant-switch-mcp-server)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-alexandresanlim-home-assistant-switch-mcp-server
- Seller: https://agentstack.voostack.com/s/alexandresanlim
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
