io.github.daedalus/mcp-homeassistant
MCP server exposing Home Assistant REST API functionality
Versions
0.1.0latestTools 19
get_api_status Check if the Home Assistant API is running. Returns: A dictionary containing the API status message. Example: >>> get_api_status() {"message": "API running."}
get_config Get the current Home Assistant configuration. Returns: A dictionary containing the HA configuration including components, location, unit system, and version. Example: >>> get_config() {"components": [...], "version": "2026.4.1", ...}
get_components Get list of currently loaded components. Returns: A list of component names loaded in Home Assistant. Example: >>> get_components() ["sensor.cpuspeed", "frontend", "config.core", ...]
get_events Get list of event types and their listener counts. Returns: A list of event info objects with event name and listener count. Example: >>> get_events() [{"event": "state_changed", "listener_count": 5}, ...]
get_services Get list of available services organized by domain. Returns: A list of service info objects organized by domain. Example: >>> get_services() [{"domain": "browser", "services": ["browse_url"]}, ...]
get_states Get all entity states in Home Assistant. Returns: A list of all entity states with their current values and attributes. Example: >>> get_states() [{"entity_id": "sun.sun", "state": "below_horizon", ...}, ...]
get_state Get the state of a specific entity. Args: entity_id: The entity ID to retrieve (e.g., 'sensor.kitchen_temperature'). Returns: The state object for the requested entity. Raises: requests.HTTPError: If the entity is not found (404). Example: >>> get_state("sensor.kitchen_temperature") {"entity_id": "sensor.kitchen_temperature", "state": "22.5", ...}
set_state Update or create the state of an entity. Note: This sets the representation of a device within Home Assistant and will not communicate with the actual device. To communicate with the device, use the call_service tool. Args: entity_id: The entity ID to set (e.g., 'sensor.kitchen_temperature'). state: The state value (e.g., '25', 'on', 'off'). attributes: Optional dictionary of state attributes. Returns: The updated state object. Example: >>> set_state("sensor.kitchen_temperature", "25", {"unit_of_measurement": "°C"}) {"entity_id": "sensor.kitchen_temperature", "state": "25", ...}
delete_state Delete an entity state. Args: entity_id: The entity ID to delete. Returns: A message confirming deletion. Example: >>> delete_state("sensor.kitchen_temperature") {"message": "Entity sensor.kitchen_temperature deleted"}
fire_event Fire a custom event in Home Assistant. Args: event_type: The type of event to fire. event_data: Optional dictionary of event data. Returns: A message confirming the event was fired. Example: >>> fire_event("download_file", {"next_rising": "2016-05-31T03:39:14+00:00"}) {"message": "Event download_file fired."}
call_service Call a service within a specific domain. Args: domain: The domain to call the service in (e.g., 'light', 'switch'). service: The service to call (e.g., 'turn_on', 'turn_off'). service_data: Optional dictionary of service data. return_response: Whether to include service response data in the result. Returns: A dictionary containing changed states and optionally service response. Example: >>> call_service("light", "turn_on", {"entity_id": "light.ceiling"}) [{"entity_id": "light.ceiling", "state": "on", ...}]
render_template Render a Home Assistant template. Args: template: The Jinja2 template string to render. Returns: The rendered template as plain text. Example: >>> render_template("Paulus is at {{ states('device_tracker.paulus') }}!") "Paulus is at work!"
get_history Get historical state changes for entities. Args: timestamp: Optional start timestamp (YYYY-MM-DDThh:mm:ssTZD). Defaults to 1 day ago. filter_entity_id: Comma-separated list of entity IDs to filter. end_time: Optional end timestamp for the period. minimal_response: Only return last_changed and state for intermediate states. no_attributes: Skip returning attributes from the database. significant_changes_only: Only return significant state changes. Returns: A list of lists of state objects, one list per entity. Example: >>> get_history(filter_entity_id="sensor.temperature") [[{"entity_id": "sensor.temperature", "state": "22.5", ...}, ...], ...]
get_logbook Get logbook entries. Args: timestamp: Optional start timestamp. Defaults to 1 day ago. entity: Optional entity ID to filter. end_time: Optional end timestamp. Returns: A list of logbook entry objects. Example: >>> get_logbook() [{"domain": "alarm_control_panel", "message": "changed to disarmed", ...}, ...]
check_config Validate configuration.yaml. Returns: A dictionary with the validation result and any errors. Example: >>> check_config() {"errors": null, "result": "valid"}
handle_intent Handle an intent. Args: name: The intent name to handle. data: Optional intent data. Returns: The intent handling result. Example: >>> handle_intent("SetTimer", {"seconds": "30"}) {"speech": {"plain": {"speech": "Timer set for 30 seconds"}}, ...}
get_error_log Get the error log from the current session. Returns: The error log as plain text. Example: >>> get_error_log() "15-12-20 11:02:50 homeassistant.components.recorder: Found unfinished sessions"
get_calendars Get list of calendar entities. Returns: A list of calendar entity information. Example: >>> get_calendars() [{"entity_id": "calendar.holidays", "name": "National Holidays"}, ...]
get_calendar_events Get events from a specific calendar. Args: calendar_entity_id: The calendar entity ID (e.g., 'calendar.holidays'). start: Optional start timestamp (ISO8601). end: Optional end timestamp (ISO8601). Returns: A list of calendar events. Example: >>> get_calendar_events("calendar.holidays", "2022-05-01T07:00:00.000Z", "2022-06-12T07:00:00.000Z") [{"summary": "Cinco de Mayo", "start": {"date": "2022-05-05"}, ...}, ...]
Permissions 3
network medium filesystem low env_vars low