From ab8b5978438ca5714df80686006e6c63170cac76 Mon Sep 17 00:00:00 2001 From: jango-blockchained Date: Wed, 5 Feb 2025 00:48:45 +0100 Subject: [PATCH] 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 --- README.md | 76 +++++++++++++++++++++++++++++++++ docs/claude_desktop_config.json | 16 +++++++ docs/cline_config.json | 18 ++++++++ scripts/start_mcp.cmd | 21 +++++++++ 4 files changed, 131 insertions(+) create mode 100644 docs/claude_desktop_config.json create mode 100644 docs/cline_config.json create mode 100644 scripts/start_mcp.cmd diff --git a/README.md b/README.md index 9bfaa53..79c84a8 100644 --- a/README.md +++ b/README.md @@ -294,3 +294,79 @@ This project is licensed under the MIT License. See [LICENSE](LICENSE) for full --- 🔋 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. diff --git a/docs/claude_desktop_config.json b/docs/claude_desktop_config.json new file mode 100644 index 0000000..ec8b609 --- /dev/null +++ b/docs/claude_desktop_config.json @@ -0,0 +1,16 @@ +{ + "mcpServers": { + "homeassistant-mcp": { + "command": "bun", + "args": [ + "run", + "start", + "--port", + "8080" + ], + "env": { + "NODE_ENV": "production" + } + } + } +} \ No newline at end of file diff --git a/docs/cline_config.json b/docs/cline_config.json new file mode 100644 index 0000000..a86f75c --- /dev/null +++ b/docs/cline_config.json @@ -0,0 +1,18 @@ +{ + "mcpServers": { + "homeassistant-mcp": { + "command": "bun", + "args": [ + "run", + "start", + "--enable-cline", + "--config", + "${configDir}/.env" + ], + "env": { + "NODE_ENV": "production", + "CLINE_MODE": "true" + } + } + } +} \ No newline at end of file diff --git a/scripts/start_mcp.cmd b/scripts/start_mcp.cmd new file mode 100644 index 0000000..d92986f --- /dev/null +++ b/scripts/start_mcp.cmd @@ -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 \ No newline at end of file