Bonsai mcp
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.
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.
Bonsai-mcp is a fork of BlenderMCP that extends the original functionality with dedicated support for IFC (Industry Foundation Classes) models through Bonsai. This integration is a quick proof of concept aimed at exemplifying the capabilites of connecting Claude, or any LLM (though this was only tested using the Claude Desktop Client), to Blender in order to execute IfcOpenShell commands.
The system consists of two main components:
addon.py
): A Blender addon that creates a socket server within Blender to receive and execute commands, including IFC-specific operationsblender_mcp_tools.py
): A Python server that implements the Model Context Protocol and connects to the Blender addonInstalling uv:
Mac:
brew install uv
Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
set Path=C:Users[username].localin;%Path%
For other platforms, see the uv installation guide.
git clone https://github.com/JotaDeRodriguez/Bonsai_mcp
Edit your claude_desktop_config.json
file (Claude > Settings > Developer > Edit Config) to include:
{
"mcpServers": {
"Bonsai-mcp": {
"command": "uv",
"args": [
"--directory",
"yourpathtoBonsai_mcp",
"run",
"tools.py"
]
}
}
}
addon.py
file from this repoaddon.py
fileOnce connected, you'll see a hammer icon in Claude's interface with tools for the Blender MCP IFC integration.
This fork adds five powerful IFC-specific tools:
Get basic information about the IFC project, including name, description, and counts of different entity types.
Example: "What is the basic information about this IFC project?"
List IFC entities of a specific type (walls, doors, spaces, etc.).
Example: "List all the walls in this IFC model" or "Show me the windows in this building"
Get all properties of a specific IFC entity by its GlobalId.
Example: "What are the properties of this wall with ID 1Dvrgv7Tf5IfTEapMkwDQY?"
Get the spatial hierarchy of the IFC model (site, building, storeys, spaces).
Example: "Show me the spatial structure of this building"
Get all relationships for a specific IFC entity.
Example: "What are the relationships of the entrance door?"
Legacy feature from the original MCP implementation. Allows Claude to execute arbitrary Python code in Blender. Use with caution.
This integration also includes the Sequential Thinking tool, which facilitates a detailed, step-by-step thinking process for problem-solving and analysis.
thought
(string): The current thinking stepnextThoughtNeeded
(boolean): Whether another thought step is neededthoughtNumber
(integer): Current thought numbertotalThoughts
(integer): Estimated total thoughts neededisRevision
(boolean, optional): Whether this revises previous thinkingrevisesThought
(integer, optional): Which thought is being reconsideredbranchFromThought
(integer, optional): Branching point thought numberbranchId
(string, optional): Branch identifierneedsMoreThoughts
(boolean, optional): If more thoughts are neededExample: "Use sequential thinking to analyze this building's energy efficiency"
Here are some examples of what you can ask Claude to do with IFC models:
The IFC integration uses the Bonsai BIM module to access ifcopenshell functionality within Blender. The communication follows the same JSON-based protocol over TCP sockets as the original BlenderMCP.
execute_blender_code
tool from the original project is still available, allowing running arbitrary Python code in Blender. Use with caution and always save your work.Cursor implementation Add 'get_selected_ifc_elements' description