# sandraschi/blender-mcp architecture

> Architecture diagram of the GitHub repository sandraschi/blender-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sandraschi/blender-mcp
- Repository: https://github.com/sandraschi/blender-mcp

## Overview

#### Purpose and Entry Points
Blender MCP is a Python/FastMCP server that exposes Blender automation to MCP clients such as Claude Desktop. Its primary runtime entry points are the package CLI/application and server: `src/blender_mcp/__main__.py`, `src/blender_mcp/cli.py`, `src/blender_mcp/app.py`, and `src/blender_mcp/server.py`. Distribution also includes a self-contained MCPB layout under `mcpb/src/blender_mcp/` and launcher `mcpb/server/main.py`.

#### MCP Tool Surface and Dispatch
The server publishes a broad tool catalog grouped by Blender domain—scene, mesh, materials, rendering, animation, import/export, simulation, VRM, VSE, and AI generation. Tool modules define MCP-facing operations and route work to handlers: `src/blender_mcp/tools/scene/scene_tools.py`, `src/blender_mcp/tools/mesh/mesh_tools.py`, `src/blender_mcp/tools/ai_generate_tools.py`. Cross-cutting decorators, compatibility, configuration, exceptions, and transport establish invocation policy and protocol boundaries: `src/blender_mcp/decorators.py`, `src/blender_mcp/transport.py`, `src/blender_mcp/config.py`.

#### Blender Execution Boundary
Handlers translate validated tool requests into Blender-side operations, separating MCP/API semantics from `bpy` execution: `src/blender_mcp/handlers/scene_handler.py`, `src/blender_mcp/handlers/mesh_handler.py`, `src/blender_mcp/handlers/export_handler.py`. The executor/runtime layer chooses between a headless `blender --background` subprocess and a connected live session, including script execution, errors, and validation: `src/blender_mcp/utils/blender_executor.py`, `src/blender_mcp/utils/blender_runtime.py`, `src/blender_mcp/utils/validation.py`. Blender itself is an externally installed dependency, located through configuration such as `BLENDER_EXECUTABLE`.

#### Live Bridge and Session Control
The optional Blender addon provides the GUI-side bridge for viewport-visible edits and live feedback: `addon/blender_bridge_addon.py`, with addon/session operations exposed by `src/blender_mcp/handlers/addon_handler.py` and `src/blender_mcp/tools/session_tools.py`. Control flow prefers a live bridge for session-capable calls, but falls back to isolated headless execution; individual tool calls can force headless behavior. This is the key process/network boundary between the MCP server and an interactive Blender instance.

#### Asset, AI, and Production Pipelines
Higher-level tools compose construction and batch workflows around the core Blender boundary: `src/blender_mcp/tools/construct_tools.py`, `src/blender_mcp/tools/batch_tools.py`, `src/blender_mcp/tools/workflow/workflow_tools.py`. AI mesh generation and refinement are represented separately from Blender execution: `src/blender_mcp/tools/ai_generate_tools.py`, `src/blender_mcp/utils/ai_mesh_backends.py`, `src/blender_mcp/tools/vision_refine_tools.py`. Asset acquisition integrates external services through dedicated adapters: `src/blender_mcp/services/polyhaven_api.py`, `src/blender_mcp/services/sketchfab_api.py`, `src/blender_mcp/services/asset_fetch.py`. Inputs include prompts, scripts, images, meshes, and `.blend`; outputs include saved scenes, renders/video, and interchange exports such as GLB/FBX/USD/VRM.

#### Web and Native Clients
An optional React/Vite dashboard offers operational and creative workflows via an MCP client API: `webapp/frontend/src/App.tsx`, `webapp/frontend/src/api/mcp.ts`, `webapp/frontend/src/common/mcp-client.ts`. Its screens include scene exploration, agent tooling, construction, logs, and status. A Tauri-native shell combines Rust backend code with that frontend: `native/src/main.rs`, `native/src/backend.rs`, `native/tauri.conf.json`.

#### Operations and Packaging
Python is the principal server runtime; FastMCP is the MCP framework. Docker and Compose support optional deployment: `Dockerfile`, `docker-compose.yml`. System service units support persistent server operation: `systemd/blender-mcp.service`, `systemd/blender-mcp-http.service`. Observability is provisioned for Prometheus metrics, Grafana dashboards, and Loki/Promtail logs: `monitoring/prometheus/prometheus.yml`, `monitoring/grafana/dashboards/blender-mcp-overview.json`, `monitoring/loki/loki.yml`. MCPB manifests, bundled server files, addon, and prompts package the desktop-installable distribution: `mcpb/manifest.json`, `mcpb/server/main.py`, `mcpb/assets/addon/blender_bridge_addon.py`.

Main entry points: [`src/blender_mcp/server.py`](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/server.py) (FastMCP server), [`src/blender_mcp/utils/blender_runtime.py`](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/utils/blender_runtime.py) (Execution runtime), [`src/blender_mcp/handlers/scene_handler.py`](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/handlers/scene_handler.py) (Blender handlers), [`src/blender_mcp/tools/scene/scene_tools.py`](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/scene/scene_tools.py) (Domain tool catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Python MCP Server"]
  node_cli["CLI / application<br/>Python entrypoint<br/>[cli.py]"]
  node_server{{"FastMCP server<br/>MCP protocol host<br/>[server.py]"}}
  node_transport["Transport &amp; invocation policy<br/>protocol layer<br/>[transport.py]"]
  node_tool_catalog["Domain tool catalog<br/>MCP tools<br/>[scene_tools.py]"]
  node_handlers["Blender handlers<br/>request handlers<br/>[scene_handler.py]"]
end

subgraph group_blender["Blender Boundary"]
  node_runtime{{"Execution runtime<br/>executor selection<br/>[blender_runtime.py]"}}
  node_headless["Headless Blender<br/>subprocess execution"]
  node_live_tools["Session controls<br/>MCP tools<br/>[session_tools.py]"]
  node_addon_handler["Addon handler<br/>live-session adapter<br/>[addon_handler.py]"]
  node_addon{{"Blender bridge addon<br/>interactive bridge"}}
  node_blender["Installed Blender<br/>external dependency"]
end

subgraph group_pipelines["Asset &amp; AI Pipelines"]
  node_workflows["Construction &amp; batch workflows<br/>composed tools<br/>[construct_tools.py]"]
  node_ai["AI generation &amp; refinement<br/>AI tool pipeline"]
  node_assets["External asset adapters<br/>service integrations<br/>[asset_fetch.py]"]
end

subgraph group_clients["Clients"]
  node_web["React dashboard<br/>MCP client UI<br/>[App.tsx]"]
  node_native["Tauri desktop shell<br/>native client<br/>[main.rs]"]
end

subgraph group_operations["Packaging &amp; Operations"]
  node_mcpb["MCPB distribution<br/>desktop package<br/>[manifest.json]"]
  node_deployment["Deployment services<br/>container and systemd"]
  node_monitoring["Observability stack<br/>metrics and logs<br/>[prometheus.yml]"]
end

node_cli -->|"starts"| node_server
node_server -->|"uses"| node_transport
node_server -->|"publishes"| node_tool_catalog
node_tool_catalog -->|"dispatches"| node_handlers
node_handlers -->|"executes through"| node_runtime
node_live_tools -->|"routes session calls"| node_addon_handler
node_tool_catalog -->|"includes"| node_live_tools
node_addon_handler -->|"requests live execution"| node_runtime
node_runtime -->|"fallback / forced mode"| node_headless
node_runtime -->|"prefers connected session"| node_addon
node_headless -->|"launches"| node_blender
node_addon -->|"runs inside"| node_blender
node_workflows -->|"composes"| node_handlers
node_ai -->|"sends generated meshes"| node_handlers
node_assets -->|"supplies assets"| node_workflows
node_web -->|"MCP client API"| node_server
node_native -->|"hosts frontend"| node_web
node_mcpb -->|"bundles"| node_server
node_mcpb -->|"ships"| node_addon
node_deployment -->|"runs"| node_server
node_monitoring -.->|"observes"| node_server

click node_cli "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/cli.py"
click node_server "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/server.py"
click node_transport "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/transport.py"
click node_tool_catalog "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/scene/scene_tools.py"
click node_handlers "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/handlers/scene_handler.py"
click node_runtime "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/utils/blender_runtime.py"
click node_headless "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/utils/blender_executor.py"
click node_live_tools "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/session_tools.py"
click node_addon_handler "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/handlers/addon_handler.py"
click node_addon "https://github.com/sandraschi/blender-mcp/blob/main/addon/blender_bridge_addon.py"
click node_workflows "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/construct_tools.py"
click node_ai "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/ai_generate_tools.py"
click node_assets "https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/services/asset_fetch.py"
click node_web "https://github.com/sandraschi/blender-mcp/blob/main/webapp/frontend/src/App.tsx"
click node_native "https://github.com/sandraschi/blender-mcp/blob/main/native/src/main.rs"
click node_mcpb "https://github.com/sandraschi/blender-mcp/blob/main/mcpb/manifest.json"
click node_deployment "https://github.com/sandraschi/blender-mcp/blob/main/Dockerfile"
click node_monitoring "https://github.com/sandraschi/blender-mcp/blob/main/monitoring/prometheus/prometheus.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_server,node_transport,node_tool_catalog,node_handlers toneBlue
class node_runtime,node_headless,node_live_tools,node_addon_handler,node_addon,node_blender toneAmber
class node_workflows,node_ai,node_assets toneMint
class node_web,node_native toneRose
class node_mcpb,node_deployment,node_monitoring toneIndigo
```

## Components

### Python MCP Server

FastMCP tool API and execution orchestration.

- [CLI / application](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/cli.py): Python entrypoint · `src/blender_mcp/cli.py`
- [FastMCP server](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/server.py): MCP protocol host · `src/blender_mcp/server.py`
- [Transport & invocation policy](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/transport.py): protocol layer · `src/blender_mcp/transport.py`
- [Domain tool catalog](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/scene/scene_tools.py): MCP tools · Scene, mesh, materials, render, animation, simulation, VRM, and VSE tools. · `src/blender_mcp/tools/scene/scene_tools.py`
- [Blender handlers](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/handlers/scene_handler.py): request handlers · Separate MCP-facing tools from bpy operations. · `src/blender_mcp/handlers/scene_handler.py`

### Blender Boundary

Headless and live-session execution paths.

- [Execution runtime](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/utils/blender_runtime.py): executor selection · Chooses live bridge or isolated headless execution. · `src/blender_mcp/utils/blender_runtime.py`
- [Headless Blender](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/utils/blender_executor.py): subprocess execution · Runs blender --background scripts with validation and error handling. · `src/blender_mcp/utils/blender_executor.py`
- [Session controls](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/session_tools.py): MCP tools · `src/blender_mcp/tools/session_tools.py`
- [Addon handler](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/handlers/addon_handler.py): live-session adapter · `src/blender_mcp/handlers/addon_handler.py`
- [Blender bridge addon](https://github.com/sandraschi/blender-mcp/blob/main/addon/blender_bridge_addon.py): interactive bridge · Enables viewport-visible edits and feedback from a connected Blender instance. · `addon/blender_bridge_addon.py`
- **Installed Blender**: external dependency · Located through BLENDER_EXECUTABLE configuration.

### Asset & AI Pipelines

- [Construction & batch workflows](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/construct_tools.py): composed tools · `src/blender_mcp/tools/construct_tools.py`
- [AI generation & refinement](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/tools/ai_generate_tools.py): AI tool pipeline · Generates and refines meshes before Blender-side work. · `src/blender_mcp/tools/ai_generate_tools.py`
- [External asset adapters](https://github.com/sandraschi/blender-mcp/blob/main/src/blender_mcp/services/asset_fetch.py): service integrations · Fetches production assets from Poly Haven and Sketchfab. · `src/blender_mcp/services/asset_fetch.py`

### Clients

- [React dashboard](https://github.com/sandraschi/blender-mcp/blob/main/webapp/frontend/src/App.tsx): MCP client UI · `webapp/frontend/src/App.tsx`
- [Tauri desktop shell](https://github.com/sandraschi/blender-mcp/blob/main/native/src/main.rs): native client · `native/src/main.rs`

### Packaging & Operations

- [MCPB distribution](https://github.com/sandraschi/blender-mcp/blob/main/mcpb/manifest.json): desktop package · Bundles server, addon, and prompts for desktop installation. · `mcpb/manifest.json`
- [Deployment services](https://github.com/sandraschi/blender-mcp/blob/main/Dockerfile): container and systemd · Docker, Compose, and system service deployment options. · `Dockerfile`
- [Observability stack](https://github.com/sandraschi/blender-mcp/blob/main/monitoring/prometheus/prometheus.yml): metrics and logs · Prometheus, Grafana, Loki, and Promtail provisioning. · `monitoring/prometheus/prometheus.yml`

## Connections

- CLI / application → FastMCP server: starts
- FastMCP server → Transport & invocation policy: uses
- FastMCP server → Domain tool catalog: publishes
- Domain tool catalog → Blender handlers: dispatches
- Blender handlers → Execution runtime: executes through
- Session controls → Addon handler: routes session calls
- Domain tool catalog → Session controls: includes
- Addon handler → Execution runtime: requests live execution
- Execution runtime → Headless Blender: fallback / forced mode
- Execution runtime → Blender bridge addon: prefers connected session
- Headless Blender → Installed Blender: launches
- Blender bridge addon → Installed Blender: runs inside
- Construction & batch workflows → Blender handlers: composes
- AI generation & refinement → Blender handlers: sends generated meshes
- External asset adapters → Construction & batch workflows: supplies assets
- React dashboard → FastMCP server: MCP client API
- Tauri desktop shell → React dashboard: hosts frontend
- MCPB distribution → FastMCP server: bundles
- MCPB distribution → Blender bridge addon: ships
- Deployment services → FastMCP server: runs
- Observability stack → FastMCP server: observes
