MCP Gateway
A Home Assistant custom integration that provides standalone MCP server endpoints for each device, enabling per-device tools and auto-discovery via mDNS.
README
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 discovery - Platform integration — Other integrations can automatically register device MCP tools by providing an
mcp.pymodule - Manual 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
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 category - Click Download
- Restart Home Assistant
Manual
- Copy the
custom_components/mcp_gatewaydirectory to your Home Assistantconfig/custom_components/directory - Restart 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
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, prompt
Option 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.