Skip to content

docs: add custom component documentation and HACS install badge - #877

Merged
sergeykad merged 3 commits into
masterfrom
docs-custom-component
Apr 5, 2026
Merged

docs: add custom component documentation and HACS install badge#877
sergeykad merged 3 commits into
masterfrom
docs-custom-component

Conversation

@sergeykad

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds documentation for the ha_mcp_tools custom component to the README and docs site FAQ. Users currently have no way to discover what the component does, why they need it, or how to install it.

Changes:

  • README.md: New "Custom Component" section with tool dependency table, HACS one-click badge, and install instructions
  • site/src/pages/faq.astro: New FAQ section covering what/why, installation (HACS badge + manual), and feature flags

Closes #864

Type of change

  • 🐛 Bug fix
  • ✨ New feature
  • 📚 Documentation
  • 🔧 Maintenance/refactor
  • 💥 Breaking change

Testing

  • I have tested these changes with a LLM agent
  • All automated tests pass (uv run pytest)
  • Code follows style guidelines (uv run ruff check)

Checklist

  • I have updated documentation if needed

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves user onboarding and discoverability by providing clear documentation for the ha_mcp_tools custom component. By integrating installation guides and feature flag requirements directly into the project's primary documentation and FAQ, it ensures users can easily set up the necessary components for advanced Home Assistant tool functionality.

Highlights

  • Documentation Update: Added a comprehensive 'Custom Component' section to the README.md, detailing the requirements, tool dependencies, and installation procedures for the ha_mcp_tools component.
  • FAQ Expansion: Updated the documentation site's FAQ page to include a dedicated section for the custom component, covering its purpose, installation methods (including a HACS badge), and necessary feature flag configurations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces documentation for the ha_mcp_tools custom component in the README and FAQ page, detailing installation steps and the specific tools that require it. The review feedback correctly identifies the omission of the HAMCP_ENABLE_CUSTOM_COMPONENT_INTEGRATION feature flag, which is necessary for the automated installation tool mentioned in system error messages.

Comment thread README.md Outdated
Comment thread site/src/pages/faq.astro Outdated
@sergeykad
sergeykad marked this pull request as ready for review April 5, 2026 18:54
@sergeykad
sergeykad requested a review from a team April 5, 2026 18:54
@sergeykad
sergeykad enabled auto-merge (squash) April 5, 2026 18:54

@kingpanther13 kingpanther13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: docs: add custom component documentation and HACS install badge

Good docs-only PR that accurately addresses issue #864. All tool names, feature flags, and tool-to-flag mappings verified correct against the source code. Two items to address:


Important

1. ha_install_mcp_tools still points to the wrong repository — this tool IS the intended install path
src/ha_mcp/tools/tools_mcp_component.py:36

ha_install_mcp_tools exists specifically to automate custom component installation so users don't have to manually navigate HACS. When the filesystem tools detect the component is missing, their error messages explicitly direct users to it: "Use ha_install_mcp_tools() to install it via HACS, then restart Home Assistant." (tools_filesystem.py:85). It's the primary, frictionless install mechanism — the HACS badge and manual steps are fallbacks.

Right now, tools_mcp_component.py:36 has:

MCP_TOOLS_REPO = "julienld/ha-mcp-test-custom-component"

with a TODO: "Switch to homeassistant-ai/ha-mcp after hacs.json is on default branch."

Meanwhile these docs tell users to manually add homeassistant-ai/ha-mcp via HACS. So the automated tool installs from a test repo while the manual instructions point to the real repo — users following different paths get different components.

hacs.json appears to already be on the default branch (custom_components/ha_mcp_tools/hacs.json exists in master). If that's the case, the TODO is stale and MCP_TOOLS_REPO should be updated to homeassistant-ai/ha-mcp before or alongside this docs PR.

This matters because the tool is the recommended path — making it work properly with the correct repo is more valuable than documenting manual workarounds around it. The focus should be on ensuring ha_install_mcp_tools works end-to-end with the real repo, then documenting it as the primary install method.

2. ha_read_file description is incomplete
README.md and faq.astro

The docs describe ha_read_file as "Read configuration and log files." Per the actual implementation and custom_components/ha_mcp_tools/__init__.py, it also reads files from www/, themes/, custom_templates/, and custom_components/**/*.py. The current description undersells the tool and could mislead users.

Suggested fix:

ha_read_file | Read files from allowed paths (config YAML, logs, www/, themes/, custom_templates/, custom_components/)

Suggestions (non-blocking)

3. ha_config_set_yaml — consider mentioning "whitelisted" keys
The description says "top-level YAML keys" which could imply all keys work. Only specific whitelisted keys are allowed (template, sensor, binary_sensor, command_line, rest, mqtt, shell_command, switch, light, fan, cover, climate, notify, group, utility_meter). Users might try homeassistant: or automation: and be confused.

4. Stale docstring in tools_mcp_component.py:8
Says HAMCP_ENABLE_MCP_TOOLS_INSTALLER but the actual flag at line 25 is HAMCP_ENABLE_CUSTOM_COMPONENT_INTEGRATION. Pre-existing, not introduced by this PR, but worth a follow-up.


Strengths

  • All five custom-component-dependent tools correctly identified and documented
  • Feature flag names and tool-to-flag mappings verified accurate against source
  • Dual documentation (README + FAQ site) ensures discoverability
  • FAQ section well-structured with progressive disclosure (what/why → install → flags)
  • Style consistent with existing README and FAQ patterns
  • Second commit correctly addressed Gemini's feedback about the missing flag

- Update MCP_TOOLS_REPO from test repo to real repo (hacs.json is on default branch)
- Fix stale docstring referencing wrong feature flag name
- Improve ha_read_file description to list all allowed paths
@sergeykad

Copy link
Copy Markdown
Collaborator Author

Addressed all review feedback:

Important items:

  1. Updated MCP_TOOLS_REPO from julienld/ha-mcp-test-custom-component to homeassistant-ai/ha-mcp — hacs.json is already on the default branch
  2. Improved ha_read_file description to list all allowed paths

Also fixed:

  • Stale docstring referencing wrong feature flag name (HAMCP_ENABLE_MCP_TOOLS_INSTALLERHAMCP_ENABLE_CUSTOM_COMPONENT_INTEGRATION)

Re: suggestion #3 (whitelisted keys): Intentionally omitted the key list from the docs — it would go stale as keys are added. The tool returns a clear error with the allowed keys if a user tries an unsupported one.

@kingpanther13 kingpanther13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All review feedback addressed in 8f9a2d9. Verified:

  1. MCP_TOOLS_REPO updated to homeassistant-ai/ha-mcp — tool now installs from the correct repo, consistent with HACS badge and manual instructions
  2. ha_read_file description updated to include all allowed paths (config YAML, logs, www/, themes/, custom_templates/, custom_components/)
  3. ✅ Stale docstring in tools_mcp_component.py:8 fixed — now says HAMCP_ENABLE_CUSTOM_COMPONENT_INTEGRATION

All CI checks passing. LGTM.

@sergeykad
sergeykad merged commit 9548cf4 into master Apr 5, 2026
19 checks passed
@sergeykad
sergeykad deleted the docs-custom-component branch April 5, 2026 20:04
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

🧪 Your changes are now in the dev channel!

Your PR has been merged to master and is available for testing in the dev channel.

Test your changes before the next stable release (biweekly Wednesday):
📖 Dev Channel Documentation

Quick start

# Run dev version
uvx ha-mcp-dev

# Check version
uvx ha-mcp-dev --version

Docker:

docker pull ghcr.io/homeassistant-ai/ha-mcp:dev
docker run --rm -i \
  -e HOMEASSISTANT_URL=http://your-ha:8123 \
  -e HOMEASSISTANT_TOKEN=your_token \
  ghcr.io/homeassistant-ai/ha-mcp:dev

Found an issue? Please open a new bug report and mention this PR for context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Missing documentation and HACS badge for ha_mcp_tools custom component

2 participants