
用于 openBIM 的模型上下文协议(MCP)服务器
概览
一个用于处理建筑信息建模(BIM)文件的模型上下文协议(MCP)服务器。该服务器提供将IFC文件转换为片段格式、加载片段以及按类别查询BIM数据的工具。 - : 将行业基础类(IFC)文件转换为开放高效的片段格式 - : 加载并处理预转换的片段文件 - : 按类别(如墙壁、门、窗户)获取带有可配置属性和关系的BIM元素 将IFC文件转换为.frag格式,以实现高效的处理。 - inputPath(字符串):IFC 文件的完整转换路径- outputPath(字符串):完整路径,输出 .frags 文件将被保存 将 .frag 文件加载到内存中进行查询。 - filePath(字符串):.frag 文件的完整加载路径 从已加载的片段中获取指定IFC类别的元素。 - 类别(字符串):类别名称(例如:
概述(AI 翻译)
一个用于处理建筑信息建模(BIM)文件的模型上下文协议(MCP)服务器。该服务器提供将IFC文件转换为片段格式、加载片段以及按类别查询BIM数据的工具。
特色
- IFC 转换为片段转换:将行业基础类(IFC)文件转换为开放且高效的片段格式
- 片段加载:加载并处理预转换的片段文件
- 基于类别的查询:按类别(如墙壁、门、窗户)获取BIM元素,并可配置属性和关系
工具
convert-ifc-to-frag
将IFC文件转换为.frag格式,以实现高效的处理。
参数:
inputPath(字符串):IFC文件的完整转换路径outputPath(字符串):完整路径,输出的 .frags 文件将被保存
示例:
load-frag
将 .frag 文件加载到内存中进行查询。
参数:
filePath(字符串):.frag 文件的完整加载路径
fetch-elements-of-category
从已加载的片段中获取指定IFC类别的元素。
参数:
category(字符串):类别名称(例如,“IFCWALL”、“IFCDOOR”、“IFCWINDOW”)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Fragment MCP Server
A Model Context Protocol (MCP) server for working with Building Information Modeling (BIM) files. This server provides tools to convert IFC files to fragment format, load fragments, and query BIM data by category.
Features
- IFC to Fragment Conversion: Convert Industry Foundation Classes (IFC) files to the open and efficient fragment format
- Fragment Loading: Load and work with pre-converted fragment files
- Category-based Querying: Fetch BIM elements by category (e.g., walls, doors, windows) with configurable attributes and relations
Tools
convert-ifc-to-frag
Converts an IFC file to a .frag file format for efficient processing.
Parameters:
inputPath(string): Full path of the IFC file to convertoutputPath(string): Full path where the output .frags file will be saved
Example:
Input: /path/to/building.ifc
Output: /path/to/building.frag
load-frag
Loads a .frag file into memory for querying.
Parameters:
filePath(string): Full path of the .frag file to load
fetch-elements-of-category
Fetches elements of a specified IFC category from loaded fragments.
Parameters:
category(string): Category name (e.g., “IFCWALL”, “IFCDOOR”, “IFCWINDOW”)config(object): Configuration for fetching elements with the following structure:attributesDefault(boolean): Include default attributesattributes(array): List of specific attributes to includerelations(object): Relation configurationHasAssociations: Include association relationsIsDefinedBy: Include definition relations
Dependencies
@modelcontextprotocol/sdk: MCP server framework@thatopen/fragments: Fragment processing libraryweb-ifc: IFC file processingzod: Schema validation
Installation
- Install dependencies:
pnpm install
- Run the server:
node main.ts
Claude Desktop Integration
To use this MCP server with Claude Desktop, add the following configuration to your Claude Desktop settings file:
Configuration
- Open Claude Desktop settings
- Navigate to the MCP servers configuration
- Add the following JSON configuration:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/models/directory"
]
},
"bim": {
"command": "npx",
"args": [
"-y",
"tsx",
"/path/to/your/openbim-mcp/main.ts"
]
}
}
}
安装
npx -y @modelcontextprotocol/server-filesystem /path/to/your/models/directory配置
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/models/directory"
]
},
"bim": {
"command": "npx",
"args": [
"-y",
"tsx",
"/path/to/your/openbim-mcp/main.ts"
]
}
}
}