Skip to main content
Glama
hekmon8

Home Assistant MCP Server

by hekmon8

ホームアシスタントMCPサーバー

Home Assistantと連携するためのモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、MCP対応アプリケーションを通じてHome Assistantデバイスを制御および監視するためのツールを提供します。

このプロジェクトは、AIモデルコンテキストプロトコル(MCP)エコシステムの一部です。MCPツールに関する詳細情報とドキュメントについては、 www.aimcp.infoをご覧ください。

特徴

  • デバイスの状態を取得する

  • 制御デバイスの状態(オン/オフ)

  • 自動化をトリガーする

  • 利用可能なエンティティの一覧

Related MCP server: Hass-MCP

インストール

  1. このリポジトリをクローンします:

git clone https://github.com/yourusername/homeassistant-server-mcp.git
cd homeassistant-server-mcp
  1. 依存関係をインストールします:

npm install
  1. プロジェクトをビルドします。

npm run build
  1. MCP 設定ファイル (通常、VSCode の場合は~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonにあります) に次のコードを追加して、MCP サーバーを構成します。

{
  "mcpServers": {
    "homeassistant": {
      "command": "node",
      "args": ["/path/to/homeassistant-mcp/homeassistant-server/build/index.js"],
      "env": {
        "HA_URL": "http://your-homeassistant-url:8123",
        "HA_TOKEN": "your-long-lived-access-token"
      }
    }
  }
}

your-homeassistant-urlyour-long-lived-access-token Home Assistant インスタンスの URL とアクセス トークンに置き換えます。

使用法

サーバーは次のツールを提供します。

1. デバイスの状態を取得する

// Example usage
use_mcp_tool({
  server_name: "homeassistant",
  tool_name: "get_state",
  arguments: {
    entity_id: "light.living_room"
  }
});

2. デバイスの状態を切り替える

// Example usage
use_mcp_tool({
  server_name: "homeassistant",
  tool_name: "toggle_entity",
  arguments: {
    entity_id: "switch.bedroom",
    state: "on"  // or "off"
  }
});

3. トリガーオートメーション

// Example usage
use_mcp_tool({
  server_name: "homeassistant",
  tool_name: "trigger_automation",
  arguments: {
    automation_id: "automation.morning_routine"
  }
});

4. リストエンティティ

// Example usage
use_mcp_tool({
  server_name: "homeassistant",
  tool_name: "list_entities",
  arguments: {
    domain: "light"  // optional, filters by domain
  }
});

貢献

貢献を歓迎します!ご協力いただける方法は次のとおりです。

  1. リポジトリをフォークする

  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature

  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )

  4. ブランチにプッシュする ( git push origin feature/amazing-feature )

  5. プルリクエストを開く

必要に応じてテストを更新し、既存のコード スタイルに従ってください。

ドキュメント

MCP ツールとエコシステムに関する詳細なドキュメントについては、以下を参照してください。

  • www.aimcp.infoをご覧ください

  • ウェブサイトのMCPツールディレクトリを確認してください

  • 統合ガイドとベストプラクティスを読む

ライセンス

このプロジェクトは MIT ライセンスの下でライセンスされています - 詳細については以下を参照してください:

MIT License

Copyright (c) 2024 homeassistant-mcp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

安全

このサーバーを安全に使用するには:

  1. Home Assistantインスタンスでは常にHTTPSを使用してください

  2. アクセストークンを安全に保ち、バージョン管理にコミットしないでください。

  3. アクセストークンを定期的にローテーションする

  4. 機密情報には環境変数を使用する

サポート

問題が発生した場合やご質問がある場合は、以下をご覧ください。

  1. リポジトリ内の既存の問題を確認する

  2. 問題が報告されていない場合は、新しい問題を作成してください

  3. 問題を報告するときは、できるだけ多くのコンテキストを提供してください

  4. 追加のサポートリソースについては、 www.aimcp.infoをご覧ください。

Available Tools

4 tools
get_stateC

Get the current state of a Home Assistant entity

ParametersJSON Schema
NameRequiredDescriptionDefault
entity_idYesThe entity ID to get state for (e.g., light.living_room)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a 'Get' operation, implying read-only behavior, but doesn't clarify if it requires authentication, has rate limits, returns error states, or what the output format might be (e.g., JSON with state attributes). For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Get the current state'). There is zero waste—every word contributes directly to understanding the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't address what the tool returns (e.g., state value, attributes, timestamps) or potential errors, which is critical for a read operation in a home automation context. The description alone is insufficient for full agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'entity_id' parameter fully documented in the schema. The description adds no additional meaning beyond what the schema provides (e.g., no examples beyond the schema's 'light.living_room', no context on entity ID formats). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('current state of a Home Assistant entity'), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'list_entities' (which likely lists entities rather than getting state) or 'toggle_entity' (which changes state), but the specificity of 'current state' provides some implicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_entities' or 'toggle_entity'. It doesn't mention prerequisites (e.g., needing a valid entity ID) or exclusions (e.g., not for modifying state). Usage is implied by the action but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_entitiesC

List all available entities in Home Assistant

ParametersJSON Schema
NameRequiredDescriptionDefault
domainNoOptional domain filter (e.g., light, switch, automation)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information on permissions needed, rate limits, pagination, return format, or whether it's safe/read-only. For a listing tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that likely returns a list of entities. It doesn't explain what information is returned (e.g., entity IDs, names, states) or behavioral aspects like safety. For a listing tool in this context, more detail would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'domain' documented as an optional filter. The description doesn't add any parameter details beyond what the schema provides, so it meets the baseline score of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('all available entities in Home Assistant'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_state' which might also retrieve entity information, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_state' (which might retrieve specific entity states) or 'toggle_entity' (which modifies entities). The description implies a broad listing function but doesn't specify use cases or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

toggle_entityC

Toggle a Home Assistant entity on/off

ParametersJSON Schema
NameRequiredDescriptionDefault
entity_idYesThe entity ID to toggle (e.g., switch.bedroom)
stateYesThe desired state (on/off)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as required permissions, whether this is a destructive/mutative operation (implied but not explicit), error handling, or side effects (e.g., triggering automations).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, front-loading the core action. It's appropriately sized for a simple toggle operation with well-documented parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a mutative tool. It lacks context on permissions, error responses, or what happens post-toggle (e.g., state change confirmation), leaving gaps for agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters (entity_id with examples, state with enum). The description adds no additional meaning beyond implying the tool uses these parameters, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('toggle') and resource ('a Home Assistant entity'), specifying the action of switching between on/off states. It distinguishes from siblings like 'get_state' (read-only) and 'list_entities' (listing), but doesn't explicitly differentiate from 'trigger_automation' (which might involve entities).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., entity must be toggleable), exclusions (e.g., not for sensors), or compare to siblings like 'get_state' for checking current state before toggling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

trigger_automationC

Trigger a Home Assistant automation

ParametersJSON Schema
NameRequiredDescriptionDefault
automation_idYesThe automation ID to trigger (e.g., automation.morning_routine)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'trigger' implies an action that may have side effects (e.g., starting an automation sequence), the description doesn't specify whether this requires authentication, what happens if the automation fails, or if there are rate limits. It lacks critical context for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple tool with one parameter. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation with potential side effects), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like error handling, response format, or prerequisites, leaving significant gaps for the agent to navigate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'automation_id' fully documented in the schema. The description doesn't add any parameter details beyond what the schema provides (e.g., it doesn't explain how to find automation IDs or provide examples beyond the schema's example). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('trigger') and the resource ('a Home Assistant automation'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its siblings (get_state, list_entities, toggle_entity) which all operate on different resources, so it doesn't fully distinguish itself in context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid automation ID), when not to use it, or how it differs from sibling tools like toggle_entity. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: get_state retrieves entity status, list_entities enumerates available entities, toggle_entity changes binary states, and trigger_automation initiates automations. The actions (get, list, toggle, trigger) and targets (state, entities, entity, automation) are uniquely paired, eliminating any ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case: get_state, list_entities, toggle_entity, and trigger_automation. The verbs are precise and descriptive, and the naming convention is uniform across all four tools, making them predictable and easy to understand.

Tool Count4/5

With 4 tools, the count is slightly low but reasonable for basic Home Assistant control. It covers core operations like monitoring and toggling entities, and triggering automations, though it lacks advanced actions like setting specific states or managing scenes, which might be expected in a more comprehensive set.

Completeness4/5

The tool set covers essential read and toggle operations for entities and automations, providing a functional surface for basic interactions. However, there are minor gaps, such as the inability to set specific entity states (e.g., brightness or temperature) or manage other Home Assistant components like scenes or scripts, which could limit more complex agent workflows.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.
    3
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.
    16
    337
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive Model Context Protocol server providing 60 tools across 9 categories to interact with and manage Home Assistant smart home systems via the REST API.
    5
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hekmon8/Homeassistant-server-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server