Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f8d67b145 | ||
|
|
ab8b597843 | ||
|
|
ddf9070a64 | ||
|
|
f5c01ad83a | ||
|
|
190915214d |
88
README.md
88
README.md
@@ -13,7 +13,7 @@
|
||||
|
||||
Welcome to the **Model Context Protocol (MCP) Server for Home Assistant**! This robust platform bridges Home Assistant with cutting-edge Language Learning Models (LLMs), enabling natural language interactions and real-time automation of your smart devices. Imagine entering your home, saying:
|
||||
|
||||
> “Hey MCP, dim the lights and start my evening playlist,”
|
||||
> "Hey MCP, dim the lights and start my evening playlist,"
|
||||
|
||||
and watching your home transform instantly—that's the magic that MCP Server delivers!
|
||||
|
||||
@@ -122,6 +122,14 @@ For further technical details, check out our [Documentation Index](docs/index.md
|
||||
|
||||
## Installation 🛠
|
||||
|
||||
### Installing via Smithery
|
||||
|
||||
To install Home Assistant MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@jango-blockchained/advanced-homeassistant-mcp):
|
||||
|
||||
```bash
|
||||
npx -y @smithery/cli install @jango-blockchained/advanced-homeassistant-mcp --client claude
|
||||
```
|
||||
|
||||
### 🐳 Docker Setup (Recommended)
|
||||
|
||||
For a hassle-free, containerized deployment:
|
||||
@@ -285,4 +293,80 @@ This project is licensed under the MIT License. See [LICENSE](LICENSE) for full
|
||||
|
||||
---
|
||||
|
||||
🔋 Batteries included.
|
||||
🔋 Batteries included.
|
||||
|
||||
## MCP Client Integration
|
||||
|
||||
This MCP server can be integrated with various clients that support the Model Context Protocol. Below are instructions for different client integrations:
|
||||
|
||||
### Cursor Integration
|
||||
|
||||
The server can be integrated with Cursor by adding the configuration to `.cursor/config/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"homeassistant-mcp": {
|
||||
"command": "bun",
|
||||
"args": ["run", "start"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"env": {
|
||||
"NODE_ENV": "development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Claude Desktop Integration
|
||||
|
||||
For Claude Desktop, add the following to your Claude configuration file:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"homeassistant-mcp": {
|
||||
"command": "bun",
|
||||
"args": ["run", "start", "--port", "8080"],
|
||||
"env": {
|
||||
"NODE_ENV": "production"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Cline Integration
|
||||
|
||||
For Cline-based clients, add the following configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"homeassistant-mcp": {
|
||||
"command": "bun",
|
||||
"args": [
|
||||
"run",
|
||||
"start",
|
||||
"--enable-cline",
|
||||
"--config",
|
||||
"${configDir}/.env"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "production",
|
||||
"CLINE_MODE": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Command Line Usage
|
||||
|
||||
#### Windows
|
||||
A CMD script is provided in the `scripts` directory. To use it:
|
||||
|
||||
1. Navigate to the `scripts` directory
|
||||
2. Run `start_mcp.cmd`
|
||||
|
||||
The script will start the MCP server with default configuration.
|
||||
|
||||
16
docs/claude_desktop_config.json
Normal file
16
docs/claude_desktop_config.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"homeassistant-mcp": {
|
||||
"command": "bun",
|
||||
"args": [
|
||||
"run",
|
||||
"start",
|
||||
"--port",
|
||||
"8080"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "production"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
docs/cline_config.json
Normal file
18
docs/cline_config.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"homeassistant-mcp": {
|
||||
"command": "bun",
|
||||
"args": [
|
||||
"run",
|
||||
"start",
|
||||
"--enable-cline",
|
||||
"--config",
|
||||
"${configDir}/.env"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "production",
|
||||
"CLINE_MODE": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,4 +326,8 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
else
|
||||
echo -e "${GREEN}Home Assistant MCP test successful!${NC}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# macOS environment configuration
|
||||
HASS_SOCKET_URL="${HASS_HOST/http/ws}/api/websocket" # WebSocket URL conversion
|
||||
chmod 600 "$CLAUDE_CONFIG_DIR/claude_desktop_config.json" # Security hardening
|
||||
21
scripts/start_mcp.cmd
Normal file
21
scripts/start_mcp.cmd
Normal file
@@ -0,0 +1,21 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
:: Set environment variables
|
||||
set NODE_ENV=production
|
||||
|
||||
:: Change to the script's directory
|
||||
cd /d "%~dp0"
|
||||
cd ..
|
||||
|
||||
:: Start the MCP server
|
||||
echo Starting Home Assistant MCP Server...
|
||||
bun run start --port 8080
|
||||
|
||||
if errorlevel 1 (
|
||||
echo Error starting MCP server
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
pause
|
||||
28
smithery.yaml
Normal file
28
smithery.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml
|
||||
|
||||
startCommand:
|
||||
type: stdio
|
||||
configSchema:
|
||||
# JSON Schema defining the configuration options for the MCP.
|
||||
type: object
|
||||
required:
|
||||
- hassToken
|
||||
properties:
|
||||
hassToken:
|
||||
type: string
|
||||
description: The token for connecting to Home Assistant API.
|
||||
port:
|
||||
type: number
|
||||
default: 4000
|
||||
description: The port on which the MCP server will run.
|
||||
commandFunction:
|
||||
# A function that produces the CLI command to start the MCP on stdio.
|
||||
|-
|
||||
config => ({
|
||||
command: 'bun',
|
||||
args: ['--smol', 'run', 'start'],
|
||||
env: {
|
||||
HASS_TOKEN: config.hassToken,
|
||||
PORT: config.port.toString()
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user