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
23 stars

Bonsai-mcp integrates the Model Context Protocol with IFC models through IfcOpenShell and Blender, allowing AI language models to read and modify IFC files. This specialized server provides tools for querying IFC models, analyzing spatial structures, and extracting building information.

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

  1. Clone the repository:
git clone https://github.com/JotaDeRodriguez/Bonsai_mcp
  1. For Claude for Desktop integration, edit your claude_desktop_config.json file (Claude > Settings > Developer > Edit Config):
{
    "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 installation by navigating to http://localhost:8000/docs in your browser.

Docker Environment Variables

# 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

Setting Up 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

Working with IFC Tools

Bonsai-mcp includes eleven specialized IFC tools:

get_ifc_project_info

Retrieves basic information about the IFC project.

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

list_ifc_entities

Lists IFC entities of a specific type.

Example: "List all the walls in this IFC model" or "Show me the windows in this building"

get_ifc_properties

Retrieves properties of a specific IFC entity.

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

get_ifc_spatial_structure

Gets the spatial hierarchy of the IFC model.

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

get_ifc_relationships

Retrieves relationships for a specific IFC entity.

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

get_selected_ifc_entities

Gets information about currently selected IFC entities.

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 a structured file format.

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

place_ifc_object

Creates and positions an IFC element in the model.

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

get_ifc_quantities

Calculate quantities for IFC elements.

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

export_drawing_png

Exports 2D and 3D drawings as high-resolution PNG images.

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

Additional Features

Sequential Thinking Tool

Facilitates step-by-step thinking process for complex IFC model analysis.

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

Execute Blender Code

Allows execution of arbitrary Python code in Blender (use with caution).

MCP Resources and Prompts

Includes specialized resources like file://table_of_contents.md and prompts for report generation.

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: Simplify requests or break them into smaller steps

Docker Issues:

  • "Connection refused" errors: Check if Blender is running with the addon enabled
  • CORS issues: Verify client CORS settings
  • Performance concerns: For large IFC models, consider adjusting timeouts in your client

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