Blender MCP Server

local-only server

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

Integrations

  • Allows management and execution of Python scripts in a headless Blender environment, including creating 3D objects, analyzing scenes, and manipulating Blender projects through a scriptable interface.

  • Enables writing and executing Python scripts specifically for Blender automation, with support for tracking script metadata and capturing execution results.

Servidor MCP de Blender

Un servidor de Protocolo de Contexto de Modelo (MCP) para administrar y ejecutar scripts de Blender.

Características

  • Agregar, editar, ejecutar y eliminar scripts de Python de Blender
  • Ejecutar scripts en un entorno Blender sin interfaz gráfica
  • Ver resultados de ejecución y errores
  • Metadatos del script de seguimiento (fecha de creación, última modificación, número de ejecuciones)

Requisitos

  • Python 3.7+
  • Blender instalado y accesible
  • Biblioteca MCP ( pip install mcp )

Uso

  1. Iniciar el servidor:
    python server.py
  2. Conéctese al servidor mediante un cliente MCP (como Claude Desktop)
  3. Utilice las herramientas proporcionadas para administrar scripts:
    • add_script(name, content) - Agregar un nuevo script
    • edit_script(name, content) - Editar un script existente
    • execute_script(name, blend_file=None) - Ejecuta un script en Blender, especificando opcionalmente un archivo .blend
    • remove_script(name) - Eliminar un script
  4. Acceda a recursos para obtener información:
    • scripts://list - Obtener la lista de scripts disponibles
    • script://{name} - Obtener el contenido de un script específico
    • result://{name} - Obtener el resultado de la ejecución de un script

Ejemplos

Ejemplo básico

# 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

Trabajar con archivos Blend

# 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

Cómo funciona

  1. Cuando se agrega un script, se almacena en el directorio script_files/scripts
  2. Cuando se ejecuta, el script se ejecuta en una instancia de Blender sin cabeza.
    • Si se especifica un archivo de mezcla, Blender abrirá ese archivo antes de ejecutar el script
    • De lo contrario, se utiliza una escena de Blender vacía predeterminada.
  3. La salida y los errores se capturan y almacenan en el directorio script_files/results
  4. Los metadatos sobre los scripts se rastrean en script_files/metadata.json

Instalación

  1. Clonar este repositorio
  2. Instalar la biblioteca MCP: pip install mcp
  3. Asegúrese de que Blender esté instalado y sea accesible desde su PATH

Licencia

Instituto Tecnológico de Massachusetts (MIT)

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

Un servidor de protocolo de contexto de modelo que permite la gestión y ejecución de scripts de Python de Blender, permitiendo a los usuarios crear, editar y ejecutar scripts en un entorno de Blender sin cabeza a través de interfaces de lenguaje natural.

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