שרת MCP מאומת: Home Assistant

שרת ה-MCP ל-Home Assistant, הכלים שלו נספרו בריצה חיה על Mac אמיתי.

  • הכלים נספרו2026-08-04macOS 15.7.7
  • חבילהhass-mcp 0.5.0
  • מדווח על עצמוHass-MCP 1.29.0
  • פרוטוקול MCP2025-06-18
  • סביבת ריצהv24.18.0

רשימת הכלים למטה היא לכידה חיה מהשרת הרץ; קריאת כלי מאומתת עדיין ממתינה להרשאות.

התשובה הקצרה

אומת לאחרונה 2026-08-04

שרת ה-MCP ל-Home Assistant מחבר עוזר AI למרכזייה שכבר מפעילה אצלכם את התאורה, התרמוסטטים, המנעולים, התריסים והחיישנים. 16 הכלים שלו קוראים את המצב של כל ישות, מדליקים ומכבים, מקבצים ישויות לפי חדר, מציגים את האוטומציות שלכם, מושכים היסטוריה וסטטיסטיקה ארוכת טווח, מסננים את יומן השגיאות, קוראים לכל שירות של Home Assistant ומפעילים מחדש את המרכזייה עצמה. הוא אינו מפורסם על ידי פרויקט Home Assistant: העמוד הזה עוסק ב-hass-mcp, חבילה עצמאית ברישיון MIT של המפתח voska ב-GitHub, עם 312 כוכבים ודחיפת קוד מ-2026-07-28, שמותקנת ועולה בפקודת uvx אחת. סיפור אישורי הגישה שלו קצר: שני משתני סביבה, HA_URL לכתובת שבה אתם כבר פותחים את Home Assistant ו-HA_TOKEN לאסימון גישה ארוך טווח שאתם מייצרים בתוכו, בלי מסך OAuth ובלי חשבון של צד שלישי באמצע. מה שמופיע כאן הוא הריצה עצמה, כולל החלק שנכשל. הפעלנו אותו על Mac עם uvx, השלמנו את לחיצת היד של MCP, והוא ענה ל-tools/list עם כל 16 הכלים, שהם הטבלה שלמטה, מילה במילה. קריאת הכלי האמיתית היחידה שביצענו, get_version, חזרה עם שגיאת החיבור של השרת עצמו במקום מספר גרסה, כי אין על ה-Mac הזה מופע של Home Assistant ואין כזה שאפשר להגיע אליו ממנו. לכן טבלת הכלים נספרה בריצה חיה וכל שגיאה בעמוד הזה היא פלט שלכדנו, בעוד קריאה שבאמת מגיעה למרכזייה עדיין ממתינה לאחת משלכם. [1][3][4]

  • כלים

    16, נספרו בריצה חיה

  • אישורי גישה

    כתובת המרכזייה ואסימון גישה [4]

  • ערוץ תקשורת

    stdio, רץ על ה-Mac שלכם [4]

  • מתחזק

    voska, קהילתי [3][1]

  • הורדות

    1,257 בשבוע האחרון [2]

  • רישיון

    MIT [3]

אימות

איך שרת ה-MCP הזה אומת.

השיטה

הרצנו את השרת עם uvx על גבי stdio, כאשר HA_URL מצביע אל ‎http://homeassistant.local:8123, אותה כתובת שמופיעה בבלוקי ההגדרה בעמוד הזה, ו-HA_TOKEN מוגדר למחרוזת מציינת מקום ברורה, כי על ה-Mac הזה לא רץ מופע של Home Assistant ואין כזה שאפשר להגיע אליו ממנו. לחיצת היד של MCP הושלמה, השרת הציג את עצמו כ-Hass-MCP 1.29.0 על פרוטוקול 2025-06-18, ו-tools/list ענה עם כל 16 הכלים, שהם הטבלה שלמטה, מילה במילה. הוא אינו מדפיס באנר משלו בהפעלה: השורה הראשונה המצוטטת למטה היא uv שמדווח על החבילות שהתקין, וארבע השורות אחריה הן כל מה שהשרת עצמו כתב ל-stderr, יומן משלו של שתי הבקשות ששלחנו לו. אחר כך ביצענו קריאת כלי אמיתית אחת, get_version בלי ארגומנטים, והיא החזירה את שגיאת החיבור המצוטטת תחת קריאת הדוגמה, כך שהקטע שבעמוד הזה הוא שגיאה ולא תוצאה: השרת ניסה להגיע ל-Home Assistant, נכשל, ודיווח על הכישלון כטקסט רגיל של כלי ולא כשגיאת פרוטוקול. לכן הכלים נספרו בריצה חיה וכל שגיאה כאן היא פלט שלכדנו, בעוד קריאה מאומתת מוצלחת עדיין ממתינה לכתובת של Home Assistant ולאסימון גישה ארוך טווח, ששניהם אינם קיימים על ה-Mac הזה. ארבע בדיקות כשל מכוונות רצו על אותו Mac דקות ספורות לאחר מכן ומצוטטות במלואן בקטע פתרון התקלות: בלי אישורי גישה בכלל, ארגומנט בצורה שגויה, כתובת מרכזייה שאין אליה נתיב רשת, ומארח אמיתי שאינו Home Assistant.

הודעת הפתיחה של השרת

Installed 39 packages in 155ms
2026-08-04 01:11:09,736 - mcp.server.lowlevel.server - INFO - Processing request of type ListToolsRequest
2026-08-04 01:11:09,738 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest
2026-08-04 01:11:09,738 - app.server - INFO - Executing command: get_version
2026-08-04 01:11:09,738 - app.server - INFO - Getting Home Assistant version

קריאת כלי אמיתית אחת

tools/call get_version {}
Connection error: Cannot connect to Home Assistant at http://homeassistant.local:8123

שורות אמיתיות מהתוצאה שנלכדה: מספיק כדי להוכיח שהקריאה נענתה.

כלים

הכלים, כפי שנספרו מהשרת הרץ.

השרת ענה ל-tools/list עם 16 כלים בתאריך 2026-08-04. השמות, התיאורים והפרמטרים למטה הם המילים שלו עצמו, מועתקים מהתשובה הזו וללא עריכה.

כלימה הוא עושה
get_version

Get the Home Assistant version Returns: A string with the Home Assistant version (e.g., "2025.3.0")

get_entityentity_id*fieldsdetailed

Get the state of a Home Assistant entity with optional field filtering Args: entity_id: The entity ID to get (e.g. 'light.living_room') fields: Optional list of fields to include (e.g. ['state', 'attr.brightness']) detailed: If True, returns all entity fields without filtering Examples: entity_id="light.living_room" - basic state check entity_id="light.living_room", fields=["state", "attr.brightness"] - specific fields entity_id="light.living_room", detailed=True - all details

entity_actionentity_id*action*params

Perform an action on a Home Assistant entity (on, off, toggle) Args: entity_id: The entity ID to control (e.g. 'light.living_room') action: The action to perform ('on', 'off', 'toggle') params: Optional dictionary of additional parameters for the service call Returns: The response from Home Assistant Examples: entity_id="light.living_room", action="on", params={"brightness": 255} entity_id="switch.garden_lights", action="off" entity_id="climate.living_room", action="on", params={"temperature": 22.5} Domain-Specific Parameters: - Lights: brightness (0-255), color_temp, rgb_color, transition, effect - Covers: position (0-100), tilt_position - Climate: temperature, target_temp_high, target_temp_low, hvac_mode - Media players: source, volume_level (0-1)

list_entitiesdomainsearch_querylimitfieldsdetailed

Get a list of Home Assistant entities with optional filtering Args: domain: Optional domain to filter by (e.g., 'light', 'switch', 'sensor') search_query: Optional search term to filter entities by name, id, or attributes (Note: Does not support wildcards. To get all entities, leave this empty) limit: Maximum number of entities to return (default: 100) fields: Optional list of specific fields to include in each entity detailed: If True, returns all entity fields without filtering Returns: A list of entity dictionaries with lean formatting by default Examples: domain="light" - get all lights search_query="kitchen", limit=20 - search entities domain="sensor", detailed=True - full sensor details Best Practices: - Use lean format (default) for most operations - Prefer domain filtering over no filtering - For domain overviews, use domain_summary_tool instead of list_entities - Only request detailed=True when necessary for full attribute inspection - To get all entity types/domains, use list_entities without a domain filter, then extract domains from entity_ids

get_entities_by_areaarea*domainlean

Get all entities assigned to a specific Home Assistant area (room). Area lookup is case-insensitive and matches the area's name as configured in Home Assistant (e.g., "Kitchen", "Living Room"). Entities inherit their area from their parent device when no area is set directly, matching HA's own resolution behavior. Args: area: Name of the area to filter by (case-insensitive) domain: Optional domain to further filter results (e.g., 'light') lean: If True (default), returns token-efficient entity records Returns: A dictionary containing: - area: The matched area name (as canonicalized by HA) - count: Number of matching entities - entities: List of entity records with their state and area Examples: get_entities_by_area(area="Kitchen") - everything in the kitchen get_entities_by_area(area="Living Room", domain="light") - lights only

search_entities_toolquery*limit

Search for entities matching a query string Args: query: The search query to match against entity IDs, names, and attributes. (Note: Does not support wildcards. To get all entities, leave this blank or use list_entities tool) limit: Maximum number of results to return (default: 20) Returns: A dictionary containing search results and metadata: - count: Total number of matching entities found - results: List of matching entities with essential information - domains: Map of domains with counts (e.g. {"light": 3, "sensor": 2}) Examples: query="temperature" - find temperature entities query="living room", limit=10 - find living room entities query="", limit=500 - list all entity types

domain_summary_tooldomain*example_limit

Get a summary of entities in a specific domain Args: domain: The domain to summarize (e.g., 'light', 'switch', 'sensor') example_limit: Maximum number of examples to include for each state Returns: A dictionary containing: - total_count: Number of entities in the domain - state_distribution: Count of entities in each state - examples: Sample entities for each state - common_attributes: Most frequently occurring attributes Examples: domain="light" - get light summary domain="climate", example_limit=5 - climate summary with more examples Best Practices: - Use this before retrieving all entities in a domain to understand what's available

system_overview

Get a comprehensive overview of the entire Home Assistant system Returns: A dictionary containing: - total_entities: Total count of all entities - domains: Dictionary of domains with their entity counts and state distributions - domain_samples: Representative sample entities for each domain (2-3 per domain) - domain_attributes: Common attributes for each domain - area_distribution: Entities grouped by area (if available) Examples: Returns domain counts, sample entities, and common attributes Best Practices: - Use this as the first call when exploring an unfamiliar Home Assistant instance - Perfect for building context about the structure of the smart home - After getting an overview, use domain_summary_tool to dig deeper into specific domains

list_automations

Get a list of all automations from Home Assistant This function retrieves all automations configured in Home Assistant, including their IDs, entity IDs, state, and display names. Returns: A list of automation dictionaries, each containing id, entity_id, state, and alias (friendly name) fields. Examples: Returns all automation objects with state and friendly names

restart_ha

Restart Home Assistant ⚠️ WARNING: Temporarily disrupts all Home Assistant operations Returns: Result of restart operation

call_service_tooldomain*service*data

Call any Home Assistant service (low-level API access) Args: domain: The domain of the service (e.g., 'light', 'switch', 'automation') service: The service to call (e.g., 'turn_on', 'turn_off', 'toggle') data: Optional data to pass to the service (e.g., {'entity_id': 'light.living_room'}) Returns: A dictionary with success status, the domain/service called, and the list of affected entity states returned by Home Assistant. Examples: domain='light', service='turn_on', data={'entity_id': 'light.x', 'brightness': 255} domain='automation', service='reload' domain='fan', service='set_percentage', data={'entity_id': 'fan.x', 'percentage': 50}

get_historyentity_id*hours

Get the history of an entity's state changes Args: entity_id: The entity ID to get history for hours: Number of hours of history to retrieve (default: 24) Returns: A dictionary containing: - entity_id: The entity ID requested - states: List of state objects with timestamps - count: Number of state changes found - first_changed: Timestamp of earliest state change - last_changed: Timestamp of most recent state change Examples: entity_id="light.living_room" - get 24h history entity_id="sensor.temperature", hours=168 - get 7 day history Best Practices: - Keep hours reasonable (24-72) for token efficiency - Use for entities with discrete state changes rather than continuously changing sensors - Consider the state distribution rather than every individual state

get_history_rangeentity_id*start_time*end_time

Get raw state-change history for an entity over a date/time range. Like `get_history`, but takes an explicit window instead of "N hours from now". Useful for inspecting what happened on a specific day or correlating with an external event. Args: entity_id: The entity to fetch history for. start_time: ISO-8601 start (e.g. `2026-05-15` or `2026-05-15T08:00:00Z`). Treated as UTC if no offset. end_time: ISO-8601 end. Defaults to now (UTC). Returns: Same shape as `get_history`: `entity_id`, `states`, `count`, `first_changed`, `last_changed`. Examples: get_history_range("light.kitchen", "2026-05-15") get_history_range("sensor.power", "2026-05-15T00:00:00Z", "2026-05-16T00:00:00Z") Best Practices: - Bound the window — wider ranges return more data and more tokens. - For aggregated long-term data, prefer `get_statistics_range`.

get_statisticsentity_id*hoursperiod

Get long-term aggregated statistics for an entity over the last N hours. Uses HA's recorder statistics (over WebSocket) — aggregated buckets (mean / min / max per period) that survive the short-term retention window. Use this instead of `get_history` when: - You want data older than the recorder's default 10-day window. - You want aggregated values rather than every individual change. - The entity is a high-frequency sensor (temperature, power) and raw history would be too many tokens. Args: entity_id: The entity (must have a `state_class` HA records as statistics — `measurement`, `total`, `total_increasing`). hours: How far back from now. Defaults to 24. period: Bucket size — `5minute`, `hour`, `day`, `week`, `month`. Defaults to `hour`. Returns: `entity_id`, `period`, `start_time`, `end_time`, `statistics` (list of `{start, end, mean, min, max, ...}` points). Examples: get_statistics("sensor.power_usage", hours=168, period="day") get_statistics("sensor.temperature", hours=24)

get_statistics_rangeentity_id*start_time*end_timeperiod

Get long-term aggregated statistics for an entity over a date/time range. Same data source as `get_statistics`, but with an explicit window — useful for "what was my power usage from Jan 1 to Jan 31?" type questions. Aggregated bucket data survives the short-term retention window, so this works for data months/years old. Args: entity_id: The entity (must be statistics-tracked). start_time: ISO-8601 start (`2026-01-01` or `2026-01-01T00:00:00Z`). UTC if no offset. end_time: ISO-8601 end. Defaults to now. period: `5minute`, `hour`, `day`, `week`, or `month`. Returns: `entity_id`, `period`, `start_time`, `end_time`, `statistics`. Examples: get_statistics_range("sensor.energy", "2026-01-01", "2026-02-01", period="day") get_statistics_range("sensor.temperature", "2026-05-01", period="hour")

get_error_loglevelintegrationsearch_termlines

Get the Home Assistant error log for troubleshooting. All filters are optional and combine (AND semantics). Stats (error_count, warning_count, integration_mentions, total_lines) are computed over the filtered output so they match what's returned. Args: level: Filter to lines containing this log level — ERROR, WARNING, INFO, or DEBUG. Case-insensitive. integration: Filter to lines mentioning this integration. Matches `[name]` or `[homeassistant.components.name]`. Case-insensitive. search_term: Case-insensitive substring filter applied per line. Useful for entity IDs, exception names, etc. lines: Return only the most recent N lines (applied after other filters). Useful when you only care about the tail. Returns: A dictionary containing: - log_text: The (possibly filtered) error log text - error_count: Number of ERROR entries in the filtered output - warning_count: Number of WARNING entries in the filtered output - integration_mentions: Map of integration names to mention counts - total_lines: Number of lines in the filtered output - filters_applied: Map of which filter args were supplied - error: Error message if retrieval failed Examples: get_error_log() # full log get_error_log(level="ERROR") # errors only get_error_log(integration="zwave_js") # one integration get_error_log(search_term="light.kitchen") # specific entity get_error_log(level="ERROR", lines=50) # last 50 errors Best Practices: - Filter on the server side (here) rather than pulling the full log into Claude's context — saves tokens on noisy logs. - Combine `integration` + `level="ERROR"` to triage a single integration that's misbehaving. - Use `lines` to bound output when scanning a long-running HA.

פרמטרים המסומנים ב-* הם חובה.

התקנה

הגדרות שעובדות, אחת לכל אפליקציה.

העתיקו את הבלוק של האפליקציה שלכם. כל אחד מהם הוא ההגדרה המדויקת שאיתה אימתנו את השרת.

Claude Desktop

פתחו את הקובץ ‎~/Library/Application Support/Claude/claude_desktop_config.json (בתוך Claude Desktop: Settings, אחר כך Developer, אחר כך Edit Config) והוסיפו:

{
  "mcpServers": {
    "hass-mcp": {
      "command": "uvx",
      "args": [
        "hass-mcp"
      ],
      "env": {
        "HA_URL": "http://homeassistant.local:8123",
        "HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
      }
    }
  }
}

שמרו את הקובץ, ואז סגרו ופתחו מחדש את Claude Desktop. HA_URL היא הכתובת שבה אתם כבר פותחים את Home Assistant, כולל הפורט, ו-HA_TOKEN הוא אסימון גישה ארוך טווח שאתם יוצרים במרכזייה שלכם. הפקודה uvx מגיעה עם uv, מריץ חבילות ה-Python שעבורו השרת הזה מפורסם, לכן התקינו את uv קודם אם הוא לא נמצא על ה-Mac. הפרויקט מתעד גם גרסת Docker של אותה רשומה, עם command בערך docker וארגומנטים run, ‎-i, ‎--rm, ‎-e HA_URL, ‎-e HA_TOKEN, voska/hass-mcp, עם אותו בלוק env. [8][4]

Claude Code

פקודה אחת בטרמינל:

claude mcp add hass-mcp -e HA_URL=http://homeassistant.local:8123 -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN -- uvx hass-mcp

כל דגל ‎-e מגדיר משתנה סביבה אחד, וכל מה שאחרי המקף הכפול הוא הפקודה המדויקת ש-Claude Code יריץ, והיא בדיוק הפקודה שאימתנו. החליפו את הכתובת בכתובת המרכזייה שלכם ואת מציין המקום באסימון שלכם. הריצו אחר כך claude mcp list כדי לוודא שהשרת נוסף. [9][4]

Cursor

הוסיפו ל-‎~/.cursor/mcp.json עבור כל הפרויקטים, או ל-‎.cursor/mcp.json בתוך פרויקט אחד:

{
  "mcpServers": {
    "hass-mcp": {
      "command": "uvx",
      "args": [
        "hass-mcp"
      ],
      "env": {
        "HA_URL": "http://homeassistant.local:8123",
        "HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
      }
    }
  }
}

Cursor קורא את הקובץ מחדש אחרי הפעלה מחדש. השאירו את האסימון בבלוק ה-env ולא בתוך args: args היא שורת פקודה, וכל מי שיכול לראות את רשימת התהליכים על ה-Mac רואה גם אותה. קובץ ‎.cursor/mcp.json ברמת הפרויקט שנשמר ב-git ייקח את האסימון איתו, לכן עדיף הקובץ שבתיקיית הבית. [10][4]

Routines

בלי קובץ JSON ובלי טרמינל, ברגע ש-uv מותקן. ב-Routines: Settings, אחר כך Assistant, אחר כך Connections, אחר כך Add MCP Server. העבירו את הטופס ל-Command (stdio) והזינו:

Name        Home Assistant
Command     uvx
Arguments   hass-mcp

Environment Variables
HA_URL      http://homeassistant.local:8123
HA_TOKEN    YOUR_LONG_LIVED_TOKEN

הערך בשדה ה-Arguments מתפצל לפי רווחים, לכן השאירו בו מילה אחת בלבד, והכניסו את האסימון ל-Environment Variables ולעולם לא ל-Arguments. לחצו קודם על Test Connection: שרת תקין עונה עם מספר הכלים שלו, שישה עשר עבור השרת הזה. בדיקה ירוקה אומרת שהשרת עלה, לא שהמרכזייה שלכם ענתה, כי השרת הזה מציג את הכלים שלו עוד לפני שהוא פונה לאן שהוא. בקשו מהעוזר אחר כך שאלת קריאה קטנה, למשל איזו גרסה של Home Assistant רצה. [11][4]

בלי טרמינל

איך מגדירים את שרת ה-MCP‏ Home Assistant בלי טרמינל.

אם מעולם לא פתחתם את הטרמינל ואין לכם כוונה להתחיל, זה המסלול שלכם, עם חריג אחד והוגן בהתחלה: השרת הזה הוא חבילת Python, והפקודה uvx שמריצה אותו מגיעה עם uv, שאותו מתקינים פעם אחת. כל השאר הוא טופס. Routines היא אפליקציית Mac שמריצה שרתי MCP בשבילכם: ממלאים כמה שדות פעם אחת, והכלים של השרת זמינים ל-AI שלכם בצ׳אט ובשגרות מתוזמנות.

  1. 01

    התקינו את Routines, ואז את uv

    הורידו את האפליקציה מ-getroutines.ai/download, גררו אותה ל-Applications והתחברו. אחר כך התקינו את uv, מריץ חבילות ה-Python שמספק את הפקודה uvx; אם אתם כבר משתמשים ב-Homebrew, זו הדרך הקצרה. שום דבר אחר סביב Python לא דורש את תשומת לבכם, כי uv מוריד בעצמו את המפרש שהחבילה מבקשת בפעם הראשונה שהיא רצה, כלומר Python 3.13 ומעלה.

  2. 02

    צרו אסימון גישה ארוך טווח

    פתחו את Home Assistant בדפדפן ולכו אל Settings, אחר כך People, אחר כך המשתמש שלכם, אחר כך Long-Lived Access Tokens, וצרו אסימון. העתיקו אותו מיד, כי Home Assistant מציג אותו פעם אחת בלבד. בהזדמנות הזו רשמו לעצמכם גם את הכתובת שבה אתם מגיעים ל-Home Assistant, כולל הפורט, למשל ‎http://homeassistant.local:8123.

  3. 03

    פתחו את הגדרות ה-MCP

    לחצו על החשבון שלכם בתחתית סרגל הצד ובחרו Settings. פתחו את הקטע Assistant, אחר כך את הלשונית Connections, גללו אל MCP Servers ולחצו על Add MCP Server.

  4. 04

    בחרו Command (stdio)‎ ותנו שם

    העבירו את הטופס ל-Command (stdio): השרת הזה הוא פקודה שה-Mac מריץ, לא כתובת אינטרנט. Name: Home Assistant. Command: uvx. Arguments: hass-mcp, מילה אחת, כי שדה ה-Arguments מתפצל לפי רווחים.

  5. 05

    הוסיפו את שני משתני הסביבה

    זה השלב שבלעדיו השרת לא יעבוד. הוסיפו שורה HA_URL עם הכתובת שרשמתם, ושורה HA_TOKEN עם האסימון שהעתקתם. שני השמות האלה מדויקים: שום שם אחר לא פותח את המרכזייה, והאסימון שייך לכאן ולא לשדה ה-Arguments.

  6. 06

    בדקו, הוסיפו והשתמשו

    לחצו Test Connection: Routines מפעילה את השרת ומדווחת כמה כלים היא מצאה, שישה עשר עבור השרת הזה. אחר כך לחצו Add Server. הכלים עובדים בצ׳אט מיד, וכדי לתת לשגרה מתוזמנת להשתמש בהם, פתחו את השגרה, מצאו את הכרטיס Tools & connections וסמנו את השרת תחת Apps.

רעיונות לשגרות

שגרות ששווה לתזמן.

אחרי שהשרת מחובר, שגרה מתוזמנת יכולה להשתמש בכלים שלו גם כשאתם לא מול המסך. העתיקו פרומפט, הדביקו אותו ב-Routines ובחרו שעה. הפרומפטים כתובים באנגלית בכוונה, מדביקים אותם בדיוק כפי שהם.

בדיקת בית לפני השינה

פרומפט

Every evening at 22:30, check my Home Assistant for any door or window sensor still reading open and any light still on, and write the list with the room for each one to house-nightly-check.md so I can see what to close before bed.

סיכום צריכת חשמל שבועי

פרומפט

Every Monday at 8:00, pull the last 7 days of daily statistics for my home energy sensor from Home Assistant, and save a short plain-English summary to energy-week.md with the daily numbers, the highest day, and whether usage is going up or down.

פתק בוקר על בריאות המרכזייה

פרומפט

Every morning at 7:30, read my Home Assistant error log filtered to ERROR lines only, and write one short paragraph to home-assistant-health.md naming any integration that keeps failing and how many times it appeared.

פתרון תקלות

השגיאות שנתקלנו בהן, ומה פתר אותן.

שגיאות אמיתיות שנלכדו בריצת האימות, מודפסות בדיוק כפי שהשרת החזיר אותן.

כל קריאת כלי עונה שלא סופק אסימון

מה רואים

No Home Assistant token provided. Please set HA_TOKEN in .env file.

הפתרון

השרת הזה עולה ומציג את כל 16 הכלים שלו גם בלי שום אישור גישה, וכך בדיוק ספרנו אותם, ולכן בדיקת חיבור שעוברת אינה מוכיחה דבר על האסימון שלכם. ההודעה מזכירה קובץ ‎.env כי כך הפרויקט רץ בפיתוח; בלקוח MCP מגדירים את HA_TOKEN בבלוק ה-env או בשורות ה-Environment Variables שמופיעות בקטע ההתקנה למעלה. צרו את האסימון ב-Home Assistant תחת Settings, אחר כך People, אחר כך המשתמש שלכם, אחר כך Long-Lived Access Tokens, והדביקו אותו במלואו.

השרת לא מצליח להתחבר ל-Home Assistant

מה רואים

Connection error: Cannot connect to Home Assistant at http://homeassistant.local:8123

הפתרון

זו התשובה המדויקת שקריאת הדוגמה שלנו קיבלה, כי שום דבר על ה-Mac הזה או ברשת שלו לא עונה בכתובת הזו. תראו את אותו משפט עם הכתובת שלכם בתוכו בכל פעם ש-HA_URL מצביע למקום שה-Mac לא מצליח לפתוח אליו חיבור: פורט שגוי, מרכזייה כבויה או מחשב ברשת אחרת. פתחו קודם את אותה כתובת בדפדפן על אותו Mac. אם Home Assistant נטען שם, העתיקו את הכתובת הזו ל-HA_URL בדיוק כפי שהיא, כולל הפורט.

timeout במקום שגיאת חיבור

מה רואים

Timeout error: Home Assistant at http://192.0.2.1:8123 did not respond in time

הפתרון

גרמנו לזה בכוונה עם כתובת שאין אליה נתיב רשת. ההבדל חשוב: חיבור שנדחה חוזר מיד, ואילו כתובת שבולעת את הבקשה מסתיימת ב-timeout, ובדרך כלל זה אומר חומת אש, VPN שמנתב את התעבורה שלכם למקום אחר, או כתובת שנפתרת למשהו שאינו המרכזייה שלכם. נסו את אותה כתובת בדפדפן מאותו Mac ותראו איזו משתי התשובות אתם מקבלים.

שגיאת HTTP במקום מספר גרסה

מה רואים

HTTP error: 404 - Not Found

הפתרון

הכתובת ענתה, אבל לא כ-Home Assistant. יצרנו את השגיאה הזו כשהצבענו עם HA_URL על אתר אינטרנט רגיל: השרת ביקש ממנו ‎/api/config וקיבל 404. הסיבות הרגילות הן כתובת שכבר יש בסופה נתיב, או reverse proxy שאינו מעביר את ה-API. הצביעו עם HA_URL על השורש של המרכזייה, בלי שום דבר אחרי הפורט. אסימון שגוי או שפג תוקפו נראה אחרת, כי הוא חוזר כ-401.

קריאת כלי נדחית עוד לפני שהיא יוצאת מה-Mac

מה רואים

Error executing tool domain_summary_tool: 1 validation error for domain_summary_toolArguments
domain
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.13/v/missing

הפתרון

השרת בודק את הארגומנטים לפני שהוא עושה משהו, וכך נראה ארגומנט חובה חסר. קראנו ל-domain_summary_tool בלי domain בכוונה. לקוח אמיתי ממלא את השדות האלה מתוך השיחה, ולכן אם נתקלתם בשגיאה הזו, אמרו למה התכוונתם: איזה domain, איזו ישות, איזה אזור. אותה בדיקה עם טיפוס שגוי מחזירה שגיאת string_type, ושם כלי שאינו קיים מקבל תשובה בוטה יותר, Unknown tool ואחריו השם ששלחתם.

לקוח ה-MCP לא מצליח להפעיל את השרת בכלל

הפתרון

הפקודה uvx שייכת ל-uv, מריץ חבילות ה-Python שעבורו השרת הזה מפורסם. אם uv לא מותקן על ה-Mac, כל לקוח בעמוד הזה ייכשל בשלב ההפעלה עוד לפני שהשרת מספיק לומר משהו. התקינו את uv, הפעילו מחדש את לקוח ה-MCP ונסו שוב. ההפעלה הראשונה היא גם האיטית ביותר, כי uv מוריד מפרש Python ואת החבילה לפני שהשרת עונה, אז תנו לה רגע לפני שתחליטו שמשהו שבור.

שאלות נפוצות

שאלות שאנשים שואלים.

מה זה שרת ה-MCP ל-Home Assistant?

זהו גשר מקומי בין עוזר AI לבין מרכזיית ה-Home Assistant שלכם. החבילה שבעמוד הזה היא hass-mcp, פרויקט עצמאי ברישיון MIT של המפתח voska ב-GitHub עם 312 כוכבים, שמפורסם ל-PyPI ועולה בפקודת uvx אחת. הוא רץ כתהליך על ה-Mac שלכם, מדבר עם אפליקציית ה-AI על גבי stdio, ומגיע ל-Home Assistant דרך ה-API של המרכזייה עצמה, בעזרת כתובת ואסימון שאתם מספקים. פרויקט Home Assistant אינו זה שמפרסם אותו. [1][3][4]

אילו כלים כלולים בשרת ה-MCP ל-Home Assistant?

השרת הרץ חשף 16 כלים, והטבלה למעלה היא פלט ה-tools/list החי, מילה במילה. הם מתחלקים לקבוצות: קריאת מצב (get_entity, list_entities, get_entities_by_area, search_entities_tool, domain_summary_tool, system_overview), פעולה על מכשירים (entity_action, call_service_tool, restart_ha), אוטומציות (list_automations), היסטוריה ומגמות (get_history, get_history_range, get_statistics, get_statistics_range) ותחזוקה (get_version, get_error_log).

האם זה בטוח לתת לעוזר AI שליטה על הבית?

קראו מה הוא יכול לעשות לפני שתחליטו. entity_action מדליק ומכבה מכשירים, call_service_tool יכול לקרוא לכל שירות של Home Assistant בלי יוצא מן הכלל, ו-restart_ha מפעיל מחדש את המרכזייה, מה שהתיאור של השרת עצמו מסמן כמשבש. האסימון שלכם הוא הגבול: אסימון גישה ארוך טווח נושא את ההרשאות של המשתמש שיצר אותו, לכן צרו אותו על משתמש Home Assistant עם ההרשאות שאתם מוכנים למסור בלבד, השאירו אותו בבלוק ה-env ולא בשורת פקודה, ומחקו אותו ב-Home Assistant ביום שתפסיקו להשתמש בו. שווה להיות בוטים גם לגבי גבולות העמוד הזה: הריצה שלנו מעולם לא הגיעה למרכזייה, ולכן שום דבר כאן לא מדגים קריאה או הפעלה של מכשיר. [4]

אילו אישורי גישה שרת ה-MCP ל-Home Assistant דורש?

בדיוק שני משתני סביבה, HA_URL ו-HA_TOKEN, ושום דבר נוסף: בלי מסך OAuth, בלי חשבון ספק ובלי מפתח API של צד שלישי. HA_URL היא הכתובת שבה אתם כבר פותחים את Home Assistant, כולל הפורט. HA_TOKEN הוא אסימון גישה ארוך טווח שאתם יוצרים במרכזייה שלכם, תחת Settings, אחר כך People, אחר כך המשתמש שלכם, אחר כך Long-Lived Access Tokens. בלי האסימון השרת עדיין עולה ועדיין מציג את כל 16 הכלים, וכך בדיוק נלכדה הטבלה שלמעלה, וכל קריאה עונה אז בהודעת האסימון החסר המצוטטת בקטע פתרון התקלות. [4]

האם זה שרת ה-MCP הרשמי של Home Assistant?

לא, וההבחנה חשובה. hass-mcp היא חבילה קהילתית שלקוח ה-AI שלכם מפעיל על ה-Mac, והיא זו שפונה החוצה אל המרכזייה. ל-Home Assistant יש בנפרד אינטגרציה מובנית משלה בשם Model Context Protocol Server, שעובדת בכיוון ההפוך: מפעילים אותה בתוך Home Assistant, והיא חושפת את המרכזייה עצמה כשרת MCP מרוחק בכתובת ‎/api/mcp, ומציגה רק את הישויות שחשפתם ל-Assist. אם אתם רוצים גשר נייד שאפשר לכוון אליו כל לקוח MCP, זה העמוד הנכון. אם אתם כבר מריצים Home Assistant ולא רוצים להתקין שום דבר נוסף על ה-Mac, הסתכלו על האינטגרציה המובנית. [6][7]

צריך טרמינל כדי להגדיר אותו?

פעם אחת, כדי להתקין את uv, שמספק את הפקודה uvx שמפעילה את השרת. שום דבר אחר סביב Python אינו הבעיה שלכם: החבילה מצהירה על Python 3.13 ומעלה ועל console script בשם hass-mcp, ו-uv מוריד מפרש מתאים בהפעלה הראשונה. אחרי זה Routines היא טופס: שם, פקודה, ארגומנט אחד, שני משתני סביבה וכפתור Test Connection, והמדריך למעלה מראה כל לחיצה. Claude Desktop ו-Cursor דורשים עריכה חד-פעמית של קובץ JSON קטן. רק Claude Code הוא כלי טרמינל מטבעו. [5][11][8]

למה PyPI מציג 0.5.0 אבל השרת מדווח 1.29.0?

שני המספרים אמיתיים ולכדנו את שניהם. הגרסה האחרונה של hass-mcp ב-PyPI היא 0.5.0, שפורסמה ב-2026-06-23. על גבי MCP, השרת הרץ מציג את עצמו כ-Hass-MCP 1.29.0, מונה פנימי שהמתחזק מנהל בנפרד מתגית השחרור. אותו קוד, שתי שיטות מספור, ואף אחת מהן אינה טעות. [1]

מקורות

כל טענה חיצונית, עם קבלה.

כל מה שבעמוד הזה שלא ראינו בעצמנו בריצה מקושר כאן, עם התאריך שבו קראנו אותו. לגבי השאר, הריצה עצמה היא הקבלה.

  1. [1]

    PyPI JSON API: hass-mcpנקרא בתאריך 2026-08-03

    Latest version 0.5.0, published 2026-06-23.

  2. [2]

    PyPI download stats: hass-mcpנקרא בתאריך 2026-08-03

    1,257 downloads in the last week, 10,428 in the last month and 154 in the last day at access time.

  3. [3]

    GitHub: voska/hass-mcpנקרא בתאריך 2026-08-03

    312 stars, a push dated 2026-07-28, MIT license, not archived, 7 open issues, owner voska, per the GitHub API at access time.

  4. [4]

    hass-mcp README (master)נקרא בתאריך 2026-08-03

    Source for the HA_URL and HA_TOKEN environment variables, the client config blocks, the Docker alternative, and the streamable HTTP mode started with uvx hass-mcp --http --port 8000, which binds to 127.0.0.1.

  5. [5]

    hass-mcp pyproject.toml (master)נקרא בתאריך 2026-08-03

    requires-python is >=3.13, the dependency is mcp[cli] >=1.27,<2, and the console script is hass-mcp = "app.run:main", which is what uvx hass-mcp starts.

  6. [6]

    Home Assistant docs: Model Context Protocol Serverנקרא בתאריך 2026-08-03

    Home Assistant's own built-in integration, which exposes the hub as a remote MCP server at /api/mcp: the opposite direction from hass-mcp.

  7. [7]

    Home Assistant docs: Expose devices to Assistנקרא בתאריך 2026-08-03

    The exposed-entity list that the built-in MCP Server integration surfaces, and nothing beyond it.

  8. [8]

    modelcontextprotocol.io: Connect to local MCP serversנקרא בתאריך 2026-08-03

    The claude_desktop_config.json shape and where the file lives on macOS.

  9. [9]

    Claude Code docs: MCPנקרא בתאריך 2026-08-03

    The claude mcp add syntax for local stdio servers, including the -e flag and the double-dash separator.

  10. [10]

    Cursor docs: Model Context Protocolנקרא בתאריך 2026-08-03

    The mcp.json shape and file locations.

  11. [11]

    Routines: Connectorsנקרא בתאריך 2026-08-03

    How Routines runs one-click OAuth connectors and any MCP server.

העמוד הזה מתאר את Home Assistant כפי שהתנהג בריצה מתוארכת אחת על Mac אחד. גרסאות משתנות: אם משהו כאן כבר לא תואם למה שאתם רואים, תאריך הלכידה בראש העמוד אומר בן כמה הצילום.

מאחורי המדריך הזה

Routines, האפליקציה שמאחורי המדריך הזה, מריצה שרתי MCP כמו זה בלי טרמינל: כך עובדים המחברים. הפתקים שלכם נשארים קובצי markdown על ה-Mac שלכם, אין חשבון ענן לשלם, והיא עובדת גם בלי אינטרנט. להורדת Routines