Bonsai-mcp
Bonsai-mcp - IfcOpenShell を介した IFC 向け Blender モデル コンテキスト プロトコル統合
Bonsai-mcpはBlenderMCPのフォークで、Bonsaiを介してIFC(Industry Foundation Classes)モデル専用のサポートを追加することで、オリジナルの機能を拡張しています。この統合は、Claude、あるいは任意のLLM(ただし、Claudeデスクトップクライアントのみでテスト済み)をBlenderに接続し、IfcOpenShellコマンドを実行する機能を確認することを目的とした、簡単な概念実証です。
特徴
IFC固有の機能: IFCモデルのクエリ、空間構造の解析、建物要素の検査
5 つの強力な IFC ツール: プロジェクト情報の検査、エンティティの一覧表示、プロパティの調査、空間構造の探索、関係の分析
シーケンシャル思考: 構造化された問題解決のためのmodelcontextprotocol/serversのシーケンシャル思考ツールが含まれています
オリジナルのBlenderMCP実装からのコード実行ツール:Blenderでオブジェクトを作成および変更し、マテリアルを適用し、Pythonコードを実行します
標準モデルでテスト済み: デフォルトの ifcopenshell ハウス モデル ( AC20-FZK-Haus.ifc ) で動作することを検証済み
Related MCP server: BlenderMCP
コンポーネント
このシステムは、次の 2 つの主要コンポーネントで構成されています。
Blenderアドオン(
addon.py) :IFC固有の操作を含むコマンドを受信して実行するためのソケットサーバーをBlender内に作成するBlenderアドオンMCP サーバー (
blender_mcp_tools.py) : モデルコンテキストプロトコルを実装し、Blender アドオンに接続する Python サーバー
インストール
前提条件
Blender 3.0以降
Python 3.10以降
UVパッケージマネージャー
Blender 用 Bonsai BIM アドオン (IFC 機能用)
uvのインストール:
マック:
brew install uvウィンドウズ:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
set Path=C:\Users\[username]\.local\bin;%Path%他のプラットフォームについては、 UV インストール ガイドを参照してください。
リポジトリをクローンする
git clone https://github.com/JotaDeRodriguez/Bonsai_mcpデスクトップ統合のクロード
claude_desktop_config.jsonファイル (Claude > 設定 > 開発者 > 構成の編集) を編集して、以下を追加します。
{
"mcpServers": {
"Bonsai-mcp": {
"command": "uv",
"args": [
"--directory",
"\\your\\path\\to\\Bonsai_mcp",
"run",
"tools.py"
]
}
}
}Blenderアドオンのインストール
このリポジトリから
addon.pyファイルをダウンロードしますブレンダーを開く
編集 > 設定 > アドオンに移動します
「インストール...」をクリックし、
addon.pyファイルを選択します。「インターフェース: Blender MCP - IFC」の横にあるボックスにチェックを入れてアドオンを有効にします。
使用法
接続の開始
Blenderで、3Dビューサイドバーに移動します(表示されていない場合はNを押します)
「Blender MCP - IFC」タブを見つけます
「クロードに接続」をクリック
MCPサーバーが稼働していることを確認してください
クロードと一緒に使う
接続すると、Claude のインターフェースに、Blender MCP IFC 統合用のツールとともにハンマー アイコンが表示されます。
IFCツール
このフォークは、5 つの強力な IFC 固有のツールを追加します。
1. get_ifc_project_info
名前、説明、さまざまなエンティティ タイプの数など、IFC プロジェクトに関する基本情報を取得します。
例: 「この IFC プロジェクトに関する基本情報は何ですか?」
2. list_ifc_entities
特定のタイプ(壁、ドア、スペースなど)の IFC エンティティを一覧表示します。
例: 「この IFC モデルのすべての壁を一覧表示する」または「この建物の窓を表示する」
3. get_ifc_properties
特定の IFC エンティティのすべてのプロパティを GlobalId で取得します。
例: 「ID 1Dvrgv7Tf5IfTEapMkwDQY のこの壁のプロパティは何ですか?」
4. get_ifc_spatial_structure
IFC モデルの空間階層 (サイト、建物、階、スペース) を取得します。
例:「この建物の空間構造を見せてください」
5. get_ifc_relationships
特定の IFC エンティティのすべての関係を取得します。
例:「玄関ドアの関係はどのようなものですか?」
Blenderコードを実行する
オリジナルのMCP実装からのレガシー機能です。ClaudeがBlender内で任意のPythonコードを実行できるようになります。注意して使用してください。
シーケンシャルシンキングツール
この統合には、問題解決と分析のための詳細なステップバイステップの思考プロセスを促進する Sequential Thinking ツールも含まれています。
ツールパラメータ:
thought(文字列): 現在の思考ステップnextThoughtNeeded(boolean): 別の思考ステップが必要かどうかthoughtNumber(整数):現在の思考番号totalThoughts(整数): 必要な推定総思考数isRevision(ブール値、オプション):これが以前の考えを修正するかどうかrevisesThought(整数、オプション): 再考されている考えbranchFromThought(整数、オプション): 分岐点の思考番号branchId(文字列、オプション): ブランチ識別子needsMoreThoughts(ブール値、オプション): さらに考えが必要な場合
例: 「この建物のエネルギー効率を連続的な思考で分析してください」
コマンド例
Claude に IFC モデルに関して依頼できる作業の例をいくつか示します。
「このIFCモデルを分析して、壁、ドア、窓がいくつあるか教えてください」
「この建物模型の空間構造を見せてください」
「このIFCモデル内のすべてのスペースとそのプロパティを一覧表示する」
「この建物のすべての構造要素を特定してください」
「この壁と他の要素との関係はどのようなものですか?」
「IFCモデルに基づいて、この建物のメンテナンス計画を段階的に作成してください。」
トラブルシューティング
接続の問題: Blenderアドオンサーバーが実行中であること、およびMCPサーバーがClaudeで設定されていることを確認してください。
IFCモデルが読み込まれない: Bonsai BIMアドオンがインストールされ、IFCファイルが読み込まれていることを確認してください
タイムアウトエラー: リクエストを簡素化するか、小さなステップに分割してみてください
技術的な詳細
IFC統合では、Bonsai BIMモジュールを使用してBlender内のifcopenshell機能にアクセスします。通信は、オリジナルのBlenderMCPと同じTCPソケット経由のJSONベースのプロトコルに従います。
制限事項とセキュリティに関する考慮事項
オリジナルプロジェクトの
execute_blender_codeツールは引き続き利用可能で、Blenderで任意のPythonコードを実行できます。注意して使用し、作業内容は必ず保存してください。複雑な IFC モデルでは、操作をより小さなステップに分割する必要がある場合があります。
IFC クエリのパフォーマンスは、モデルのサイズと複雑さによって異なります。
クレジット
Siddharth AhujaによるオリジナルBlenderMCP
modelcontextprotocol/serversのシーケンシャル思考ツール
BlenderのBonsai BIMアドオン上に構築されたIFC統合
やるべきこと
カーソル実装 'get_selected_ifc_elements' の説明を追加
Available Tools
17 toolsexecute_blender_codeC
Execute arbitrary Python code in Blender.
Parameters:
- code: The Python code to execute
Inputs: code (required).
export_bc3_budgetA
Export a BC3 budget file (FIEBDC-3/2016) based on the IFC model loaded in Blender.
This tool creates a complete construction budget in BC3 format by:
1. Extracting the complete IFC spatial structure (Project → Site → Building → Storey)
2. Extracting IFC quantities and measurements for all building elements
3. Converting to BC3 hierarchical format with IFC2BC3Converter:
- Generates budget chapters from IFC spatial hierarchy
- Groups building elements by type and categories defined in external JSON
- Assigns unit prices from language-specific JSON database
- Creates detailed measurements sorted alphabetically
4. Exports to BC3 file with windows-1252 encoding
Features:
- Multi-language support (Spanish/English) for descriptions and labels
- Automatic element categorization using external JSON configuration
- Optimized conversion with O(1) lookups and batch operations
- Detailed measurements with dimensions (units, length, width, height)
- Full FIEBDC-3/2016 format compliance
Configuration files (in resources/bc3_helper_files/):
- precios_unitarios.json / unit_prices.json: Unit prices per IFC type
- spatial_labels_es.json / spatial_labels_en.json: Spatial element translations
- element_categories.json: IFC type to category mappings
Args:
language: Language for the budget file ('es' for Spanish, 'en' for English). Default is 'es'.
Returns:
A confirmation message with the path to the generated BC3 file in the exports/ folder.
Inputs: language.
export_drawing_pngA
Export drawings as PNG images with custom resolution.
Creates a drawing, with the view type specified, of the IFC building at the specified
height above the floor level. Supports custom resolution for high-quality architectural drawings.
Args:
height_offset: Height in meters above the storey level for the camera position (default 0.5m)
view_type: Type of view - "top" for plan view, "front", "right" and "left" for elevation views, and "isometric" for 3D view
resolution_x: Horizontal resolution in pixels (default 1920, max recommended 4096)
resolution_y: Vertical resolution in pixels (default 1080, max recommended 4096)
storey_name: Specific storey name to add to the file name (if None, prints default in the file name)
output_path: Optional file path to save the PNG (if None, returns as base64 image)
Returns:
metadata and the path of the file image of the drawing at the specified resolution
Inputs: height_offset, view_type, resolution_x, resolution_y, +2 more.
export_ifc_dataB
Export IFC data to a file in JSON or CSV format.
This tool extracts IFC data and creates a structured export file. You can filter
by entity type and/or building level, and choose the output format.
Args:
entity_type: Type of IFC entity to export (e.g., "IfcWall") - leave empty for all entities
level_name: Name of the building level to filter by (e.g., "Level 1") - leave empty for all levels
output_format: "json" or "csv" format for the output file
Returns:
Confirmation message with the export file path or an error message
Inputs: entity_type, level_name, output_format, ctx.
generate_idsA
Creates an .ids file in Blender/Bonsai by calling the add-on handler 'generate_ids'.
Parameters:
- title (str): Title of the IDS.
- specs (list | JSON str): List of 'specs' containing 'applicability' and 'requirements'.
Each facet is a dict with at least a 'type' field ("Entity", "Attribute", "Property",
"Material", "Classification", "PartOf") and its corresponding attributes.
- description, author, ids_version, date_iso, purpose, milestone: IDS metadata fields.
- output_path (str): Full path to the .ids file to be created. If omitted, the add-on will generate a default name.
Returns:
- JSON (str) with the handler result: {"ok": bool, "output_path": "...", "message": "..."}
or {"ok": False, "error": "..."}
Inputs: title (required), specs (required), description, author, +5 more.
georeference_ifc_modelC
Georeferences the IFC currently opened in Bonsai/BlenderBIM by creating or updating IfcProjectedCRS and IfcMapConversion. Optionally updates IfcSite and writes the file to disk.
Inputs: crs_mode (required), epsg, crs_name, geodetic_datum, +19 more.
get_ifc_georeferencing_infoA
Checks whether the IFC currently opened in Bonsai/BlenderBIM is georeferenced
and returns the key georeferencing information.
Parameters
----------
include_contexts : bool
If True, adds a breakdown of the RepresentationContexts and operations.
Returns
--------
str (JSON pretty-printed)
{
"georeferenced": true|false,
"crs": {
"name": str|null,
"geodetic_datum": str|null,
"vertical_datum": str|null,
"map_unit": str|null
},
"map_conversion": {
"eastings": float|null,
"northings": float|null,
"orthogonal_height": float|null,
"scale": float|null,
"x_axis_abscissa": float|null,
"x_axis_ordinate": float|null
},
"world_coordinate_system": {
"origin": [x, y, z]|null
},
"true_north": {
"direction_ratios": [x, y]|null
},
"site": {
"local_placement_origin": [x, y, z]|null,
"ref_latitude": [deg, min, sec, millionth]|null,
"ref_longitude": [deg, min, sec, millionth]|null,
"ref_elevation": float|null
},
"contexts": [...], # only if include_contexts = true
"warnings": [ ... ] # Informational message
}
Notes
-----
- This tool acts as a wrapper: it sends the "get_ifc_georeferencing_info"
command to the Blender add-on. The add-on must implement that logic
(reading IfcProject/IfcGeometricRepresentationContext, IfcMapConversion,
TargetCRS, IfcSite.RefLatitude/RefLongitude/RefElevation, etc.).
- It always returns a JSON string with indentation for easier reading.
Inputs: include_contexts.
get_ifc_project_infoB
Get basic information about the IFC project, including name, description,
and counts of different entity types.
Returns:
A JSON-formatted string with project information
Inputs: no named parameters.
get_ifc_propertiesA
Get properties of IFC entities. Can be used to get properties of a specific entity by GlobalId,
or to get properties of all currently selected objects in Blender.
Args:
global_id: GlobalId of a specific IFC entity (optional if selected_only is True)
selected_only: If True, return properties for all selected objects instead of a specific entity
Returns:
A JSON-formatted string with entity information and properties
Inputs: global_id, selected_only.
get_ifc_quantitiesC
Extract and get basic qtos about the IFC project.
Returns:
A JSON-formatted string with project quantities information
Inputs: no named parameters.
get_ifc_relationshipsB
Get all relationships for a specific IFC entity.
Args:
global_id: GlobalId of the IFC entity
Returns:
A JSON-formatted string with all relationships the entity participates in
Inputs: global_id (required).
get_ifc_spatial_structureB
Get the spatial structure of the IFC model (site, building, storey, space hierarchy).
Returns:
A JSON-formatted string representing the hierarchical structure of the IFC model
Inputs: no named parameters.
get_ifc_total_structureA
Get the complete IFC structure including spatial hierarchy and all building elements.
This function extends the basic spatial structure to include building elements like walls,
doors, windows, columns, beams, etc. that are contained within each spatial element.
It provides a comprehensive view of how the building is organized both spatially and
in terms of its physical components.
Returns:
A JSON-formatted string representing the complete hierarchical structure of the IFC model
including spatial elements and their contained building elements, plus summary statistics
Inputs: no named parameters.
get_selected_ifc_entitiesA
Get IFC entities corresponding to the currently selected objects in Blender.
This allows working specifically with objects the user has manually selected in the Blender UI.
Returns:
A JSON-formatted string with information about the selected IFC entities
Inputs: no named parameters.
get_user_viewA
Capture and return the current Blender viewport as an image.
Shows what the user is currently seeing in Blender.
Focus mostly on the 3D viewport. Use the UI to assist in your understanding of the scene but only refer to it if specifically prompted.
Args:
max_dimension: Maximum dimension (width or height) in pixels for the returned image
compression_quality: Image compression quality (1-100, higher is better quality but larger)
Returns:
An image of the current Blender viewport
Inputs: no named parameters.
list_ifc_entitiesB
List IFC entities of a specific type. Can be filtered to only include objects
currently selected in the Blender UI.
Args:
entity_type: Type of IFC entity to list (e.g., "IfcWall")
limit: Maximum number of entities to return
selected_only: If True, only return information about selected objects
Returns:
A JSON-formatted string listing the specified entities
Inputs: entity_type, limit, selected_only.
place_ifc_objectB
Place an IFC object at a specified location with optional rotation.
This tool allows you to create and position IFC elements in the model.
The object is placed using the specified IFC type and positioned
at the given coordinates with optional rotation around the Z axis.
Args:
type_name: Name of the IFC element type to place (must exist in the model)
x: X-coordinate in model space
y: Y-coordinate in model space
z: Z-coordinate in model space
rotation: Rotation angle in degrees around the Z axis (default: 0)
Returns:
A message with the result of the placement operation
Inputs: type_name (required), x (required), y (required), z (required), +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools have distinct purposes with clear boundaries, such as export_bc3_budget for budget generation and get_ifc_georeferencing_info for georeferencing checks. However, some overlap exists between get_ifc_spatial_structure and get_ifc_total_structure, where the latter extends the former, potentially causing confusion about which to use for hierarchical data. Tools like get_ifc_properties and get_ifc_quantities are clearly differentiated by focusing on properties versus quantities.
Tool names follow a highly consistent verb_noun pattern throughout, using snake_case uniformly. Examples include execute_blender_code, export_bc3_budget, get_ifc_project_info, and list_ifc_entities. This predictability makes it easy for agents to understand and navigate the toolset without confusion from mixed naming conventions.
With 17 tools, the count is slightly high but reasonable for the domain of IFC/BIM modeling and Blender integration, which involves data extraction, export, visualization, and manipulation. Most tools serve specific functions like georeferencing, drawing export, or entity listing, though a few could potentially be consolidated (e.g., spatial structure tools) without losing functionality.
The toolset provides comprehensive coverage for IFC/BIM workflows, including data retrieval (e.g., get_ifc_project_info, get_ifc_properties), export functions (e.g., export_bc3_budget, export_drawing_png), spatial analysis (e.g., get_ifc_spatial_structure), and manipulation (e.g., place_ifc_object, georeference_ifc_model). It supports CRUD-like operations and lifecycle management, with no obvious gaps that would hinder agent performance in this domain.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
A Model Context Protocol server for Wix AI tools
MCP server giving Claude AI access to 22+ NYC public-record databases for real estate due diligence
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA server that integrates Blender with local AI models via the Model Context Protocol, allowing users to control Blender using natural language prompts for 3D modeling tasks.125MIT
- AlicenseBqualityDmaintenanceConnects Blender to Claude AI through the Model Context Protocol, enabling AI-assisted 3D modeling, scene creation, and manipulation through natural language commands.172MIT
- AlicenseBqualityDmaintenanceConnects Claude AI to Blender via the Model Context Protocol to enable prompt-assisted 3D modeling, scene creation, and object manipulation. It allows users to control Blender through natural language for tasks such as modifying materials, inspecting scenes, and executing custom Python code.22MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects AI language models with the Bonsai Blender add-on to read, create, and edit IFC models through high-level tool calls.70MIT