Home Assistant MCP Server - Claude Integration Troubleshooting Report
Setup
- System: Windows 11
- Python: 3.14-64
- Home Assistant: Running with HA-MCP Custom Component (ha-mcp 7.11.0 - stable channel)
- Claude: Desktop app with MCP support
- Goal: Connect Home Assistant to Claude via HA-MCP Server
Problem Summary
Home Assistant MCP Server component runs successfully inside Home Assistant, but Claude cannot attach to the locally-running Python MCP server script.
Error in Claude:
Could not attach to MCP server home-assistant
Configuration
Claude Config (JSON)
json
{
"mcpServers": {
"home-assistant": {
"command": "python",
"args": ["C:\\Users\\hawkster\\Claude\\ha_mcp_server.py"]
}
}
}
Home Assistant URLs Available
From HA-MCP Settings (Settings → Devices & Services → HA-MCP Custom Component):
- Cloud URL (Nabu Casa):
https://XXXXXXXXXXXXXX.ui.nabu.casa/api/webhook/mcp_XXXXXXXXXXXXXXXX
Not reachable (DNS/network blocking)
- Local IP (Direct):
http://XXX.XXX.XX.XXX:8123/api/webhook/mcp_XXXXXXXXXXXXXXXX
Reachable (ping works, 0ms response)
- Local IP (9584 port):
http://XXX.XXX.XX.XXX:9584/private_XXXXXXXXXXXXXXXXXXXXXXX
Troubleshooting Steps Attempted
1.
Cloud URL Approach
- Attempt: Use Nabu Casa Cloud URL
- Result: DNS resolution failed
Cannot connect to host XXXXXXXXXXXXXX.ui.nabu.casa:443
[getaddrinfo failed]
- Cause: Network/ISP blocking or DNS issue
2.
Switched to Local IP
- URL Used:
http://XXX.XXX.XX.XXX:8123/api/webhook/mcp_... - Verification: Ping successful (0ms response)
- Status: Reachable from Windows machine
3.
Multiple MCP Server Scripts Tested
Script 1: ha_mcp_server_improved.py
- Issue: MCP Server incompatibility -
async withnot supported - Error:
TypeError: 'mcp.server.lowlevel.server.Server' object does not support the asynchronous context manager protocol
Script 2: ha_mcp_server_working.py
- Issue: Connection retry logic blocked MCP initialization
- Error: Server crashed during connection attempts
Script 3: ha_mcp_server_fixed.py
- Issue: Wrong MCP method call
- Error:
AttributeError: 'Server' object has no attribute 'run_server'
Script 4: ha_mcp_server_final.py
- Issue: Correct
stdio_server()approach - Status: Script starts successfully, says “Connected to Claude. Serving tools…” but Claude still cannot attach
- Claude Status: Shows “Running” (blue badge) but won’t connect
Script 5: ha_mcp_simple.py
- Issue: Missing import
from mcp.tools import Tool(doesn’t exist in MCP SDK) - Error:
ModuleNotFoundError: No module named 'mcp.tools'
Script 6: ha_server_clean.py
- Issue: Same as above after removing unnecessary imports
- Status: Server runs but Claude still cannot attach
4. Dependencies Installed
bash
python -m pip install mcp
python -m pip install aiohttp
Current Status
What Works:
- Home Assistant is running with HA-MCP component
- Local IP (XXX.XXX.XX.XXX:8123) is reachable
- Python MCP scripts start without crashing
- Scripts report “Connected to Claude. Serving tools…”
- Claude shows server status as “Running” (blue badge)
What Doesn’t Work:
- Claude cannot attach/connect to the server
- Error remains: “Could not attach to MCP server home-assistant”
- Cannot view detailed logs (View Logs button not clickable in Claude UI)
Observations
- Script Status Discrepancy: Scripts say they’re “Connected” but Claude says it can’t attach
- Logs Inaccessible: Cannot click “View Logs” in Claude Developer Settings to see actual error
- Version Compatibility: MCP SDK version appears to have breaking changes between script examples
- Network: Local connectivity works; Cloud connectivity blocked by ISP/network
What We Need to Debug Further
- Full error log from Claude (cannot access in UI)
- MCP SDK version compatibility with current Claude version
- stdio_server() protocol - is it compatible with Claude’s MCP integration?
- Alternative MCP server implementations for HA-Claude integration
Questions for Community
- Has anyone successfully connected HA-MCP to Claude desktop app?
- Which MCP SDK version is compatible with Claude desktop MCP servers?
- Is there a different/simpler way to expose HA to Claude via MCP?
- Are there any known issues with stdio_server() in Claude integration?
Files/Versions
- Python: 3.14-64-bit
- MCP Package: Latest (installed via pip)
- HA-MCP: 7.11.0 (stable)
- Claude: Latest desktop app
- HA: Latest stable
Report generated during troubleshooting session. Tried 6 different server script approaches. Issue persists across all attempts.