Bonsai BIM (Blender IFC) MCP server

Connects Claude to Blender for analyzing and interacting with IFC building models through five specialized tools for querying project information, listing entities, examining properties, exploring spatial structures, and analyzing element relationships.
Back to servers
Setup instructions
Provider
Juan Rodriguez
Release date
Mar 23, 2025
Language
Python
Stats
29 stars

Bonsai-mcp is a powerful Model Context Protocol integration that enables Large Language Models (LLMs) to interact with IFC (Industry Foundation Classes) files through Blender. This tool allows for querying IFC models, analyzing spatial structures, examining building elements, and extracting quantities using eleven specialized IFC tools.

Installation Options

Prerequisites

  • Blender 4.0 or newer
  • Python 3.12 or newer
  • uv package manager
  • Bonsai BIM addon for Blender (for IFC functionality)

Installing the uv Package Manager

Mac:

brew install uv

Windows:

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
set Path=C:\Users\[username]\.local\bin;%Path%

For other platforms, see the uv installation guide.

Standard Installation

First, clone the repository:

git clone https://github.com/JotaDeRodriguez/Bonsai_mcp

Claude for Desktop Integration

Edit your claude_desktop_config.json file (Claude > Settings > Developer > Edit Config) to include:

{
    "mcpServers": {
        "Bonsai-mcp": {
            "command": "uv",
            "args": [
              "--directory",
              "\\your\\path\\to\\Bonsai_mcp",
              "run",
              "tools.py"
          ]
        }
    }
}

Docker Installation

# Clone the repository
git clone https://github.com/JotaDeRodriguez/Bonsai_mcp
cd Bonsai_mcp

# Build the Docker image
docker build -t bonsai_mcp .

# Run the container
docker run -p 8000:8000 --name bonsai_mcp bonsai_mcp

Verify the installation by accessing http://localhost:8000/docs in your browser, where you'll see the Swagger UI with all available endpoints.

Environment Variables for Docker

# Example with custom settings
docker run -p 8000:8000 \
  -e BLENDER_HOST=host.docker.internal \
  -e BLENDER_PORT=9876 \
  -e MCP_HOST=0.0.0.0 \
  -e MCP_PORT=8000 \
  --name bonsai_mcp bonsai_mcp

Installing the Blender Addon

  1. Download the addon.py file from the repository
  2. Open Blender
  3. Go to Edit > Preferences > Add-ons
  4. Click "Install..." and select the addon.py file
  5. Enable the addon by checking the box next to "Interface: Blender MCP - IFC"

Usage

Starting the Connection

  1. In Blender, go to the 3D View sidebar (press N if not visible)
  2. Find the "Blender MCP - IFC" tab
  3. Click "Connect to Claude"
  4. Make sure the MCP server is running

Using with Claude

Once connected, you'll see a hammer icon in Claude's interface with tools for the Blender MCP IFC integration.

IFC Tools

Bonsai-mcp includes multiple specialized IFC tools:

get_ifc_project_info

Retrieves basic information about the IFC project, including name, description, and entity counts.

Example: "What is the basic information about this IFC project?"

list_ifc_entities

Lists IFC entities of a specific type with filtering options.

Example: "List all the walls in this IFC model"

get_ifc_properties

Retrieves properties of a specific IFC entity by GlobalId or from selected objects.

Example: "What are the properties of this wall with ID 1Dvrgv7Tf5IfTEapMkwDQY?"

get_ifc_spatial_structure

Shows the spatial hierarchy of the IFC model (site, building, storeys, spaces).

Example: "Show me the spatial structure of this building"

get_ifc_relationships

Gets all relationships for a specific IFC entity.

Example: "What are the relationships of the entrance door?"

get_selected_ifc_entities

Retrieves information about IFC entities currently selected in Blender.

Example: "Tell me about the elements I've selected in Blender"

get_user_view

Captures the current Blender viewport as an image.

Example: "Show me what the user is currently seeing in Blender"

export_ifc_data

Exports IFC data to JSON or CSV, with filtering options.

Example: "Export all wall data to a CSV file"

place_ifc_object

Creates and positions IFC elements at specified coordinates.

Example: "Place a door at coordinates X:10, Y:5, Z:0 with 90 degrees rotation"

get_ifc_quantities

Calculates quantities for IFC elements.

Example: "Give me the area of all the walls in the building"

get_ifc_total_structure

Gets the complete hierarchical structure of the IFC model.

Example: "Show me the complete structure of this IFC model including all building elements organized by floor"

export_drawing_png

Exports 2D/3D drawings as PNG images.

Example: "Generate a floor plan PNG for the ground floor at 1920x1080 resolution"

get_ifc_georeferencing_info

Retrieves georeferencing information from IFC files.

Example: "What georeferencing information is available in this IFC model?"

georeference_ifc_model

Creates or updates georeferencing information in IFC models.

Example: "Georeference this IFC model using EPSG:4326 with coordinates at latitude 40.7589, longitude -73.9851"

export_bc3_budget

Exports a BC3 budget file based on the IFC model.

Example: "Generate a BC3 budget file in Spanish for this building model"

BC3 Budget Features

  • Automatic element categorization into structural elements, masonry, slabs, carpentry, installations, and furniture
  • Accurate measurements for different element types
  • Multi-language support (Spanish/English)
  • Hierarchical structure following IFC spatial hierarchy
  • Unit price database for common construction elements
  • Sorted measurements for easier review

Additional Tools

Sequential Thinking Tool

Facilitates structured problem-solving through step-by-step analysis.

Example: "Use sequential thinking to analyze this building's energy efficiency based on the IFC model"

Execute Blender Code

Executes Python code in Blender (use with caution).

Troubleshooting

  • Connection issues: Ensure Blender addon server is running and MCP server is configured in Claude
  • IFC model not loading: Verify Bonsai BIM addon installation and IFC file loading
  • Timeout errors: Try simplifying requests or breaking them into smaller steps

Docker-specific Issues

  • "Connection refused": Confirm Blender is running with the addon enabled
  • Performance concerns: For large IFC models, responses might be slower

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "Bonsai-mcp" '{"command":"uv","args":["--directory","\\your\\path\\to\\Bonsai_mcp","run","tools.py"]}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "Bonsai-mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "\\your\\path\\to\\Bonsai_mcp",
                "run",
                "tools.py"
            ]
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "Bonsai-mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "\\your\\path\\to\\Bonsai_mcp",
                "run",
                "tools.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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