Skip to main content
Glama

Blender MCP Server

by cwahlfeldt

Blender MCP 服务器

用于管理和执行 Blender 脚本的模型上下文协议 (MCP) 服务器。

特征

  • 添加、编辑、执行和删除 Blender Python 脚本
  • 在无头 Blender 环境中执行脚本
  • 查看执行结果和错误
  • 跟踪脚本元数据(创建日期、上次修改、执行次数)

要求

  • Python 3.7+
  • Blender 已安装并可访问
  • MCP 库 ( pip install mcp )

用法

  1. 启动服务器:
    python server.py
  2. 使用 MCP 客户端(如 Claude Desktop)连接到服务器
  3. 使用提供的工具来管理脚本:
    • add_script(name, content) - 添加新脚本
    • edit_script(name, content) - 编辑现有脚本
    • execute_script(name, blend_file=None) - 在 Blender 中执行脚本,可选择指定 .blend 文件
    • remove_script(name) - 删除脚本
  4. 访问资源以获取信息:
    • scripts://list - 获取可用脚本列表
    • script://{name} - 获取特定脚本的内容
    • result://{name} - 获取脚本的执行结果

示例

基本示例

# 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

使用混合文件

# 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

工作原理

  1. 添加脚本后,它将存储在script_files/scripts目录中
  2. 执行时,脚本在无头 Blender 实例中运行
    • 如果指定了混合文件,Blender 将在运行脚本之前打开该文件
    • 否则,使用默认的空 Blender 场景
  3. 输出和错误被捕获并存储在script_files/results目录中
  4. 有关脚本的元数据在script_files/metadata.json中跟踪

安装

  1. 克隆此存储库
  2. 安装 MCP 库: pip install mcp
  3. 确保 Blender 已安装并可从 PATH 中访问

执照

麻省理工学院

-
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.

模型上下文协议服务器允许管理和执行 Blender Python 脚本,使用户能够通过自然语言界面在无头 Blender 环境中创建、编辑和运行脚本。

  1. 特征
    1. 要求
      1. 用法
        1. 示例
          1. 基本示例
          2. 使用混合文件
        2. 工作原理
          1. 安装
            1. 执照

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that allows execution of Python code within Daytona workspaces, providing a secure and isolated environment for executing and managing Python scripts.
                Last updated -
                1
                14
                Python
                Apache 2.0
                • Apple
              • -
                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
                F
                license
                -
                quality
                A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
                Last updated -
                1
                Python
                • Linux
                • Apple
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that integrates Claude with Blender, enabling users to analyze and interact with IFC (Industry Foundation Classes) building models through natural language commands.
                Last updated -
                9
                Python
                MIT License
                • Apple

              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