Bonsai-mcp is a specialized integration of the Model Context Protocol (MCP) that allows large language models to interact with IFC (Industry Foundation Classes) models through IfcOpenShell and Blender. This powerful tool enables you to query, analyze, and modify IFC files using natural language through Claude or other compatible AI assistants.
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.
Clone the repository:
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",
"\\your\\path\\to\\Bonsai_mcp",
"run",
"tools.py"
]
}
}
}
# 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
Once running, the container will expose the MCP tools as REST/OpenAPI APIs at http://localhost:8000
.
To verify your installation, navigate to http://localhost:8000/docs
in your browser to see the Swagger UI with all available endpoints.
# 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
http://localhost:8000
/openapi.json
addon.py
file from the repositoryaddon.py
fileHere are some examples of what you can ask Claude to do with IFC models:
This integration includes a Sequential Thinking tool for structured problem-solving and analysis. It facilitates a step-by-step thinking process for complex IFC model analysis or planning tasks.
Example: "Use sequential thinking to analyze this building's energy efficiency based on the IFC model"
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.
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"
]
}
}
}
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.
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.