Skip to main content
Glama

Blender MCP Server

by cwahlfeldt

Blender MCP Server

A Model Context Protocol (MCP) server for managing and executing Blender scripts.

Features

  • Add, edit, execute, and remove Blender Python scripts
  • Execute scripts in a headless Blender environment
  • View execution results and errors
  • Track script metadata (creation date, last modified, execution count)

Requirements

  • Python 3.7+
  • Blender installed and accessible
  • MCP library (pip install mcp)

Usage

  1. Start the server:
    python server.py
  2. Connect to the server using an MCP client (like Claude Desktop)
  3. Use the provided tools to manage scripts:
    • add_script(name, content) - Add a new script
    • edit_script(name, content) - Edit an existing script
    • execute_script(name, blend_file=None) - Execute a script in Blender, optionally specifying a .blend file
    • remove_script(name) - Remove a script
  4. Access resources to get information:
    • scripts://list - Get list of available scripts
    • script://{name} - Get content of a specific script
    • result://{name} - Get execution result of a script

Examples

Basic Example

# Add a simple script add_script("hello_cube", ''' import bpy # Clear existing objects bpy.ops.object.select_all(action='SELECT') bpy.ops.object.delete() # Create a cube bpy.ops.mesh.primitive_cube_add(size=2, location=(0, 0, 0)) print("Cube created!") ''') # Execute the script execute_script("hello_cube") # Get the result # Access using: result://hello_cube

Working with Blend Files

# Add a script that works with a blend file add_script("analyze_scene", ''' import bpy # Print information about the current scene print(f"Current Blender version: {bpy.app.version_string}") print(f"Current file: {bpy.data.filepath}") # List all objects in the scene print("\\nObjects in the scene:") for obj in bpy.data.objects: print(f" - {obj.name} ({obj.type})") ''') # Execute with a specific blend file execute_script("analyze_scene", blend_file="/path/to/your/project.blend") # Get the result # Access using: result://analyze_scene

How It Works

  1. When a script is added, it's stored in the script_files/scripts directory
  2. When executed, the script is run in a headless Blender instance
    • If a blend file is specified, Blender will open that file before running the script
    • Otherwise, a default empty Blender scene is used
  3. Output and errors are captured and stored in the script_files/results directory
  4. Metadata about scripts is tracked in script_files/metadata.json

Installation

  1. Clone this repository
  2. Install the MCP library: pip install mcp
  3. Ensure Blender is installed and accessible from your PATH

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

A Model Context Protocol server that allows management and execution of Blender Python scripts, enabling users to create, edit and run scripts in a headless Blender environment through natural language interfaces.

  1. Features
    1. Requirements
      1. Usage
        1. Examples
          1. Basic Example
          2. Working with Blend Files
        2. How It Works
          1. Installation
            1. License

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.
                Last updated -
                2
                Python
                MIT License
                • Apple
              • -
                security
                A
                license
                -
                quality
                A streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.
                Last updated -
                15
                Python
                MIT License
              • -
                security
                F
                license
                -
                quality
                A Python-based implementation of the Model Context Protocol that enables communication between a model context management server and client through a request-response architecture.
                Last updated -
                Python
                • Linux
                • Apple
              • -
                security
                A
                license
                -
                quality
                Model Context Protocol server to run Python code in a sandbox.
                Last updated -
                1,462
                11,434
                Python
                MIT License

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/cwahlfeldt/blender-mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server