A Model Context Protocol (MCP) server for interacting with Home Assistant. This server provides tools to control and monitor your Home Assistant devices through MCP-enabled applications.
This project is part of the AI Model Context Protocol (MCP) ecosystem. For more information and documentation about MCP tools, visit www.aimcp.info.
git clone https://github.com/yourusername/homeassistant-server-mcp.git
cd homeassistant-server-mcp
npm install
npm run build
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
for VSCode):{
"mcpServers": {
"homeassistant": {
"command": "node",
"args": ["/path/to/homeassistant-mcp/homeassistant-server/build/index.js"],
"env": {
"HA_URL": "http://your-homeassistant-url:8123",
"HA_TOKEN": "your-long-lived-access-token"
}
}
}
}
Replace your-homeassistant-url
and your-long-lived-access-token
with your Home Assistant instance URL and access token.
The server provides the following tools:
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "get_state",
arguments: {
entity_id: "light.living_room"
}
});
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "toggle_entity",
arguments: {
entity_id: "switch.bedroom",
state: "on" // or "off"
}
});
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "trigger_automation",
arguments: {
automation_id: "automation.morning_routine"
}
});
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "list_entities",
arguments: {
domain: "light" // optional, filters by domain
}
});
Contributions are welcome! Here's how you can help:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)Please make sure to update tests as appropriate and follow the existing code style.
For detailed documentation about MCP tools and the ecosystem:
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2024 homeassistant-mcp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
To securely use this server:
If you encounter any issues or have questions, please:
Seamless access to top MCP servers powering the future of AI integration.