Home Automation MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Home Automation MCP Server
A comprehensive smart home automation system that allows AI assistants to control and monitor smart home devices through natural language using the Model Context Protocol (MCP).
ποΈ Architecture
AI Assistant (Claude Desktop/VS Code)
β stdio MCP Protocol
FastMCP Server
β
SQLite Database β [Real-time Polling] β FastAPI Server
β WebSocket
React FrontendKey Components:
FastMCP Server - Handles AI interactions via stdio protocol
FastAPI Server - REST API + WebSocket for real-time frontend updates
SQLite Database - Shared state between both servers with timestamp-based change detection
React Frontend - Real-time dashboard with WebSocket updates
Related MCP server: Home Assistant MCP
β¨ Features
MCP Tools (9 Tools)
control_device - Universal device control (on/off/set/toggle)
get_device_status - Query device states
get_sensor_reading - Read temperature, motion sensors
set_home_mode - Execute scenes (home/away/sleep/vacation)
get_home_mode - Check current mode
feed_fish - Trigger fish feeder
water_plants - Control sprinkler system
start_ev_charging / stop_ev_charging - EV charger control
Supported Devices (24+ Sample Devices)
π‘ Lights (with brightness control)
π‘οΈ Thermostat (temperature + mode control)
π Locks
πͺ Blinds (with position control)
π¨ Fans (with speed control)
π Garage door
π Fish feeder
π§ Sprinkler system
π EV charger
π‘οΈ Temperature sensors
ποΈ Motion sensors
Home Modes
Home - Welcome mode (lights on, 72Β°F)
Away - Security mode (lights off, locks engaged, 65Β°F)
Sleep - Night mode (bedroom dim 20%, doors locked, 68Β°F)
Vacation - Extended away (everything secured, 60Β°F)
π Quick Start
1. Install Dependencies
pip install -r requirements.txt
cd frontend
npm install # First time only2. Start the System
Option A: Using the Menu (Easiest)
start.batThen select what to start from the menu.
Option B: Direct Commands (Recommended for Development)
Open 2 separate terminals:
# Terminal 1: Start API Server (Backend)
python app/main.py
# β Available at http://localhost:8000
# Terminal 2: Start Frontend (Dashboard)
cd frontend
npm run dev
# β Available at http://localhost:51733. Configure MCP Server for Claude Desktop (Optional)
Run the configuration helper:
python app/stdio_config.pyCopy the output and add it to your Claude Desktop config file:
Windows:
%APPDATA%/Claude/claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Example configuration:
{
"mcpServers": {
"home-automation": {
"command": "python",
"args": ["C:/path/to/home_automation/app/mcp_server_stdio.py"]
}
}
}Restart Claude Desktop after adding the configuration.
π¬ Example AI Interactions
Device Control
"Turn on the living room lights to 75%"
"Set bedroom temperature to 72 degrees"
"Close all the blinds"
"Lock all doors"Status Queries
"What's the status of my home?"
"What's the temperature in the bedroom?"
"Are all the doors locked?"Home Modes
"I'm leaving" β Sets away mode
"I'm going to bed" β Sets sleep mode
"Good morning" β Sets home modeSpecial Actions
"Feed the fish"
"Water the front yard for 10 minutes"
"Start charging my car"π Project Structure
home_automation/
βββ app/
β βββ config.py # Configuration settings
β βββ main.py # FastAPI server
β βββ mcp_server_stdio.py # FastMCP server with tools
β βββ stdio_config.py # MCP configuration helper
β βββ db/
β β βββ schema.sql # Database schema
β β βββ database.py # Database manager
β β βββ seed_data.py # Sample devices
β βββ models/
β β βββ device.py # Device models
β βββ schemas/
β β βββ responses.py # API response schemas
β βββ utils/
β βββ websocket_manager.py # WebSocket manager
βββ frontend/ # React dashboard
βββ requirements.txt
βββ home_automation.db # SQLite database (auto-created)
βββ README.md
βββ DEVELOPMENT.md # Development guideπ§ API Endpoints
REST API
GET /- API informationGET /api/devices- Get all devices (supports?room=and?type=filters)GET /api/rooms- Get list of roomsGET /api/stats- Get dashboard statisticsWebSocket /ws- Real-time device updates
WebSocket Messages
From Server:
{
"type": "device_update",
"device_id": "living_room_light_main",
"state": "on",
"properties": {"brightness": 75}
}
{
"type": "mode_change",
"mode": "away"
}
{
"type": "full_refresh"
}π§ͺ Testing
Test API Server
curl http://localhost:8000
curl http://localhost:8000/api/devices
curl http://localhost:8000/api/statsTest MCP Tools Directly
python app/mcp_server_stdio.pyTest with MCP Inspector
npx @modelcontextprotocol/inspector python app/mcp_server_stdio.pyOpen browser to: http://localhost:6274
π All Available Commands
Command | Purpose | URL |
| Menu-driven launcher | - |
| Start API server | |
| Start frontend | |
| Start MCP server | stdio only |
| Test with inspector | |
| Get Claude config | - |
π Real-time Updates Flow
AI assistant calls MCP tool (e.g.,
control_device)MCP server updates SQLite database with timestamp
FastAPI server detects timestamp change (polls every 100ms)
FastAPI broadcasts update via WebSocket to all connected clients
Frontend receives update and re-renders affected devices
Total latency: < 300ms
π Performance Metrics
β Database queries: < 10ms
β MCP tool execution: < 100ms
β Change detection: 100ms polling
β WebSocket broadcast: < 50ms
β End-to-end update: < 300ms
β Concurrent WebSocket connections: 100+
π Troubleshooting
MCP Server Not Connecting
Check Claude Desktop config file path
Verify Python path in configuration
Restart Claude Desktop after config changes
Frontend Not Updating
Verify FastAPI server is running on port 8000
Check browser console for WebSocket errors
Ensure CORS origins include your frontend URL
Database Locked Errors
Verify only one process is accessing the database at a time
WAL mode is enabled automatically in database.py
Port Already in Use
# Windows PowerShell - Kill process on port
Get-NetTCPConnection -LocalPort 8000 |
Select-Object -ExpandProperty OwningProcess |
ForEach-Object { Stop-Process -Id $_ -Force }π οΈ Development
Add New Device Type
Add device to
app/db/seed_data.pyUpdate type hints in
app/models/device.pyAdd icon in frontend
DeviceCard.jsx
Add New MCP Tool
Add
@mcp.tool()decorated function inapp/mcp_server_stdio.pyInclude database operations
Document in docstring for AI assistant context
For detailed development information, see DEVELOPMENT.md
π Resources
π License
MIT License - See LICENSE file for details
π€ Contributing
Contributions welcome! Please open an issue or submit a pull request.
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoβ¦
Control your existing Philips lights, Sonos speakers, Roborock vacuums and other supported devices through Port OS cloud. Give ChatGPT, Claude and other MCP-compatible assistants access to the devices you connect. Turn off the living room lights, play music on your speakers, adjust the thermostat, run a vacuum in a room, check a camera snapshot or find a connected tracker. Available actions depend on your linked provider accounts and each deviceβs supported capabilities. Port OS runs in the cloud; no local server is required. You choose the account, device and capability permissions each assistant receives. Device operations require user OAuth; public tool discovery does not grant device access. Port OS is in alpha. Setup: https://portoperatingsystem.com/docs/getting-started/ Support: https://portoperatingsystem.com/contact/
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.3MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) integration that allows AI assistants to control Home Assistant devices by searching for entities and controlling devices through natural language commands.324MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to control Philips Hue smart lighting systems through natural language commands.3MIT
- AlicenseNot gradedqualityDmaintenanceA powerful MCP server that enables AI assistants to discover, commission, and control Matter-compatible smart home devices through a standardized interface.12 npm9MIT