使用说明
国际金融公司mcp
MCP服务器,用于探索和查询IFC(行业基础类)建筑模型。
安装
pip install ifc-mcp
ifc-mcp 必须在你的 PATH 适用于使用 command: "ifc-mcp".
which ifc-mcp
ifc-mcp --help
ifc-mcp --version
跑
启动一次并在聊天期间动态加载模型:
ifc-mcp serve
可选预加载:
ifc-mcp serve /absolute/path/to/model.ifc
HTTP传输:
ifc-mcp serve --transport http --port 8000
MCP客户端配置
{
"mcpServers": {
"ifc_mcp": {
"command": "ifc-mcp",
"args": ["serve"]
}
}
}
聊天中的典型工作流程
load_model(file_path="/absolute/path/to/model.ifc")(快速默认)get_model_summary()- 使用工具按元素、空间、材质、属性或类型进行查询。
大多数工具也接受可选功能 file_path 对于一次性查询。
默认情况下,几何体加载速度较慢。仅在需要时使用渴望模式:
- MCP工具:
load_model(file_path="...", with_geometry=true) - CLI预加载:
ifc-mcp serve /absolute/path/to/model.ifc --with-geometry - 会话状态:
get_loaded_model()包括geometry_loaded
关系工具
ifc-mcp 包括基于以下内容的元素关系工具 IfcRelContainedInSpatialStructure 和 IfcRelAggregates:
classify_elements_by_relation(file_path="/absolute/path/to/model.ifc")返回父级、子级和调查桶IfcElement记录。get_aggregate_relationships(file_path="/absolute/path/to/model.ifc")返回父母、子女和公寓的总和child_to_parent地图。find_orphans(file_path="/absolute/path/to/model.ifc", exclude_classes=["IfcOpeningElement"])返回既没有空间包含也没有聚合父链接的元素。