Skip to main content
Glama
HA MCP Bridge

HA MCP Bridge

by shaike1

🏠 HA MCP Bridge

Multi-tenant Home Assistant MCP Bridge - Connect your Home Assistant smart home to Claude and ChatGPT via the Model Context Protocol (MCP).

Docker Build Node.js CI License: MIT

✨ Features

  • πŸ”Œ Multi-tenant Support - Multiple users can connect their own Home Assistant

  • πŸ›‘οΈ Secure Authentication - Individual API keys for each user

  • πŸŽ›οΈ User Dashboard - Web interface for account management

  • πŸš€ Easy Deployment - Docker support with Traefik integration

  • πŸ“Š Usage Analytics - Track requests and monitor usage

  • πŸ”„ Real-time Updates - Live configuration changes

  • 🌐 Production Ready - SSL, rate limiting, monitoring

Related MCP server: Home Assistant MCP Server

πŸš€ Quick Start

1. Clone and Install

git clone https://github.com/shaike1/ha-mcp-bridge.git
cd ha-mcp-bridge
npm install

2. Setup Configuration

npm run setup

3. Start the Server

npm start

4. Access Dashboard

Visit http://localhost:3001/dashboard to register and manage your account.

πŸ“‹ Prerequisites

  • Node.js 16.0.0 or higher

  • Home Assistant with Long-Lived Access Token

  • Claude Desktop or ChatGPT Desktop

πŸ”§ User Registration

Via Dashboard

  1. Visit /dashboard

  2. Click "Register"

  3. Enter email, HA URL, and token

  4. Get your API key

  5. Copy Claude Desktop configuration

Via API

curl -X POST http://localhost:3001/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "haUrl": "http://homeassistant.local:8123",
    "haToken": "your_token_here"
  }'

🐳 Docker Deployment

Simple Docker

docker-compose up -d

Production with Traefik

# Create network
docker network create traefik-network

# Update domain in docker-compose.traefik.yml
# Deploy
docker-compose -f docker-compose.traefik.yml up -d

πŸŽ›οΈ User Dashboard Features

  • Account Management - View and update settings

  • API Key Management - Regenerate keys securely

  • HA Configuration - Update Home Assistant settings

  • Connection Testing - Verify HA connectivity

  • Usage Statistics - Monitor API usage

  • Claude & ChatGPT Integration - Ready-to-use configurations

πŸ€– ChatGPT Desktop Integration

ChatGPT Desktop supports MCP remote servers. Use either the dashboard snippet or the example config below.

Steps:

  1. Start the server and register via /dashboard to get your API key.

  2. In ChatGPT Desktop, open Settings β†’ Integrations β†’ Model Context Protocol.

  3. Click Add server and paste this JSON (replace the URL if needed):

{
  "mcpServers": {
    "homeassistant": {
      "type": "remote",
      "url": "https://your-server-url.com",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}

You can also find a ready-made example at examples/chatgpt-desktop-config.json and a copyable config in the dashboard after login.

πŸ›‘οΈ Security Features

  • Individual API keys per user

  • Encrypted data storage

  • Rate limiting and CORS protection

  • Admin interface for management

  • Audit logging for all requests

πŸ‘¨β€πŸ’Ό Admin Features

# View all users
curl -H "Authorization: Bearer $ADMIN_API_KEY" \
     http://localhost:3001/admin/users

# Delete user
curl -X DELETE \
     -H "Authorization: Bearer $ADMIN_API_KEY" \
     http://localhost:3001/admin/users/USER_API_KEY

πŸ”§ Available Tools

  • Core

    • get_entities β€” Get all entities or filter by domain

    • call_service β€” Call any HA service (domain/service)

  • Lights & Switches

    • get_lights β€” List all light entities

    • get_switches β€” List all switch entities

  • Automations & Scripts

    • get_automations β€” List automations

    • get_scripts β€” List scripts

    • run_script β€” Run a script (entity_id)

  • Scenes

    • get_scenes β€” List scenes

    • activate_scene β€” Activate a scene (entity_id)

  • Climate

    • get_climate β€” List climate entities

    • set_climate β€” Set temperature/hvac/preset/fan (entity_id, temperature, hvac_mode, preset_mode, fan_mode)

  • Media Player

    • get_media_players β€” List media players

    • media_play, media_pause, media_next, media_previous β€” Control playback (entity_id)

    • set_volume β€” Set volume (entity_id, volume_level 0.0–1.0)

  • Covers

    • get_covers β€” List covers (blinds, shades, garage doors)

    • open_cover, close_cover, stop_cover β€” Control movement (entity_id)

    • set_cover_position β€” Set position 0–100 (entity_id, position)

πŸ“Š Monitoring

  • Health endpoint: /health

  • User dashboard: /dashboard

  • Admin interface: /admin/users

  • Docker health checks included

🀝 Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

πŸ“ License

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

πŸ†˜ Support

⭐ Acknowledgments


Made with ❀️ for the smart home community

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.
      29
      353
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to control Home Assistant devices and services through the Model Context Protocol.
      91 PyPI
      106
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects AI assistants to Home Assistant, enabling them to discover and control smart home entities, services, areas, devices, and cameras via the Model Context Protocol.
      4
      BSD 3-Clause