Replies: 4 comments
|
Note: This is an automated triage based on the analysis of this code base and public search (Web, Home Assistant Source code, ...). Issue Triage AnalysisSummaryThis issue proposes a major architectural shift: rewriting ha-mcp from a standalone MCP server (80+ tools, 166 test files) to a Home Assistant custom component. This would leverage HA Core's internal APIs instead of the current REST/WebSocket approach. The migration is estimated at 5-10 days and has both significant benefits and substantial risks. Codebase AnalysisCurrent Architecture:
Key Dependencies:
Home Assistant MCP Integration (2025.2+):
Research Findings1. HA Core's MCP Support ✅
2. Custom Component Viability
|
| Caveat | Analysis | Recommendation |
|---|---|---|
| Retro-compatibility | Hard cut means users must migrate immediately | Provide migration guide, deprecation notice in v5.x releases |
| Parallel deployment | Requires websocket API abstraction, 2-3 week freeze | Not recommended - complexity too high for benefit |
| FastMCP features | HA Core uses official SDK; may lose FastMCP 2.0 extras | Audit which features are actually used (likely none of the advanced ones) |
| Test coverage | Current 166 test files, need 80-90% target | Many integration tests convert to unit tests; E2E still needed |
| Architecture-specific tests | Some tests assume HTTP API patterns | Rewrite as internal API tests; estimate 30-40% test refactor |
| User adoption | Some users may prefer standalone deployment | Communicate benefits clearly; maintain standalone for 1-2 releases as deprecated |
| OAuth2/DCR | ✅ Not a blocker |
Priority Assessment
Recommended Priority: HIGH
Justification:
- Strategic alignment: Home Assistant founder endorsed this direction (mentioned in issue)
- Architecture benefits: Direct API access is cleaner, more performant, better long-term
- Deployment simplification: HACS distribution is easier for HA users than external setup
- Ecosystem positioning: Aligns with HA Core's official MCP integration (2025.2+)
Comparison with other high-priority issues:
- Issue [FEATURE] Support MCP Client of Home assistant #44 (MCP Client support) is blocked - would benefit from custom component approach
- Issue [FEATURE] OAuth 2.1 Authentication with DCR and Consent Form #245 (OAuth 2.1 with DCR) - already solved in HA Core's MCP integration
- Issue Partial update strategy + statelessness + progressive disclosure #296 (Partial updates) - architectural concern that custom component could address
However, this is a multi-week project (5-10 days estimate seems low given scope) that requires:
- Clear migration strategy decision
- Communication plan for existing users
- Phased implementation (POC → core tools → full migration → deprecation)
Labels Applied
- needs-choices: Multiple implementation approaches require stakeholder decisions
- enhancement: New deployment architecture
- priority: high: Strategic importance, maintainer/founder endorsement
- triaged: Analysis complete
Next Steps (Recommended)
- Maintainer decides on Decision 1 (migration strategy) and Decision 4 (client support model)
- Create POC: Minimal custom component with 2-3 tools using internal APIs
- Validate clients: Test Claude Desktop + 2-3 other clients can connect
- Map APIs: Complete tool-by-tool mapping of REST/WS → internal APIs
- Test strategy: Design new test approach for custom component architecture
- Migration plan: Document user migration path, deprecation timeline
- Implementation: If POC successful, proceed with full migration
Automated triage by Claude Code
Sources:
|
My notes:
|
|
More notes
|
|
This issue is stale because it has been open for 30 days with no activity. |
Uh oh!
There was an error while loading. Please reload this page.
I was thinking for a bit to re-write this MCP as a custom component, but the refactor efforts are big (5 to 10 days or work).
I did a post on Reddit and the founder of Home assistant suggested for this mcp to be a custom component.
This is a push in that direction.
Benefits :
However, this is a very big change.
Some caveat to address:
Todo:
All reactions