Slhad Aha Mcp

ai.smithery由 smithery.ai 發布官方發布者v0.1.0更新於 Nov 10, 2026

A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…

發布方自己的服務:222wcnm Bilistalkermcp

已驗證Streamable HTTP可網頁執行位置與生活效率與工作流

概覽

AI 產生的概覽

讓助理查詢與控制 Home Assistant 實體、呼叫服務,並管理自動化、儀表板與設定。

可以做什麼
這是一個以 TypeScript 撰寫的 MCP 伺服器,在 Home Assistant 與 MCP 用戶端之間建立橋接(R5)。它可以列出與搜尋實體、讀取與更新實體狀態,並呼叫 Home Assistant 服務,例如開關裝置(R7-R9、R14)。它也支援自動化管理(列出、建立、更新、刪除、追蹤、驗證)、存取實體與裝置登錄檔、更新 Lovelace 儀表板、驗證設定,以及協助整合設定流程(R10-R13、R39-R44)。支援 stdio、SSE 與 Streamable HTTP 三種傳輸方式(R17-R19)。
適用情境
當你想用自然語言讓助理檢視或操作 Home Assistant 時適用:檢查感測器與開關狀態、開關裝置,或草擬並驗證自動化與儀表板。適合已運行 Home Assistant、並希望從 MCP 用戶端以工具方式存取的用途。若沒有可連線的 Home Assistant 執行個體,則幫助不大。
執行需求
需要可連線的 Home Assistant 執行個體網址(HASS_URL)以及長期存取權杖(HASS_ACCESS_TOKEN),缺少權杖伺服器無法啟動(R95、R96)。本機執行需 Node.js v18 以上版本,也可用 Docker/Podman 容器部署(R109、R110)。選用變數:DEBUG、RESOURCES_TO_TOOLS、LIMIT_RESOURCES(R97-R105)。遠端 Smithery 端點需要 Authorization bearer 權杖標頭(V1.1)。
安裝前請注意
此伺服器需要 Home Assistant 長期存取權杖(HASS_ACCESS_TOKEN),該權杖可廣泛控制執行個體,應視為敏感機密。相關工具可變更狀態、呼叫服務,並建立、更新或刪除自動化與儀表板(R8、R9、R10、R39),可能造成非預期的寫入。工具定義會佔用 LLM 上下文 token,部分工具單一就消耗數千 token(R46、R47)。README 說明文件主要由 AI 產生(R27)。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Slhad Aha Mcp,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/ai.smithery%2Fslhad-aha-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "slhad-aha": {
      "type": "http",
      "url": "https://server.smithery.ai/@slhad/aha-mcp/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

AHA Model Context Protocol (MCP) Server

Quick install links

STDIO

[Install in VS Code]

[Install MCP Server]

Others
[smithery badge]

Pretty useful to test it without IDE

AHA stands for Another Home Assistant MCP Server

This repository implements a Model Context Protocol (MCP) server for Home Assistant, providing a bridge between Home Assistant and MCP clients.

With this server, you can:

  • List and query Home Assistant entities (lights, sensors, switches, etc.)
  • Retrieve and update the state of entities
  • Call Home Assistant services (e.g., turn on/off devices)
  • Manage automations: list, create, update, and validate automations
  • Access and update the entity registry
  • Integrate and update Lovelace dashboards
  • Validate Home Assistant configuration
  • Search for entities by prefix or regex
  • Access entity sources and registry information

The server supports multiple transport methods:

  • STDIO: Traditional MCP client communication (default)
  • Server-Sent Events (SSE): Web-based real-time communication
  • Streamable HTTP: HTTP-based MCP communication for web integration

Table of Contents

Motivation

While exploring existing MCP server implementations for Home Assistant, I found that:

  • Many repositories did not provide a buildable or working Docker image, making deployment difficult or impossible.
  • Several projects did not actually implement the features or protocol described in their own README files.
  • Some solutions were outdated, unmaintained, or lacked clear documentation and test coverage.

This project aims to address these gaps by providing a reliable and fully functional MCP server with straightforward Docker support and a focus on real-world usability.

Special Mention: Most of the documentation in this project is generated or assisted by AI. As this is a side project (even though I work as a developer), I focus on building fun and working features, and prefer to review and accept generated documentation if it's good enough, rather than writing everything by hand.

Features

  • Home Assistant client integration
  • Entity registry and management
  • Automation and configuration MCP endpoints
  • Lovelace dashboard support
  • Multiple transport options: stdio, Server-Sent Events (SSE), and Streamable HTTP
  • TypeScript codebase with Vitest for testing
  • Docker support for easy deployment

Available Tools

This MCP server provides comprehensive tools for interacting with Home Assistant, including:

  • Automation Management: Create, update, delete, and trace automations
  • Entity Operations: Query and manipulate Home Assistant entities
  • Service Calls: Execute Home Assistant services
  • Configuration: Validate and manage Home Assistant configuration
  • Registry Access: Access entity and device registries
  • Config Entry Flow Helpers: Create and manage Home Assistant integration flows

⚠️ TOKEN COST WARNING

Important: Each tool definition consumes tokens in your LLM context, even if unused! Some tools (like update-lovelace-config) can cost 4,000+ tokens alone. Consider excluding unnecessary tools to minimize token consumption and maximize conversation efficiency.

For a complete list of all available tools with detailed descriptions and parameters, see the Tools Documentation.

Generating Tools Documentation

The tools documentation is automatically generated from the MCP server:

sh
npm run generate-docs

This command will:

  1. Extract all available tools from the MCP server using the inspector
  2. Generate a comprehensive markdown documentation file (tools.md)
  3. Clean up temporary files

Note: The tools documentation shows the server currently provides 39 tools for comprehensive Home Assistant integration.

Project Structure

  • src/ - Main source code
    • hass/ - Home Assistant client and helpers
    • server/ - MCP server implementations
    • mcpTransports.ts - Transport layer implementations (HTTP, SSE)
  • tests/ - Test files and Home Assistant config examples
  • scripts/ - Build and documentation generation scripts
  • Dockerfile - Containerization support
  • package.json - Project dependencies and scripts
  • tsconfig.json - TypeScript configuration
  • vitest.config.ts - Vitest test runner configuration

Example: Running the MCP Server

The MCP server supports multiple transport methods. You can run it using the same command and argument structure as in your mcp_settings.json.

1. Run with STDIO Transport (Default)

For traditional MCP client integration via stdio (server is launched by MCP client):

jsonc
{  "type": "stdio",  "command": "tsx",  "args": [    "c:/dev/git/aha-mcp/src/index.ts"  ],  "env": {    "LIMIT_RESOURCES": "-1",    "RESOURCES_TO_TOOLS": "true",    "DEBUG": "true",    "HASS_URL": "https://your-home-assistant.local:8123",    "HASS_ACCESS_TOKEN": "<your_token_here>"  }}

2. Run with Server-Sent Events (SSE) Transport

For SSE-based MCP communication, you need to run the server separately and then configure the MCP client to connect via URL.

Step 1: Start the SSE server

bash
# Start the server with SSE transport using npm scriptHASS_URL=https://your-home-assistant.local:8123 HASS_ACCESS_TOKEN=<your_token_here> npm run start:local:sse
# Or with additional configurationRESOURCES_TO_TOOLS=true DEBUG=true HASS_URL=https://your-home-assistant.local:8123 HASS_ACCESS_TOKEN=<your_token_here> npm run start:local:sse

Step 2: Configure MCP client to connect via URL

jsonc
{  "url": "http://localhost:8081/sse",  "alwaysAllow": [    // your allowed tools here  ]}

3. Run with Streamable HTTP Transport

For HTTP-based MCP communication, you need to run the server separately and then configure the MCP client to connect via URL.

Step 1: Start the HTTP server

bash
# Start the server with streamable HTTP transport using npm scriptHASS_URL=https://your-home-assistant.local:8123 HASS_ACCESS_TOKEN=<your_token_here> npm run start:local:http

Step 2: Configure MCP client to connect via URL

jsonc
{  "url": "http://localhost:8081/mcp",  "alwaysAllow": [    // your allowed tools here  ]}

4. Quick SSE Server Startup

Start the SSE server directly with npm scripts:

bash
# Set your Home Assistant credentials firstexport HASS_URL=https://your-home-assistant.local:8123export HASS_ACCESS_TOKEN=<your_token_here>
# Start SSE server with RESOURCES_TO_TOOLS enabledRESOURCES_TO_TOOLS=true DEBUG=true npm run start:local:sse

Then configure your MCP client with:

jsonc
{  "url": "http://localhost:3000/sse"}

5. Run with Podman/Docker - STDIO Transport

For STDIO transport with containers:

jsonc
{  "type": "stdio",  "command": "podman",  "args": [    "run",    "-i",    "--rm",    "-e",    "HASS_URL=https://your-home-assistant.local:8123",    "-e",    "HASS_ACCESS_TOKEN=<your_token_here>",    "ghcr.io/slhad/aha-mcp:latest"  ]}

6. Run with Podman/Docker - HTTP/SSE Server

For HTTP/SSE transports, run the server separately in a container:

Step 1: Start the server container

bash
# For SSE transportpodman run -p 8081:8081 -e HASS_URL=https://your-home-assistant.local:8123 -e HASS_ACCESS_TOKEN=<your_token_here> ghcr.io/slhad/aha-mcp -- sse
# For HTTP transport  podman run -p 8081:8081 -e HASS_URL=https://your-home-assistant.local:8123 -e HASS_ACCESS_TOKEN=<your_token_here> ghcr.io/slhad/aha-mcp -- http

Step 2: Configure MCP client

jsonc
{  "url": "http://localhost:3000/sse",  // for SSE  // or  "url": "http://localhost:3000/mcp"   // for HTTP}

Replace <your_token_here> with your actual Home Assistant access token.

Environment Variables

The following environment variables can be set to configure the MCP server:

  • HASS_URL (required): The URL of your Home Assistant instance. Example: https://your-home-assistant.local:8123 (default in code: http://localhost:8123)
  • HASS_ACCESS_TOKEN (required): Long-lived access token for Home Assistant. The server will not start without this.
  • DEBUG: Set to true to enable debug logging. Default: false.
  • RESOURCES_TO_TOOLS: Set to true to enable mapping resources to tools. Default: false.
    • Detailed explanation: When enabled, this option exposes Home Assistant resources (such as entities, automations, and services) as individual tools for MCP clients. This is especially useful for clients or agents that can only interact with the server via tool-based interfaces, rather than through generic resource queries. It allows such clients to discover and use Home Assistant features as discrete, callable tools, improving compatibility and usability for tool-limited environments.
  • LIMIT_RESOURCES: Set to a number to limit the number of resources returned by the server. Default: unlimited.

Note: The server transport method is now controlled by command line arguments (sse or http) rather than environment variables.

Getting Started

Prerequisites

  • Node.js (v18+ recommended)
  • Docker (optional, for containerized deployment)

Installation

sh
npm install

Running the Server

For STDIO transport (launched by MCP client):

sh
# Set environment variables and run with npmnpm start

For HTTP/SSE transports (run server separately):

sh
# Run SSE server on port 8081npm run start:local:sse
# Run HTTP server on port 8081:8081npm run start:local:http
# Quick SSE server startup with environment variablesRESOURCES_TO_TOOLS=true DEBUG=true npm run start:local:sse

Then configure your MCP client to connect via URL:

  • SSE: "url": "http://localhost:3000/sse"
  • HTTP: "url": "http://localhost:8080/mcp"

Running Tests

sh
npm run test:short

Note: The unit tests currently run against a real Home Assistant instance and are not mocked yet. This means tests require a live Home Assistant server and valid credentials to execute successfully.

Docker Usage

Build and run the server in a Docker container:

sh
# Build the containernpm run docker

then follow :

For HTTP/SSE modes, then configure your MCP client with the appropriate URL:

  • SSE: "url": "http://localhost:3000/sse"
  • HTTP: "url": "http://localhost:8081/mcp"

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

See LICENSE for details.

來源:README.md,提交 a212cba

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Smithery 整合