How sandraschi/blender-mcp works
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: server.py FastMCP server · blender_runtime.py Execution runtime · scene_handler.py Blender handlers · scene_tools.py Domain tool catalog
Components 19
Python MCP Server
FastMCP tool API and execution orchestration.
- CLI / application
src/blender_mcp/cli.py - FastMCP server
src/blender_mcp/server.py - Transport & invocation policy
src/blender_mcp/transport.py - Domain tool catalog · Scene, mesh, materials, render, animation, simulation, VRM, and VSE tools.
src/blender_mcp/tools/scene/scene_tools.py - Blender 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 · Chooses live bridge or isolated headless execution.
src/blender_mcp/utils/blender_runtime.py - Headless Blender · Runs blender --background scripts with validation and error handling.
src/blender_mcp/utils/blender_executor.py - Session controls
src/blender_mcp/tools/session_tools.py - Addon handler
src/blender_mcp/handlers/addon_handler.py - Blender bridge addon · Enables viewport-visible edits and feedback from a connected Blender instance.
addon/blender_bridge_addon.py - Installed Blender · Located through BLENDER_EXECUTABLE configuration.
Asset & AI Pipelines
- Construction & batch workflows
src/blender_mcp/tools/construct_tools.py - AI generation & refinement · Generates and refines meshes before Blender-side work.
src/blender_mcp/tools/ai_generate_tools.py - External asset adapters · Fetches production assets from Poly Haven and Sketchfab.
src/blender_mcp/services/asset_fetch.py
Clients
- React dashboard
webapp/frontend/src/App.tsx - Tauri desktop shell
native/src/main.rs
Packaging & Operations
- MCPB distribution · Bundles server, addon, and prompts for desktop installation.
mcpb/manifest.json - Deployment services · Docker, Compose, and system service deployment options.
Dockerfile - Observability stack · Prometheus, Grafana, Loki, and Promtail provisioning.
monitoring/prometheus/prometheus.yml
Connections 21
- 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