Compare commits

...

4 Commits

Author SHA1 Message Date
jango-blockchained
af3399515a docs: enhance documentation site with improved design and features
- Update MkDocs configuration with advanced theme settings
- Add custom color palette and navigation features
- Expand markdown extensions for better documentation rendering
- Include new documentation sections and plugins
- Add custom CSS for improved site styling
- Update site description and navigation structure
2025-02-05 02:33:05 +01:00
jango-blockchained
01991c0060 chore: update documentation site configuration
- Update MkDocs site URL and repository links
- Modify README diagram formatting for improved readability
2025-02-05 02:23:36 +01:00
jango-blockchained
3f8d67b145 chore: refine configuration and setup scripts for improved usability
- Update README with minor text formatting
- Improve Smithery configuration command formatting
- Enhance macOS setup script with WebSocket URL conversion and security hardening
2025-02-05 02:20:08 +01:00
jango-blockchained
ab8b597843 docs: add MCP client integration documentation and scripts
- Update README with integration instructions for Cursor, Claude Desktop, and Cline
- Add configuration examples for different MCP client integrations
- Create Windows CMD script for starting MCP server
- Include configuration files for Claude Desktop and Cline clients
2025-02-05 00:48:45 +01:00
8 changed files with 270 additions and 16 deletions

View File

@@ -13,7 +13,7 @@
Welcome to the **Model Context Protocol (MCP) Server for Home Assistant**! This robust platform bridges Home Assistant with cutting-edge Language Learning Models (LLMs), enabling natural language interactions and real-time automation of your smart devices. Imagine entering your home, saying: Welcome to the **Model Context Protocol (MCP) Server for Home Assistant**! This robust platform bridges Home Assistant with cutting-edge Language Learning Models (LLMs), enabling natural language interactions and real-time automation of your smart devices. Imagine entering your home, saying:
> Hey MCP, dim the lights and start my evening playlist, > "Hey MCP, dim the lights and start my evening playlist,"
and watching your home transform instantly—that's the magic that MCP Server delivers! and watching your home transform instantly—that's the magic that MCP Server delivers!
@@ -58,17 +58,17 @@ Our architecture is engineered for performance, scalability, and security. The f
```mermaid ```mermaid
graph TD graph TD
subgraph Client subgraph Client
A[Client Application<br/>(Web / Mobile / Voice)] A[Client Application<br>(Web / Mobile / Voice)]
end end
subgraph CDN subgraph CDN
B[CDN / Cache] B[CDN / Cache]
end end
subgraph Server subgraph Server
C[Bun Native Server] C[Bun Native Server]
E[NLP Engine<br/>& Language Processing Module] E[NLP Engine &<br>Language Processing Module]
end end
subgraph Integration subgraph Integration
D[Home Assistant<br/>(Devices, Lights, Thermostats)] D[Home Assistant<br>(Devices, Lights, Thermostats)]
end end
A -->|HTTP Request| B A -->|HTTP Request| B
@@ -294,3 +294,79 @@ This project is licensed under the MIT License. See [LICENSE](LICENSE) for full
--- ---
🔋 Batteries included. 🔋 Batteries included.
## MCP Client Integration
This MCP server can be integrated with various clients that support the Model Context Protocol. Below are instructions for different client integrations:
### Cursor Integration
The server can be integrated with Cursor by adding the configuration to `.cursor/config/config.json`:
```json
{
"mcpServers": {
"homeassistant-mcp": {
"command": "bun",
"args": ["run", "start"],
"cwd": "${workspaceRoot}",
"env": {
"NODE_ENV": "development"
}
}
}
}
```
### Claude Desktop Integration
For Claude Desktop, add the following to your Claude configuration file:
```json
{
"mcpServers": {
"homeassistant-mcp": {
"command": "bun",
"args": ["run", "start", "--port", "8080"],
"env": {
"NODE_ENV": "production"
}
}
}
}
```
### Cline Integration
For Cline-based clients, add the following configuration:
```json
{
"mcpServers": {
"homeassistant-mcp": {
"command": "bun",
"args": [
"run",
"start",
"--enable-cline",
"--config",
"${configDir}/.env"
],
"env": {
"NODE_ENV": "production",
"CLINE_MODE": "true"
}
}
}
}
```
### Command Line Usage
#### Windows
A CMD script is provided in the `scripts` directory. To use it:
1. Navigate to the `scripts` directory
2. Run `start_mcp.cmd`
The script will start the MCP server with default configuration.

View File

@@ -0,0 +1,28 @@
:root {
--md-primary-fg-color: #1a73e8;
--md-primary-fg-color--light: #5195ee;
--md-primary-fg-color--dark: #0d47a1;
}
.md-header {
box-shadow: 0 0 0.2rem rgba(0,0,0,.1), 0 0.2rem 0.4rem rgba(0,0,0,.2);
}
.md-main__inner {
margin-top: 1.5rem;
}
.md-typeset h1 {
font-weight: 700;
color: var(--md-primary-fg-color);
}
.md-typeset .admonition {
font-size: .8rem;
}
code {
background-color: rgba(175,184,193,0.2);
padding: .2em .4em;
border-radius: 6px;
}

View File

@@ -0,0 +1,16 @@
{
"mcpServers": {
"homeassistant-mcp": {
"command": "bun",
"args": [
"run",
"start",
"--port",
"8080"
],
"env": {
"NODE_ENV": "production"
}
}
}
}

18
docs/cline_config.json Normal file
View File

@@ -0,0 +1,18 @@
{
"mcpServers": {
"homeassistant-mcp": {
"command": "bun",
"args": [
"run",
"start",
"--enable-cline",
"--config",
"${configDir}/.env"
],
"env": {
"NODE_ENV": "production",
"CLINE_MODE": "true"
}
}
}
}

View File

@@ -327,3 +327,7 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
echo -e "${GREEN}Home Assistant MCP test successful!${NC}" echo -e "${GREEN}Home Assistant MCP test successful!${NC}"
fi fi
fi fi
# macOS environment configuration
HASS_SOCKET_URL="${HASS_HOST/http/ws}/api/websocket" # WebSocket URL conversion
chmod 600 "$CLAUDE_CONFIG_DIR/claude_desktop_config.json" # Security hardening

View File

@@ -1,26 +1,110 @@
site_name: Home Assistant Model Context Protocol (MCP) site_name: Home Assistant MCP
site_url: https://yourusername.github.io/your-repo-name/ site_description: A bridge between Home Assistant and Language Learning Models
repo_url: https://github.com/yourusername/your-repo-name site_url: https://jango-blockchained.github.io/advanced-homeassistant-mcp/
repo_url: https://github.com/jango-blockchained/advanced-homeassistant-mcp
repo_name: jango-blockchained/advanced-homeassistant-mcp
theme: theme:
name: material name: material
logo: assets/images/logo.png
favicon: assets/images/favicon.ico
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/brightness-7
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: indigo
accent: indigo
toggle:
icon: material/brightness-4
name: Switch to light mode
features: features:
- navigation.tabs - navigation.instant
- navigation.tracking
- navigation.sections - navigation.sections
- toc.integrate - navigation.expand
- navigation.top
- search.suggest - search.suggest
- search.highlight - search.highlight
- content.code.copy
markdown_extensions: markdown_extensions:
- pymdownx.highlight
- pymdownx.superfences
- admonition - admonition
- attr_list
- def_list
- footnotes
- meta
- toc:
permalink: true
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.details - pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.magiclink
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
plugins:
- search
- minify:
minify_html: true
- git-revision-date-localized:
type: date
- mkdocstrings:
default_handler: python
handlers:
python:
options:
show_source: true
nav: nav:
- Home: index.md - Home: index.md
- Getting Started: - Getting Started:
- Installation: getting-started/installation.md - Installation: getting-started/installation.md
- Configuration: getting-started/configuration.md - Quick Start: getting-started/quickstart.md
- Usage: usage.md - API Reference:
- Overview: api/index.md
- SSE API: api/sse.md
- Core Functions: api/core.md
- Architecture: architecture.md
- Contributing: contributing.md - Contributing: contributing.md
- Troubleshooting: troubleshooting.md
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/jango-blockchained/homeassistant-mcp
- icon: fontawesome/brands/docker
link: https://hub.docker.com/r/jangoblockchained/homeassistant-mcp
analytics:
provider: google
property: !ENV GOOGLE_ANALYTICS_KEY
extra_css:
- assets/stylesheets/extra.css
copyright: Copyright &copy; 2024 Jango Blockchained

21
scripts/start_mcp.cmd Normal file
View File

@@ -0,0 +1,21 @@
@echo off
setlocal
:: Set environment variables
set NODE_ENV=production
:: Change to the script's directory
cd /d "%~dp0"
cd ..
:: Start the MCP server
echo Starting Home Assistant MCP Server...
bun run start --port 8080
if errorlevel 1 (
echo Error starting MCP server
pause
exit /b 1
)
pause

View File

@@ -18,4 +18,11 @@ startCommand:
commandFunction: commandFunction:
# A function that produces the CLI command to start the MCP on stdio. # A function that produces the CLI command to start the MCP on stdio.
|- |-
config => ({command: 'bun', args: ['--smol', 'run', 'start'], env: { HASS_TOKEN: config.hassToken, PORT: config.port.toString() }}) config => ({
command: 'bun',
args: ['--smol', 'run', 'start'],
env: {
HASS_TOKEN: config.hassToken,
PORT: config.port.toString()
}
})