Skip to content

[BUG] MCP connection crashes persistently when calling ha_search_entities tool #406

@lucianconstantin

Description

@lucianconstantin

Bug Summary

MCP connection crashes persistently when calling ha_search_entities tool and only way to fix it is to restart Claude Code session. Restart of HA-MCP addon doesn't fix it.

What happened

When calling ha_search_entities (especially with multiple parallel calls), the MCP connection hangs and then all subsequent calls fail with "No valid session ID provided" errors. The only way to recover is to restart Claude Code completely.

What you expected

The ha_search_entities tool should return results without crashing the MCP connection.

Steps to reproduce

  1. Connect to HA via ha-mcp from Claude Code
  2. Call ha_search_entities (often with multiple parallel calls)
  3. MCP connection drops, subsequent tool calls fail with session ID errors
  4. Must restart Claude Code to restore connection

Error messages

No valid session ID provided

Environment (auto-populated)

  • ha-mcp Version: 6.0.0
  • Installation Method: addon
  • Platform: Linux 6.12.51-haos (x86_64)
  • Python Version: 3.13.11
  • Home Assistant Version: 2026.1.0
  • Connection Status: Connected
  • Entity Count: 970
  • Time Zone: Europe/Bucharest

Note: The crash happens before it can be logged, so the recent tool calls only show successful ha_rename_entity calls from before the crash.


🚀 Startup Logs (if relevant)

Details [01/09/26 10:08:36] INFO Starting MCP server 'ha-mcp' with server.py:2582 transport 'streamable-http' on http://0.0.0.0:9583/private_U7hq3QU1 ki734-PTKi2HFw INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:9583 (Press CTRL+C to quit) INFO: 10.0.1.81:45798 - "POST /private_U7hq3QU1ki734-PTKi2HFw HTTP/1.1" 400 Bad Request

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions