# How the Blender MCP Addon Executes Commands on Blender's Main Thread

> Discover how the Blender MCP addon executes commands on Blender's main thread using bpy app timers for safe API access. Learn about its background TCP server and thread management.

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

---

**The Blender MCP addon runs a TCP server in a background thread and uses `bpy.app.timers.register` to schedule command execution on Blender's main UI thread, ensuring thread-safe access to Blender's Python API.**

The `ahujasid/blender-mcp` repository implements a robust mechanism for external applications to control Blender programmatically. Since Blender's Python API (`bpy`) is **not thread-safe**, the addon must bridge the gap between its asynchronous network layer and Blender's single-threaded UI loop to prevent crashes when manipulating scene data.

## Why Blender's Main Thread