# Error Handling Strategies for Connection Errors and JSON Decode Failures in Blender-MCP

> Learn Blender MCP error handling strategies for connection errors and JSON decode failures. Discover how Blender MCP ensures stable communication through multi-layered resilience.

- Repository: [ahujasid/blender-mcp](https://github.com/ahujasid/blender-mcp)
- Tags: exception-handling
- Published: 2026-04-13

---

**Blender-MCP implements a multi-layered resilience strategy that catches socket connection errors, timeouts, and JSON decode failures at both the transport and application layers, automatically invalidating dead sockets and reconstructing fragmented messages to maintain stable communication with the Blender add-on.**

Blender-MCP bridges external AI systems with Blender through a TCP socket connection that exchanges JSON messages. The codebase employs systematic **error handling strategies for connection errors and JSON decode failures** across [`src/blender_mcp/server.py`](https://github.com/ahujasid/blender-mcp/blob/main/src/blender_mcp/server.py) and [`addon.py`](https://github.com/ahujasid/blender-mcp/blob/main/addon.py) to ensure reliability when the Blender process, network layer