IFC模型查询服务

用于探索和查询IFC建筑模型的MCP服务器,支持动态加载模型和关系分析。

  • by Amixx
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Amixx/ifc-mcp

使用说明

国际金融公司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"]
    }
  }
}

聊天中的典型工作流程

  1. load_model(file_path="/absolute/path/to/model.ifc") (快速默认)
  2. get_model_summary()
  3. 使用工具按元素、空间、材质、属性或类型进行查询。

大多数工具也接受可选功能 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"]) 返回既没有空间包含也没有聚合父链接的元素。

许可证

麻省理工学院