Commit 59fc978
* feat: add PyInstaller standalone binary builds
Adds support for building standalone executables for Linux, Windows, and macOS:
- ha-mcp.spec: PyInstaller spec file with dynamic stdlib path detection
- build-binary.yml: GitHub Actions workflow for multi-platform builds
The workflow:
- Builds in parallel on ubuntu-latest, windows-latest, macos-latest
- Tests that each binary starts correctly (FastMCP banner appears)
- Uploads artifacts for each platform
Binary size: ~52MB (includes Python runtime and all dependencies)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use Python 3.13 and venv for PyInstaller builds
- Change Python version from 3.12 to 3.13 (required by pyproject.toml)
- Use proper venv instead of --system install for better package discovery
- Add venv to PATH for subsequent steps
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use portable timeout approach for macOS
macOS doesn't have the 'timeout' command. Use background process
with sleep and kill instead, which works on all Unix platforms.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add CD workflow with mcpb packaging and GitHub releases
- Convert PR workflow to CD workflow triggered on releases
- Add mcpb bundle packaging for Windows and macOS binaries
- Add GitHub release publishing for all 3 platform binaries
- Create manifest.json template for mcpb specification
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: add explicit permissions block to workflow
Addresses CodeQL security warning about missing GITHUB_TOKEN
permission restrictions. Sets minimal `contents: read` by default,
with the release job already having `contents: write` override.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: add user_config for HA URL and token in mcpb manifest
Adds user_config section so mcpb clients will prompt users for:
- Home Assistant URL (required)
- Long-Lived Access Token (required, sensitive/masked)
These are injected as HOMEASSISTANT_URL and HOMEASSISTANT_TOKEN
environment variables when the server starts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: include click module for uvicorn dependency
Uvicorn requires click for CLI configuration. Removed click from
PyInstaller excludes to fix Windows binary startup error:
ModuleNotFoundError: No module named 'click'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ci: improve Windows test diagnostics
* fix: add idna codec hidden imports for PyInstaller
* fix: add more commonly missing PyInstaller hidden imports
* fix: add runtime hook to register idna codec at startup
* feat: auto-generate mcpb manifest with discovered tools
* fix: use UTF-8 encoding in generate_manifest.py for Windows compatibility
* feat: polish mcpb manifest for submission
- Add 512x512 icon (logo only, no text)
- Add PRIVACY.md with future-ready analytics opt-in clause
- Add Privacy section to README
- Add 5 usage examples showcasing automation management
- Update manifest with full metadata:
- display_name: 'Home Assistant MCP Server'
- Author: Julien Larocque-Dupont
- repository, homepage, documentation, support URLs
- privacy_policies array pointing to raw GitHub PRIVACY.md
- Expanded keywords
- long_description with markdown formatting
- Update workflow to include icon in mcpb bundle
* docs: adjust privacy policy language to use "might collect"
Makes telemetry language more conditional/future-oriented rather than
stating it as currently active collection.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: reorganize distribution files and add smoke test
- Reorganize distribution files into packaging/ folder
- packaging/binary/ for PyInstaller spec
- packaging/mcpb/ for mcpb packaging files
- Add smoke test CLI command (--smoke-test flag)
- Replace start-and-grep binary test with proper smoke test
- Fix metadata: rename to "Home Assistant MCP" (no Server)
- Simplify manifest template (tools are auto-generated)
- Fix double newlines in long_description
- Add deferred server loading for smoke test support
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use absolute paths in PyInstaller spec file
The spec file paths are now relative to PROJECT_ROOT to work correctly
when pyinstaller is invoked from the project root directory.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct PROJECT_ROOT calculation in spec file
SPECPATH is already the directory containing the spec file, so we only
need dirname twice to get the project root.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: move pyinstaller_hooks to packaging/binary/
Keep all PyInstaller-related files together in the packaging/binary
directory.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: handle Windows encoding in smoke test
Force UTF-8 encoding for stdout/stderr on Windows to support
Unicode checkmark characters.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: address security scanner warnings and fix privacy policy
- Add explicit permissions to build job to satisfy GitHub security scanner
- Update PRIVACY.md to match README claims (no telemetry)
- Remove references to hypothetical future telemetry features
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: add string coercion for numeric parameters in history tools
AI tools often pass numeric parameters as strings (e.g., "100" instead of 100),
causing validation failures. This adds a shared coerce_int_param() utility that:
- Safely converts string/int/None to integers
- Handles float strings like "100.0"
- Applies min/max constraints
- Returns helpful error messages
Applied to:
- ha_get_history: limit parameter
- ha_get_logbook: hours_back, limit, offset parameters
Fixes #205, fixes #206
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3808907 commit 59fc978
14 files changed
Lines changed: 934 additions & 33 deletions
File tree
- .github/workflows
- packaging
- binary
- pyinstaller_hooks
- mcpb
- src/ha_mcp
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
33 | 49 | | |
34 | 50 | | |
35 | 51 | | |
| |||
588 | 604 | | |
589 | 605 | | |
590 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
591 | 619 | | |
592 | 620 | | |
593 | 621 | | |
| |||
0 commit comments