MCP Gateway
Integrates with Home Assistant to provide per-device MCP server endpoints, enabling AI agents to discover and interact with Home Assistant devices and their tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Gatewaylist the MCP devices in my home"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Gateway
A Home Assistant custom integration that provides standalone MCP (Model Context Protocol) server endpoints for each device.
Features
Per-device MCP servers — Each registered device gets its own HTTP server on a unique port (20000-30000) serving MCP protocol endpoints
Auto-discovery — Devices are advertised via mDNS (
_mcp._tcp.local.) for automatic discoveryPlatform integration — Other integrations can automatically register device MCP tools by providing an
mcp.pymoduleManual registration API — Register device tools programmatically via
async_register_device_tools()Admin panel — Sidebar panel to view and manage registered MCP devices
Streamable HTTP and SSE transport support
Related MCP server: MCP Server for Home Assistant (HTTP Transport)
Installation
HACS (Recommended)
Make sure HACS is installed
Click the menu in the top right corner of HACS and select Custom repositories
Enter
https://github.com/solnera/ha-mcp-gatewayas the repository URL and select Integration as the categoryClick Download
Restart Home Assistant
Manual
Copy the
custom_components/mcp_gatewaydirectory to your Home Assistantconfig/custom_components/directoryRestart Home Assistant
Configuration
Go to Settings > Devices & Services
Click + Add Integration
Search for MCP Gateway and follow the prompts
After setup, an MCP Gateway panel will appear in the sidebar.
Providing MCP Tools from Your Integration
Every tool must declare both schemas:
parameters— the input schema, published as the MCP tool'sinputSchemaresponse_schema— the response schema, published as the MCP tool'soutputSchema
Both are voluptuous schemas. Each tool result is returned as structured
content and validated against the response schema, so the schema has to
describe what async_call() actually returns. A tool without a response
schema is not exposed — it is dropped with an error in the log.
import voluptuous as vol
from homeassistant.helpers import llm
class MyTool(llm.Tool):
"""Set the target temperature."""
name = "set_temperature"
description = "Set the target temperature in degrees Celsius"
parameters = vol.Schema({vol.Required("value"): vol.All(vol.Coerce(float), vol.Range(min=5, max=35))})
response_schema = vol.Schema({vol.Required("success"): bool})
async def async_call(self, hass, tool_input, llm_context):
"""Return an object matching response_schema."""
return {"success": True}Option 1: Platform Auto-discovery
Create an mcp.py file in your integration:
from homeassistant.core import HomeAssistant
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers import device_registry as dr, llm
async def async_get_device_tools(
hass: HomeAssistant,
config_entry: ConfigEntry,
device_entry: dr.DeviceEntry,
) -> tuple[list[llm.Tool], str] | None:
"""Return MCP tools and prompt for a device."""
tools = [MyTool()]
prompt = "Control tools for this device."
return tools, promptOption 2: Manual Registration
from custom_components.mcp_gateway.api import async_register_device_tools
async def async_setup_entry(hass, entry):
device = dr.async_get(hass).async_get_or_create(...)
unsub = await async_register_device_tools(
hass,
device_id=device.id,
tools=[MyTool()],
prompt="Device control tools.",
)
entry.async_on_unload(unsub)License
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
- ZapierOAuthcom.zapier
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server and Home Assistant add-on that enables AI assistants to manage smart homes by creating automations, designing dashboards, and interacting with entities. It features native access to Home Assistant APIs, built-in Git versioning for safe rollbacks, and full management of HACS integrations.632MIT
- AlicenseNot gradedqualityAmaintenanceA Home Assistant Custom Component that provides an MCP server using HTTP transport, allowing AI assistants like Claude to interact with your Home Assistant instance.70MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to control Home Assistant via natural language, including device control, automation management, and system configuration.MIT
- AlicenseAqualityBmaintenanceAn MCP server that layers additional Home Assistant tools on top of voska/hass-mcp, enabling Lovelace dashboard management, automation/scene manipulation, SSH file access, and recorder database queries.28MIT