Blender MCP server

Integrates with Blender's Python API to enable natural language-driven 3D modeling, scene generation, and animation scripting within the Blender environment.
Back to servers
Provider
Christopher Wahlfeldt
Release date
Mar 03, 2025
Language
Python
Stats
7 stars

This MCP server allows you to manage and execute Blender Python scripts remotely through the Model Context Protocol. You can add, edit, execute, and remove scripts, with all execution happening in a headless Blender environment.

Requirements

  • Python 3.7+
  • Blender installed and accessible
  • MCP library

Installation

  1. Clone the repository to your local machine
  2. Install the required MCP library:
pip install mcp
  1. Ensure Blender is installed and accessible from your system PATH

Starting the Server

To start the MCP server, run:

python server.py

The server will start and wait for connections from MCP clients, such as Claude Desktop.

Managing Scripts

Adding Scripts

To add a new script to the server:

add_script("script_name", "script_content")

For example:

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!")
''')

Editing Scripts

To modify an existing script:

edit_script("script_name", "new_content")

Executing Scripts

Execute scripts in Blender with:

execute_script("script_name")

You can optionally specify a Blender file to use:

execute_script("script_name", blend_file="/path/to/your/project.blend")

Removing Scripts

To delete a script from the server:

remove_script("script_name")

Accessing Resources

The server provides several resource endpoints:

  • scripts://list - Get a list of all available scripts
  • script://{name} - Get the content of a specific script
  • result://{name} - Get the execution result of a script

Usage Examples

Creating a Simple Scene

# Add a script that creates a cube
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")

# View the result
# Access using: result://hello_cube

Analyzing an Existing Blend File

# Add a script that analyzes scene contents
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")

# View the analysis results
# Access using: result://analyze_scene

How It Works

When you execute a script:

  1. The server runs a headless Blender instance
  2. If specified, it opens your blend file
  3. It runs your Python script within the Blender environment
  4. It captures all output and errors
  5. Results are stored and can be accessed through the result:// endpoint

All scripts are stored in the script_files/scripts directory, with results in script_files/results and metadata in script_files/metadata.json.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later