ha-nexus-mcp

VictorCV-DAM/ha-nexus-mcp Checked 2 days ago

The Click & Install Agentic MCP Client for Home Assistant.

The Ultra-Lightweight Click & Install Agentic Intercom for Home Assistant Connect Home Assistant with cutting-edge AI models (Groq Cloud, Google Gemini, Qwen Cloud, Ollama Local) with native Tool Calling, exposed entity security, and 100% free tiers. Nexus MCP is an official member of the HACS Default Repository. You can find and install it directly through the HACS community store without adding custom repositories! ⚑ 1-Click Fast Install Click the badge above to open Nexus MCP directly inside your Home Assistant HACS store, then click Download.

Summary extracted from the README.

HACS Default Store Home Assistant MCP Ready Tests Downloads License: MIT

Buy Me A Coffee PayPal Ko-fi


πŸ“¦ Installation via HACS (Official Default Store)

Nexus MCP is an official member of the HACS Default Repository. You can find and install it directly through the HACS community store without adding custom repositories!

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

⚑ 1-Click Fast Install

Click the badge above to open Nexus MCP directly inside your Home Assistant HACS store, then click Download.

  1. Open HACS in your Home Assistant sidebar.
  2. Go to Integrations and search for Β«Nexus MCPΒ».
  3. Click on Nexus MCP and press Download.
  4. Restart Home Assistant (Settings > System > Restart).
  5. Go to Settings βž” Devices & Services βž” Add Integration βž” Search for Nexus MCP.
  6. Select your preferred AI engine (Gemini, Groq, Qwen, Ollama, etc.) and you are ready to go!

πŸ“‹ Compatibility & Requirements

Nexus MCP is engineered to be ultra-lightweight, with zero external Python package dependencies (requirements: []) and native compatibility across all Home Assistant installation types:

Component / Platform Minimum Version Tested & Verified Status
Home Assistant Core 2024.1.0 2024.1.0 β€” 2026.9.4+ βœ… Fully Supported
Home Assistant OS (HAOS) Any supported Latest Stable βœ… Fully Supported
Home Assistant Supervised Any supported Debian 12+ βœ… Fully Supported
Home Assistant Container (Docker) 2024.1.0 Latest Container βœ… Fully Supported
Home Assistant Core (Python venv) 2024.1.0 Python 3.11 / 3.12+ βœ… Fully Supported
HACS (Community Store) 1.30.0+ v2.0+ βœ… 1-Click Fast Install
Voice Assist Pipeline Core Assist Web, Mobile App & ESPHome Satellites βœ… Fully Supported

[!NOTE] Nexus MCP runs entirely on Home Assistant's native event loop using the shared aiohttp client session. It does not load heavy local libraries into memory, ensuring zero impact on your Home Assistant startup time, memory footprint, or CPU usage.


πŸ“Έ Visual Showcase & Real-World Demo

πŸŽ›οΈ Real-World Dashboard: Hot Helper Creation, 1-Click Automations & Quick Reload

Nexus MCP integrates seamlessly into your production Home Assistant dashboards with an interactive Lovelace card offering real-time conversational controls and instant 1-click execution buttons:

  • ⚑ 1-Click Automation Creation (Create and Activate Automation in Home Assistant): When the assistant generates an automation, clicking the blue button automatically parses, saves, and activates the automation via Home Assistant's native WebSocket API. No manual YAML copying or file editing required.
  • 🧩 Hot Helper Creation (Create Helper in Home Assistant): Need a virtual toggle, numeric slider, timer, counter, or datetime helper (input_boolean, input_number, input_datetime, etc.)? The assistant proposes the exact configuration and the purple button creates it instantly in memory and registry (<domain>/create). Zero restarts required: the helper is immediately ready for use across dashboards and automations, and fully editable from Settings > Devices & Services > Helpers.
  • πŸ”„ Discrete Quick Reload (⚑): Minimalist header button (mdi:lightning-bolt-outline) that instantly reloads all Home Assistant configurations (homeassistant.reload_all) with real-time animated loading state and green checkmark confirmation.

πŸ’¬ Interactive Chat & Automation Creator (with Safety Confirmation)

Ask your smart home in plain natural language (voice or text). Nexus MCP searches entities, designs the automation, explains what it understood, and asks for your confirmation before writing changes:

βš™οΈ Live Automation & Real-Time Traces

The created automation is immediately visible, editable in the Home Assistant visual editor, and running with live execution traces:

πŸŽ™οΈ Home Assistant Assist Pipeline Integration

Select Nexus MCP directly as your active Conversation Agent in any Assist pipeline with local Whisper speech-to-text and Edge TTS:

🧩 1-Click Click & Install Setup Across 5 AI Brains

Seamlessly connect free cloud providers or local models with automatic discovery (Groq, Gemini, and Qwen are 100% verified in production; Ollama Local and Custom OpenAI are implemented under standard specs but marked as experimental pending community testing due to local hardware/resource constraints):

πŸ›‘οΈ Autonomous Mode & Hot-Reconfiguration (Options Flow)

Switch AI models, update API credentials, or toggle Autonomous Mode on the fly without restarting Home Assistant anytime via Settings > Devices & Services > Nexus MCP > Configure (βš™οΈ):

πŸ’¬ Plug & Play Lovelace Card (Visual Card Picker)

Nexus MCP includes a 100% plug & play custom Lovelace card that registers automatically in Home Assistant. No manual resource URLs or configuration needed!

  1. Open any Dashboard, click Edit dashboard βž” Add Card.
  2. Look for Β«Nexus MCP Chat & HistorialΒ» right in the visual card picker list (with live visual preview and configuration editor).
  3. Chat in real-time, view message bubbles, send queries directly from the card input bar, or tap the microphone to open Assist!
type: custom:nexus-mcp-card
title: Nexus MCP Intercom

(Tip: If you prefer standard Markdown cards, you can also use {{ state_attr('sensor.nexus_mcp_openai_gpt_oss_120b_conversation_history', 'formatted_markdown') }})
(Note: When updating via HACS, do a hard refresh with Ctrl + F5 or clear your browser/companion app cache so the new card version loads immediately).

πŸ‘οΈ Multimodal Vision, Image Paste (Ctrl+V) & 1-Click Text Selection

Interact visually with your smart home using vision-capable AI models (e.g. qwen/qwen3.8-27b, Google Gemini Flash, or local vision models):

  • πŸ–ΌοΈ Instant Clipboard Paste (Ctrl + V) & File Attach (πŸ“Ž): Take a screenshot with Win + Shift + S or copy an image anywhere on the web, and paste it directly into the chat. You can also click the paperclip icon (πŸ“Ž) to upload an image from disk. Includes instant thumbnail preview with a removal button (βœ•).
  • 🧠 Real-Time Multimodal Diagnostics: Upload camera snapshots, device photos, or Home Assistant error screenshots directly to the AI for instant automated diagnosis and actionable recommendations.
  • πŸ“‹ 1-Click Message Copy & Native Text Selection: Every message bubble features a 1-click copy icon button (mdi:content-copy) with instant visual checkmark feedback (mdi:check). Full cursor text selection is enabled on all message bubbles for seamless copying of code blocks, YAML configurations, or entity IDs.
  • πŸ“¦ Syntax-Styled Code Blocks & 1-Click Code Copy: Any code or YAML automation returned by the model is automatically parsed into a high-contrast code box with language badge and a dedicated "Copy code" button.
  • πŸ”„ Cross-Browser & Multi-Device History Sync: Powered by a dedicated Home Assistant backend WebSocket (nexus_mcp/get_history), conversations synchronize seamlessly across all your browsers, laptops, and mobile devices without depending on isolated browser storage.
  • ⚑ Guaranteed Auto-Scroll on Reload: Multi-phase auto-scrolling guarantees that upon page reload or image load, the chat is immediately anchored to the latest sent or received message.

πŸš€ Key Features

  • ⚑ Native Home Assistant Voice & Chat (ConversationEntity): Registers seamlessly as an official Home Assistant Assist agent. Talk to your home via web dashboard, mobile app, or ESPHome / Assist voice satellites.
  • 🧩 1-Click Hot Helper Creation (<domain>/create): Instant, zero-restart helper generation directly from chat via native Home Assistant WebSocket collections (input_boolean, input_number, input_select, input_text, input_datetime, counter, timer, input_button). Helpers appear immediately in Home Assistant and are fully manageable from Settings > Devices & Services > Helpers.
  • ⚑ 1-Click Automation Save & Activation: Parses YAML automation blocks and creates them directly in Home Assistant with a single click, immediately editable in the Visual Automation Editor with live execution traces.
  • πŸ”„ Discrete Quick Reload: Instant core configuration reload (homeassistant.reload_all) accessible directly from the Lovelace card header with animated spinner and green confirmation check.
  • πŸ› οΈ Native Tool Calling & Smart Assistance: Equipped with built-in Home Assistant tools adhering to Assist exposed entity permissions:
    • ha_search_entities: Semantic discovery of exposed entities and device IDs.
    • ha_get_entity_state: State and attribute inspection for exposed entities.
    • ha_call_service: Real-time execution of Home Assistant services (light.turn_on, switch.toggle, climate.set_temperature, etc.) running with caller user context and permission enforcement.
    • YAML Automation Generation: When requested to create or propose automations, Nexus MCP outputs clean, validated YAML configurations in Markdown code blocks ready to paste directly into Home Assistant's UI Automation Editor.
    • πŸ”„ Persistent Memory, Continuity & 10 Dedicated Telemetry Sensors: Conversations are stored on disk via Home Assistant's native storage (.storage), ensuring chat history survives restarts and integration reloads. When starting a new session or reopening Assist, Nexus MCP automatically inherits the recent context from your previous conversation so you can seamlessly continue where you left off. Nexus MCP also exposes 10 dedicated sensors (Tokens Used, Requests Remaining, Quota %, TPM/RPM Limits, Window Wait, Rate Limit Cooldown, Conversation History) with ready-to-use formatted Markdown for your Dashboards, plus the nexus_mcp.clear_history action. Saying "Nueva conversaciΓ³n", "Reset", or "Clear history" instantly resets memory on demand.
  • 🌐 100% Free & Fast Cloud Providers:
    • Groq Cloud (Recommended in Europe & Worldwide):
      • 1-click Google/GitHub login, zero credit card, zero phone verification required.
      • Up to 14,400 free requests per day at ultra-high inference speeds (~0.08s latency).
      • Supported models: openai/gpt-oss-120b (default - 120B reasoning model!), qwen/qwen3.8-27b (ultra-fast ~0.08s latency), and openai/gpt-oss-20b.
      • Direct in-app link to official catalog: Groq Model Catalog.
    • Google Gemini (Free Tier):
      • Free API key from Google AI Studio (no billing required).
      • gemini-3.1-flash-lite: 250,000 Tokens/Min (TPM) and 500 requests/day for conversational velocity with zero rate limits.
      • gemini-flash-latest: Always points to the newest Flash release.
    • Qwen Cloud (Alibaba Model Studio / DashScope):
      • Access to flagship Qwen models (qwen-plus-latest, qwen-turbo-latest, qwen2.5-coder-32b-instruct) with millions of free tokens.
    • Ollama Local (Experimental / Untested):
      • 100% offline, private, and free inference on your local network (qwen2.5-coder:7b).
      • ⚠️ Note: Implemented following standard Ollama OpenAI-compatible schemas, but currently pending extensive real-world testing due to lack of local hardware/GPU resources. Community feedback and PRs are warmly welcome!
    • Custom OpenAI / BYOK (Experimental / Untested):
      • Connect to OpenRouter (including :free models), OpenAI Platform, DeepSeek, or any OpenAI-compatible API.
      • ⚠️ Note: Implemented via standard OpenAI chat completion endpoints, but pending full testing due to lack of funded accounts/resources. Community testing is appreciated!
  • πŸ›‘οΈ Resilient & Self-Healing Architecture:
    • Automatic Exponential Backoff: Gracefully retries HTTP 429 (rate limits) and HTTP 503 (server load) honoring Retry-After headers.
    • In-Flight Model Fallback: Automatically switches to capable backup models (openai/gpt-oss-120b) if a specific model trips rate limits.
    • Model Name Auto-Normalization: Automatically fixes common user inputs (e.g. qwen3.8-27b is auto-prefixed to qwen/qwen3.8-27b).
    • Model Clarity in Hub & Entity Titles: Config entries and entities clearly display the active model name in parentheses (e.g., Nexus MCP (qwen/qwen3.8-27b)).
  • βš™οΈ Full In-App Options Flow:
    • Update API keys, switch models, adjust endpoints, or toggle autonomous mode anytime via Settings > Devices & Services > Nexus MCP > Configure (βš™οΈ) without reinstalling.
    • All configuration screens feature clickable direct links to API key dashboards and model documentation.
  • πŸ”Œ Assist Tool Calling & Security:
    • Native tool calling adhering strictly to Home Assistant's async_should_expose policies and user context security.
  • πŸͺΆ Zero CPU & RAM Overhead:
    • Built entirely on non-blocking aiohttp calls on Home Assistant's event loop. No background threads, no memory leaks.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      OUTSIDE OF HOME ASSISTANT                         β”‚
β”‚  (Groq Cloud / Google AI Studio / Alibaba Cloud / Ollama Local)        β”‚
β”‚                                                                        β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚   β”‚ INFERENCE ENGINE / LLM PROVIDERS                             β”‚     β”‚
β”‚   β”‚                                                              β”‚     β”‚
β”‚   β”‚  β€’ Groq Cloud (14,400 req/day, Qwen 3.8 27B / GPT-OSS 120B)  β”‚     β”‚
β”‚   β”‚  β€’ Google Gemini Free Tier (250k TPM, Gemini 3.1 Flash Lite) β”‚     β”‚
β”‚   β”‚  β€’ Alibaba Model Studio (Qwen Plus / Coder)                  β”‚     β”‚
β”‚   β”‚  β€’ Ollama + Qwen 2.5 Coder (Local Offline 100% Free)         β”‚     β”‚
β”‚   β”‚  β€’ OpenAI Server / OpenRouter / DeepSeek BYOK                β”‚     β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β”‚ (Asynchronous REST / HTTP Calls with Native Tool Calling)
                                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    INSIDE HOME ASSISTANT (HACS)                        β”‚
β”‚                                                                        β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚   β”‚ NEXUS MCP INTERCOM (Custom Component)                        β”‚     β”‚
β”‚   β”‚                                                              β”‚     β”‚
β”‚   β”‚  β€’ Official Conversation Entity (Assist / Voice / Web).      β”‚     β”‚
β”‚   β”‚  β€’ Built-in Tools: Entity Search, States, Services.          β”‚     β”‚
β”‚   β”‚  β€’ Security: respects Assist exposed entities & user context.β”‚     β”‚
β”‚   β”‚  β€’ Exponential Backoff & Auto-Retries on HTTP 429/503.       β”‚     β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š Free Tier Models Comparison

Provider Model Identifier Tokens/Min (TPM) Requests/Day (RPD) Availability (EU / Global) Best Used For
Google Gemini gemini-3.1-flash-lite (Recommended) 250,000 TPM 500 RPD Global / Europe Best daily driver: Zero minute-rate-limit friction in fast voice/chat conversations.
Groq Cloud openai/gpt-oss-120b (Default Groq) 8,000 TPM 14,400 RPD Global / Europe Maximum AI intelligence: 120B open reasoning model for complex automations.
Groq Cloud qwen/qwen3.8-27b 7,000 TPM 14,400 RPD Global / Europe Ultra-fast inference: ~0.08s latency, excellent tool calling and multilingual support.
Groq Cloud openai/gpt-oss-20b 8,000 TPM 14,400 RPD Global / Europe Fast and lightweight 20B model for simple queries.
Alibaba Cloud qwen-plus-latest Generous Generous Global / Europe Qwen flagship intelligence via DashScope.
Ollama Local qwen2.5-coder:7b Unlimited Unlimited Local Network 100% private, offline home control.

Note on Meta Llama models: Groq Cloud restricts Meta models (llama-3.3-70b) in European Union regions due to EU licensing. Nexus MCP automatically falls back to qwen/qwen3.8-27b or openai/gpt-oss-120b to prevent HTTP 404 errors.


πŸ“ˆ 10 Dedicated Telemetry & Quota Sensors

Nexus MCP automatically registers independent first-class Home Assistant sensors for complete visibility into your AI limits and usage:

Sensor Entity ID Entity Name Unit Hover Tooltip Description
sensor.<id>_daily_tokens Daily Tokens Used tokens Total prompt and completion tokens used today across all requests.
sensor.<id>_daily_requests_used Daily Requests Used requests Total number of queries submitted to the AI model today.
sensor.<id>_daily_quota_remaining Daily Requests Remaining requests Remaining requests available today before hitting the daily quota.
sensor.<id>_daily_quota_percent Daily Quota Remaining % Percentage of daily provider requests quota remaining until midnight UTC reset.
sensor.<id>_daily_requests_limit Daily Requests Limit requests Maximum allowable queries per day (RPD) in the provider's free tier.
sensor.<id>_model_limit Tokens Per Minute Limit tokens/min Maximum input tokens per minute (ITPM/TPM) allowed by the provider.
sensor.<id>_rpm_limit Requests Per Minute Limit req/min Maximum queries allowed within any 60-second window.
sensor.<id>_max_wait_time Max Window Wait Time s Sliding window duration in seconds required for per-minute tokens to replenish.
sensor.<id>_rate_limit_reset Rate Limit Cooldown s Live real-time cooldown seconds remaining if throttled by the provider.
sensor.<id>_conversation_history Conversation History - Most recent conversation message and activity preview with formatted markdown.

When setting up or reconfiguring Nexus MCP, clickable links are provided right inside the dialog:


πŸ§ͺ Testing & Quality Assurance

Nexus MCP maintains a rigorous test suite covering config flows, options flows, entity discovery, builtin tools, schema sanitization, and LLM engines:

python -m unittest discover -s tests

Result: 73/73 unit tests passing (100% success rate).


β˜• Support & Donations

If you appreciate this free, open-source integration and want to support its ongoing development, feel free to buy me a coffee:

Buy Me A Coffee PayPal Ko-fi


πŸ“„ License

This project is licensed under the MIT License - 100% open-source and free for the community. See LICENSE for details.