Logo van MCP Assist

MCP Assist

Community
mike-nott

MCP-powered Home Assistant conversation agent that solves entity context limitations through dynamic discovery instead of full entity dumps

Uitgevermike-nott
Repositorymcp-assist
TaalPython
Forks
23
Sterren
109
Beschikbare tools
0
Transporttypestdio
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    MCP Assist biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    109 sterren en 23 forks in de gekoppelde repository.

MCP Assist for Home Assistant

A Home Assistant conversation agent that uses MCP (Model Context Protocol) for efficient entity discovery, achieving 95% token reduction compared to traditional methods. Works with LM Studio, llama.cpp, Ollama, OpenAI, Google Gemini, Anthropic Claude, and OpenRouter.

Key Features

  • ✅ 95% Token Reduction: Uses MCP tools for dynamic entity discovery instead of sending all entities
  • ✅ No Entity Dumps: Never sends 12,000+ token entity lists to the LLM
  • ✅ Smart Entity Index: Pre-generated system structure index (~400-800 tokens) for context-aware queries
  • ✅ Multi-Platform Support: Works with LM Studio, llama.cpp, Ollama, OpenAI, Google Gemini, Anthropic Claude, and OpenRouter
  • ✅ Multilingual Support: 21 languages with localized UI, system prompts, and speech detection
  • ✅ Multi-turn Conversations: Maintains conversation context and history
  • ✅ Dynamic Discovery: Finds entities by area, type, device_class, state, or name on-demand
  • ✅ Web Search Tools: Optional DuckDuckGo or Brave Search integration for current information
  • ✅ Works with 1000+ Entities: Efficient even with large Home Assistant installations
  • ✅ Multi-Profile Support: Run multiple conversation agents with different models

The Problem MCP Assist Solves

Traditional voice assistants send your entire entity list (lights, switches, sensors, etc.) to the LLM with every request. For a typical home with 200+ devices, this means:

  • 12,000+ tokens sent every time
  • Expensive API costs (cloud LLMs)
  • Slow response times
  • Context window limitations
  • Poor performance with large homes

How MCP Assist Works

Instead of dumping all entities, MCP Assist:

  1. Starts an MCP Server on Home Assistant that exposes entity discovery tools
  2. Your LLM connects to the MCP server and gets access to these tools:
    • get_index - Get system structure index (areas, domains, device_classes, people, etc.)
    • discover_entities - Find entities by type, area, domain, device_class, or state
    • get_entity_details - Get current state and attributes
    • perform_action - Control devices
    • run_script - Execute scripts and return response data
    • run_automation - Trigger automations manually
    • list_areas - List all areas in your home
    • list_domains - List all entity types
    • set_conversation_state - Smart follow-up handling
  3. LLM uses the index for smart queries - Understands what exists without full context dump
  4. LLM discovers on-demand - Only fetches the entities it needs for each request
  5. Token usage drops from 12,000+ to ~400 tokens per request

Token Usage Comparison

MethodToken UsageDescription
Traditional12,000+ tokensSends all entity states
MCP Assist~400 tokensUses MCP tools for discovery
Reduction95%Massive efficiency gain

Smart Entity Index (v0.5.0+)

The Smart Entity Index provides a lightweight (~400-800 tokens) snapshot of your Home Assistant system structure, enabling context-aware queries without full entity dumps. The index includes areas, domains, device classes, people, calendars, zones, automations, and scripts. For entities without standardized device_class attributes (like custom integrations), LLM-powered gap-filling automatically infers semantic categories from naming patterns. This results in faster, more accurate queries that use ~95% fewer tokens compared to traditional entity dumps.

Multilingual Support (v0.12.0+)

MCP Assist supports 21 languages with localized configuration interfaces, language-aware system prompts, and region-specific speech detection patterns. The integration automatically detects your Home Assistant system language and provides appropriate defaults for system prompts, follow-up phrases, and end conversation words. Supported languages include: Arabic, Chinese (Simplified), Czech, Danish, Dutch, Finnish, Filipino, French, German, Greek, Hindi, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, and Turkish.

Requirements

  • Home Assistant 2024.1+
  • One of:
    • Local LLMs: LM Studio v0.3.17+, llama.cpp, or Ollama
    • Cloud LLMs: OpenAI, Google Gemini, Anthropic Claude, or OpenRouter (API key required)
  • Python 3.11+

Installation

Add to HACS

Open your Home Assistant instance and add this repository to HACS.

Option A: HACS (Recommended)

  1. Click the badge above to add this repository to HACS, or manually add it as a custom repository
  2. Install "MCP Assist" from HACS
  3. Restart Home Assistant

Option B: Manual Installation

  1. Copy the custom_components/mcp_assist folder to your Home Assistant custom_components directory
  2. Restart Home Assistant

Configuration

1. Add the Integration

  1. Go to Settings → Devices & Services → Add Integration
  2. Search for "MCP Assist" and select it

2. Setup Flow

Step 1 - Profile & Server Type:

  • Profile Name: Give your assistant a name (e.g., "Living Room Assistant")
  • Server Type: Choose your LLM provider
    • LM Studio - Local, free, runs on your machine
    • llama.cpp - Local, free, official llama.cpp server
    • Ollama - Local, free, command-line based
    • OpenAI - Cloud, paid, GPT-5.2 series
    • Google Gemini - Cloud, paid/free tier, Gemini 3.0 series
    • OpenRouter - Cloud, multi-model gateway with access to 200+ models

Step 2 - Server Configuration:

For Local Servers (LM Studio / llama.cpp / Ollama):

  • Server URL: Where your LLM server is running
    • LM Studio: http://localhost:1234 (default)
    • llama.cpp: http://localhost:8080 (default)
    • Ollama: http://localhost:11434 (default)
  • MCP Server Port: Port for the MCP server (default: 8090)

For Cloud Providers (OpenAI / Gemini / Anthropic / OpenRouter):

  • API Key: Your provider API key (see below for setup)
  • MCP Server Port: Port for the MCP server (default: 8090)

Step 3 - Model & Prompts:

  • Model Name: Select from auto-loaded models or enter manually
  • System Prompt: Customize the assistant's personality
  • Technical Instructions: Advanced prompt for tool usage (pre-configured)

Step 4 - Advanced Settings:

  • Temperature: Response randomness (0.0-1.0)
  • Max Response Tokens: Maximum length of responses
  • Response Mode: None / Smart / Always (conversation continuation behavior)
  • Follow-up Phrases: Configurable phrases for pattern detection (default: "anything else, would you, can i", etc.)
  • End Conversation Words: Words/phrases that end conversations (default: "bye, thanks, stop", etc.)
  • Control Home Assistant: Enable/disable device control
  • Max Tool Iterations: How many tool calls allowed per request
  • Web Search Provider: Choose none, DuckDuckGo, or Brave Search
  • Brave Search API Key: Your API key (if using Brave Search)
  • Debug Mode: Extra logging for troubleshooting
  • Ollama Keep Alive (Ollama only): Control how long models stay loaded in memory
    • -1 = Keep loaded indefinitely
    • 0 = Unload immediately after response
    • "5m" = Keep for 5 minutes (default)
    • Duration strings like "24h", "168h" also supported
  • Ollama Context Window (Ollama only): Custom context window size (0 = use model default)

3. Set as Voice Assistant

  1. In Home Assistant, go to Settings → Voice Assistants
  2. Set your preferred assistant to your MCP Assist profile name
  3. Test with commands!

Usage Examples

Basic Commands

  • "Turn on the kitchen lights"
  • "Turn off all the lights in the bedroom"
  • "What's the temperature in the living room?"

Multi-Turn Conversations

  • User: "What lights are on?"
  • Assistant: "The kitchen and living room lights are on."
  • User: "Turn off the kitchen one"
  • Assistant: "I've turned off the kitchen light."

Complex Query Example

User: "Do we have a leak?"

Behind the scenes:

1. LLM calls get_index → Sees moisture sensors and water flow monitors exist in system
2. LLM calls discover_entities(device_class="moisture")
   → Returns: binary_sensor.bathroom_leak, binary_sensor.kitchen_sink_leak, binary_sensor.laundry_leak
3. LLM calls discover_entities(name_contains="water flow")
   → Returns: sensor.water_flow_rate
4. LLM calls get_entity_details for each sensor
   → bathroom leak: "off", kitchen leak: "off", laundry leak: "on", water flow: "2.5 gpm"
5. LLM synthesizes response

Assistant: "Yes, the laundry room leak sensor is detecting water and water is flowing at 2.5 gallons per minute. The bathroom and kitchen sensors are dry."

Follow-up User: "Turn off the water main"

Behind the scenes:

1. LLM calls discover_entities(name_contains="water main")
   → Returns: switch.water_main_shutoff
2. LLM calls perform_action(entity_id="switch.water_main_shutoff", action="turn_off")
   → Success

Assistant: "I've shut off the main water valve."

Web Search (if enabled)

  • "What's the weather forecast for tomorrow?"
  • "Search for the latest Home Assistant updates"
  • "What time does the store close?"

Configuration Options

Profile Settings

  • Profile Name: Unique name for this assistant
  • Server Type: LM Studio, Ollama (more coming)
  • Server URL: Where your LLM is running
  • Model Name: Which model to use

Prompts

  • System Prompt: Sets the assistant's personality and behavior
  • Technical Instructions: Low-level instructions for tool usage (usually leave as default)

Advanced Settings

  • Max Response Tokens: Limit response length (default: 500)
  • Max History Messages: How many conversation turns to remember (default: 10)
  • Max Tool Iterations: Prevent infinite loops (default: 10)
  • Response Mode:
    • None: Never ask follow-ups, end immediately
    • Smart (default): Contextual follow-ups when relevant, user can end with "bye"/"thanks"
    • Always: Natural conversational follow-ups, user can end with "bye"/"thanks"
  • Follow-up Phrases: Comma-separated phrases for detecting when assistant wants to continue (configurable per profile)
  • End Conversation Words: Comma-separated words/phrases for user-initiated ending (configurable per profile)
  • Enable Smart Entity Index: Context-aware entity discovery with automatic gap-filling for uncommon devices (default: enabled)

Temperature Settings

Temperature controls response randomness (0.0 = deterministic, 1.0 = creative). Different providers have different optimal values:

ProviderDefaultReason
Gemini1.0Google requires 1.0 for Gemini 3 to avoid "looping or degraded performance"
OpenAI (GPT-4)0.5Balanced for reliable tool calling
OpenAI (GPT-5/o1)N/AReasoning models don't use temperature
Anthropic Claude0.5Works well across 0.5-1.0 range
LM Studio / llama.cpp0.5Lower temps improve tool calling accuracy
Ollama0.5Model-dependent, lower is safer for tools
OpenRouter0.5Depends on underlying model

Note: You can always override these defaults in Advanced Settings. For Home Assistant voice control, lower temperatures (0.5-0.7) generally provide more consistent tool calling and accurate entity control.

MCP Server Settings

  • MCP Server Port: Default 8090 (change if port conflict)
  • Additional Allowed IPs/Ranges: Whitelist Docker containers (e.g., 172.30.0.0/16) or specific IPs for external MCP clients like Claude Code add-on

Web Search

  • Web Search Provider: Choose between:
  • Brave Search API Key: Required only if using Brave Search

Shared vs Per-Profile Settings

MCP Assist has two types of settings:

Per-Profile Settings (independent per conversation agent):

  • Model name, system prompt, technical instructions
  • Temperature, max tokens, response mode
  • Debug mode, max iterations
  • Server URL (for local LLMs)

Shared Settings (affect ALL profiles):

  • MCP server port
  • Web search provider (none/duckduckgo/brave)
  • Brave API key
  • Allowed IPs/CIDR ranges
  • Smart entity index (gap-filling)

When you change shared settings in one profile's options, they apply to all profiles. This is intentional since all profiles share the same MCP server.

Model Compatibility Guide

Not all LLM models support tool calling (function calling) equally well. This integration works best with frontier models (GPT-5.2, Claude Opus 4.5, Gemini 3 Flash) or higher-spec local models. Smaller models may struggle with complex multi-entity queries that require synthesizing large tool result sets.

Understanding Tool Calling Requirements

Tool calling (function calling) requires the model to:

  1. Understand the user's request
  2. Decide which tool to call
  3. Format the tool arguments correctly as JSON
  4. Interpret the tool results
  5. Generate a natural response

Factors affecting tool calling success:

  • Model size: Larger models (8B+) generally handle tool calling better
  • Model architecture: Vision-Language (VL) models behave differently than standard models
  • Inference engine: LM Studio and Ollama optimize models differently
  • Quantization level: Q4 vs Q8 can affect instruction following

Instruct vs Thinking/Reasoning Models

Instruct Models (e.g., qwen3-8b-instruct):

  • Fast response times
  • Best for simple, single-action requests ("turn on the kitchen lights")
  • May struggle with complex queries requiring multiple tool calls
  • Good for basic voice commands

Thinking/Reasoning Models (e.g., qwen3-8b-thinking):

  • Slower response times (more deliberate reasoning)
  • Much better at complex requests requiring multiple tool calls and context
  • Handles multi-step queries reliably ("check all rooms for open windows, then turn off lights in those rooms")
  • Recommended for Home Assistant where queries often involve discovery + action combinations

Choose the model type that best fits your use case. Thinking/reasoning models offer better reliability with complex multi-tool queries, while instruct models provide faster responses for simple commands.

Recommended Models

Consistently Reliable:

  • ✅ Qwen3 VL 32B Instruct - Excellent tool calling
  • ✅ Qwen3 30B A3B Instruct - Very good tool calling
  • ✅ Qwen3 8B Instruct - Good balance, works reliably
  • ✅ Anthropic Opus 4.5 - The very best at tool calling (cloud)
  • ✅ OpenAI GPT-5.2 - Excellent tool calling, very fast (cloud)
  • ✅ Google Gemini 3 Flash - Excellent tool calling, fast, cost-effective (cloud)

Testing Your Model

When tool calling doesn't work, you'll see:

  • Model claims "I turned on the lights" but nothing happens
  • No perform_action tool calls in the logs
  • Actions don't execute, only narration

When tool calling works correctly, you'll see in logs:

  • discover_entities called to find devices
  • perform_action called to control them
  • "✅ Successfully executed" messages
  • Devices actually change state
  • Tool calls visible in Settings → Voice Assistants → (profile) → Debug

General Guidelines

Start with larger models (30B) if your hardware supports it - they work consistently across platforms.

If using smaller models (4B-8B), test thoroughly:

  • Try a simple command like "turn on the kitchen lights"
  • Check logs to verify tools are being called
  • Confirm the device actually changes state
  • If it doesn't work, try the same model on a different platform (LM Studio vs Ollama)

Vision-Language (VL) models are optimized for multimodal tasks and may have different tool calling behavior than standard models.

Dynamic Model Switching

One of MCP Assist's features is dynamic model switching - you can change models in the configuration UI and it takes effect immediately without restarting Home Assistant. This makes it easy to:

  • Test different models
  • Switch between fast (Q4) and quality (Q8) quantizations
  • Try new models as they're released

Troubleshooting

Integration Won't Start

  • Check that the MCP port isn't already in use
  • Verify Home Assistant has permission to bind to the port
  • Check the Home Assistant logs for specific error messages

LM Studio Can't Connect to MCP

  • Ensure the MCP server is running (check integration status)
  • Verify the MCP configuration in LM Studio is correct
  • Check that the URL in LM Studio matches your MCP port (default: 8090)
  • Restart LM Studio after changing MCP configuration

Ollama Connection Issues

  • Verify Ollama is running: ollama list
  • Check the URL matches where Ollama is running (default: http://localhost:11434)
  • Ensure the model is loaded in Ollama

Cloud Provider Connection Issues

  • Verify your API key is valid with your provider
  • Check you have sufficient credits/quota remaining
  • Check for rate limit errors in Home Assistant logs
  • Try regenerating your API key if authentication fails
  • Verify your internet connection is working
  • Check Home Assistant logs for specific error codes

No Response from Assistant

  • Verify your LLM has a model loaded
  • Check that the model name in the integration matches exactly
  • Ensure your entities are exposed to the conversation assistant
  • Check Home Assistant logs for API errors
  • Enable Debug Mode for more detailed logging

Poor Response Quality

  • Try a different/larger model
  • Adjust the temperature setting (lower = more focused)
  • Ensure the model supports tool calling/function calling
  • Check that Technical Instructions are not modified

Tools Not Working

  • Verify "Control Home Assistant" is enabled
  • Check that entities are exposed (Settings → Voice Assistants → Expose)
  • Look for MCP server errors in logs
  • Ensure Max Tool Iterations isn't set too low

Entity Exposure

The integration only discovers entities that are exposed to the "conversation" assistant. To expose entities:

  1. Go to Settings → Voice Assistants → Expose
  2. Select entities you want the assistant to control
  3. The integration will automatically discover these when needed

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Gebruik MCP Assist MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra MCP Assist is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg MCP Assist toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van MCP Assist.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "mcp-assist": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van MCP Assist in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van MCP Assist in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je MCP Assist gebruiken om me hiermee te helpen?
MCP Assist
Zeker. Ik heb het gelezen.
Dit vond ik met MCP Assist.

Veelgestelde vragen

Waarvoor wordt de MCP-server MCP Assist gebruikt?

MCP Assist is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik MCP Assist MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je MCP Assist gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom MCP Assist MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als MCP Assist verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik MCP Assist MCP met TypingMind?

MCP Assist werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt MCP Assist MCP in TypingMind?

MCP Assist biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om MCP Assist MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als MCP Assist authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇