Skip to main content
Glama

🏗️ Revit MCP 服务器

用于 Revit 集成的模型上下文协议服务器,实现 Claude AI 和 Autodesk Revit 之间的无缝通信。

English |中文

🎯 概述

这款基于 TypeScript 的 MCP 服务器在 Claude AI 和 Revit 之间架起了一座桥梁,允许通过 WebSocket 连接直接与 Revit 模型交互。它实现了模型上下文协议 (MCP),从而实现以下功能:

  • ⚡ 实时访问 Revit 模型信息

  • 🔍 元素查询和过滤

  • 👀 视图和级别管理

  • 🛡️ 使用后备模拟数据进行强大的错误处理

Related MCP server: QGISMCP

✨ 特点

🔌 Revit 集成

  • 📡 基于 WebSocket 与 Revit 插件的通信

  • 🔄 实时模型数据访问

  • 🔁 连接失败时优雅地回退到模拟数据

  • ⚙️ 通过环境变量配置连接设置

🚀 核心功能

  • 📊 模型信息

    • 访问基本模型元数据(名称、路径、版本)

    • 获取元素计数和最后修改日期

    • 实时模型状态同步

  • 🏗️元素管理

    • 具有灵活过滤功能的查询元素

    • 访问元素属性和几何形状

    • 批量元素操作

  • 🎪 视图和级别控制

    • 列出所有可用视图

    • 访问级别信息

    • 浏览模型层次结构

💻 开发

📋 先决条件

  • Node.js(v14 或更高版本)

  • npm

  • Autodesk Revit(2023 或更高版本)

  • Revit WebSocket 插件(配套插件)

🔧 安装

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

⚙️ 配置

可以使用环境变量来配置服务器:

REVIT_HOST=127.0.0.1    # Revit plugin WebSocket host
REVIT_PORT=8080         # Revit plugin WebSocket port

🔗 与 Claude Desktop 集成

将服务器配置添加到 Claude Desktop:

视窗:

%APPDATA%/Claude/claude_desktop_config.json

配置格式:

{
  "mcpServers": {
    "revit-mcp-server": {
      "command": "D:/path/to/revit-mcp-server/build/index.js"
    }
  }
}

🐛 调试

用于调试 MCP 通信:

  1. 使用内置的 MCP 检查器:

npm run inspector
  1. 使用 Revit 插件监控 WebSocket 通信

  2. 检查服务器日志以了解连接和操作状态

⚠️ 错误处理

服务器实现了强大的错误处理:

  • Revit 连接失败时自动回退到模拟数据

  • 详细的错误日志记录

  • 优雅的连接恢复

📄 许可证

MIT 许可证

🤝 贡献

欢迎贡献代码!欢迎随时提交 Pull Request。

📬 联系方式

如果您有任何问题或建议,请随时联系我们:

Available Tools

6 tools
get_categoriesB

获取 Revit 模型中的所有类别

NameRequiredDescriptionDefault

No parameters

get_element_infoC

获取 Revit 元素的详细信息

NameRequiredDescriptionDefault
elementIdYes元素的 ID
getItemPropertyInfoNo是否获取元素属性信息
getItemParameterInfoNo是否获取元素参数信息
get_elementsC

获取 Revit 模型中的元素

NameRequiredDescriptionDefault
categoryIdsNo需要获取的元素所属类别的Id集合
viewIdsNo需要获取的元素所处的视图的Id集合
levelIdsNo需要获取的元素所处的标高的Id集合
get_familiesC

获取 Revit 模型中的所有族

NameRequiredDescriptionDefault
categoryIdNo族类别 ID(可选)
nameNo族名称过滤(可选)
get_levelsB

获取 Revit 模型中的所有楼层

NameRequiredDescriptionDefault

No parameters

get_viewsB

获取 Revit 模型中的所有视图

NameRequiredDescriptionDefault

No parameters

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updates
    • First observedget_categories
    • First observedget_element_info
    • First observedget_elements
    • First observedget_families
    • First observedget_levels
    • First observedget_views

TDQS

B3.2/5.0

Scored across 6 tools

Disambiguation5/5

Every tool has a clearly distinct purpose targeting different Revit model components: categories, element info, elements, families, levels, and views. There is no overlap in functionality, and an agent can easily distinguish between them based on the specific resource each retrieves.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with 'get_' as the prefix and a plural or singular noun describing the resource. This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming style.

Tool Count4/5

With 6 tools, the count is reasonable for a Revit model server, covering key retrieval operations. However, it might be slightly under-scoped as it lacks tools for creating, updating, or deleting elements, which could be expected in a full Revit integration.

Completeness2/5

The tool set is severely incomplete for a Revit domain, as it only provides read-only retrieval operations. There are significant gaps in CRUD coverage—no tools for creating, updating, or deleting elements, categories, families, etc., which will likely cause agent failures when trying to modify models.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Connects QGIS to Claude AI through the Model Context Protocol, enabling AI-assisted project creation, layer manipulation, processing algorithm execution, and Python code running within QGIS.
    7
    -
  • A
    license
    B
    quality
    D
    maintenance
    Connects Blender to Claude AI through the Model Context Protocol, enabling AI-assisted 3D modeling, scene creation, and manipulation through natural language commands.
    17
    2
    MIT
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI assistants like Claude to interact with Autodesk Construction Cloud Build platform for construction project management, including issues tracking, RFIs, submittals, and document management through natural language.
    -