Token导航 LogoToken导航TokenDH.com
Revit 2026 MCP Server logo
运维云端stdio官方级别未说明来源级核验

Revit 2026 MCP Server

MCP Server

用于Autodesk Revit 2026的模型上下文协议(MCP)服务器实现,通过标准化接口使AI助手能够与Revit项目交互。

工具数

51

提示词数

0

GitHub Stars

1

资源数

0
C#Claude云端部署Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

antonhofstader

提供方

antonhofstader

最后核验

2026/5/17 20:22

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

Revit 2026 MCP服务器

Autodesk Revit 2026的模型上下文协议(MCP)服务器实现,使Claude等AI助手能够通过标准化界面与Revit项目进行交互。

概述

此MCP服务器在AI助手和Autodesk Revit 2026之间提供了一座桥梁,允许自然语言查询和命令与BIM模型交互、提取数据、修改参数和自动化工作流程。

特性

  • 项目信息访问:查询项目元数据、统计信息和设置
  • 网元管理:按类别、类型或参数检索、筛选和查询元素
  • 参数控制:读取和写入元素参数(实例和类型)
  • 视图管理:创建视图、切换活动视图、创建明细表
  • 几何图形创建:创建墙、轴网、直线、曲线、样条曲线和点
  • 曲线操作:计算、变换、相交、克隆、反转、偏移曲线
  • 参考平面:创建和查询标注的参照平面
  • 图形覆盖:按元素/类别设置半色调、颜色、透明度和可见性
  • 导出功能:导出为IFC、DWG和其他格式
  • 高级过滤:使用复杂的筛选条件查询元素
  • 进度管理:创建计划、获取表格数据、修改筛选器和分组
  • 元素转换:移动、复制、镜像、旋转、创建阵列
  • 形状创建:创建几何形状(矩形、圆形、多边形)作为详图线、模型线或符号曲线
  • 家庭农场:在族和项目中添加/删除共享参数
  • 选择工具:获取/设置选择,交互式拾取对象、点、面、边
  • 任务对话框:显示带有按钮和命令链接的可自定义弹出对话框
  • 功能区UI:创建自定义功能区选项卡、面板、按钮、组合框和文本框
  • 批量族工具:在概念体量族中创建参照点、曲线、放样造型
  • 旋转形式:使用轴和轮廓曲线创建旋转几何体
  • 上限表格:使用NewFormByCap从点或线创建帽形
  • 挤压成型:使用方向向量创建拉伸形状,从曲线创建长方体行
  • 平面创建:使用世界XYZ坐标创建草图平面
  • 模型曲线:使用数学公式绘制直线、圆弧、正弦波、螺旋、螺旋
  • 分割表面:在具有UV网格分割的窗体上创建分割曲面
  • 线性尺寸:在墙、轴网、参照平面和图元之间创建尺寸标注
  • 径向尺寸:在圆弧和圆上创建半径和直径标注
  • 家庭实例:将族实例放置在点、主体、面和参照上
  • 家庭塑型:在族文档中创建拉伸、混合、旋转、扫掠、扫掠混合、放样造型、模型文字、洞口和符号曲线
  • MEP连接器:在族几何图形面上创建风管、管道、电气、电缆桥架和套管接头
  • 家庭经理:管理族类型、参数、公式、关联/解除关联图元参数,查询所有FamilyParameter属性
  • 申请材料:使用自动模板路径解析从模板创建新的族文档和项目文档

先决条件

  • Python 3.10
  • 已安装Autodesk Revit 2026
  • Windows操作系统(Revit API必需)
  • .NET Framework 8.0

安装

1.克隆存储库

git clone https://github.com/yourusername/revit-mcp-server.git
cd revit-mcp-server

2.创建虚拟环境

python -m venv venv
venv\Scripts\activate  # On Windows

3.安装依赖项

pip install -e .

4.配置Revit附加模块

将Revit插件文件复制到Revit插件文件夹:

copy revit_addin\*.* "%APPDATA%\Autodesk\Revit\Addins\2026\"

配置

MCP客户端配置

将此服务器添加到您的MCP客户端配置中(例如,Claude Desktop):

Windows(克劳德桌面): 编辑 %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "revit": {
      "command": "python",
      "args": [
        "C:\\path\\to\\revit-mcp-server\\revit_mcp_server.py"
      ]
    }
  }
}

macOS/Linux: 注意:由于Revit API的依赖关系,此服务器需要Windows。

Revit配置

服务器通过C#加载项与Revit通信。确保:

  1. Revit 2026正在运行
  2. MCP加载项已加载(选中“加载项”选项卡)
  3. 项目已打开

用法

启动服务器

python revit_mcp_server.py

服务器将:

  1. 尝试连接到正在运行的Revit实例
  2. 监听MCP协议消息
  3. 为连接的客户端提供资源和工具

可用资源

revit://project/info

返回当前项目信息,包括名称、编号、作者和状态。

revit://elements/all

列出活动项目中的所有元素,包括计数和类别。

revit://views/active

有关当前活动视图的信息。

revit://families/loaded

当前项目中加载的所有族。

可用工具

元素和项目工具

工具说明
get_elements_by_category检索特定类别的所有元素(墙、门、窗等)
get_element_parameters获取特定元素的所有参数和值
set_parameter_value修改元素的参数值
query_elements使用筛选器(类别、参数、类型、级别)查询元素
get_project_info获取项目基本信息
get_selected_elements在Revit UI中获取当前选定的图元
get_last_placed_element获取最近创建的元素
get_family_types通过可选过滤获取所有族类型/符号
get_instances获取一个族、类型或类别的所有实例
find_family_type按名称查找特定的族类型
find_elements使用各种搜索条件查找元素
modify_element修改图元参数、位置、旋转、翻转、固定

查看工具

工具说明
create_view创建新视图(楼层平面、剖面、立面、三维、明细表)
set_active_view切换到其他活动视图
select_view_type获取有关可用视图类型的信息
set_graphic_overrides设置半色调、颜色、透明度、可见性替代
create_schedule_view为类别创建明细表视图
get_table_data从明细表中获取表数据
modify_schedule修改计划筛选器、排序、分组

几何图形创建工具

工具说明
create_wall创建具有起点/终点和标高的墙
create_grid_line创建线性网格线
create_grid_arc创建弧形网格
create_bounded_line创建模型线
create_detail_line在活动视图中创建详图线
create_curves_from_points从点创建连接的模型曲线
create_hermite_spline从点创建Hermite样条线
create_hermite_spline_with_tangents使用端点切线创建Hermite样条线
create_point创建点元素
create_point_on_element在图元的几何图形上创建点
create_point_markup创建标记符号(十字、圆、正方形)
create_detail_shapes在视图中创建几何形状(矩形、圆形、多边形)作为详图线
create_model_shapes在3D中创建几何形状(矩形、圆形、多边形)作为模型线
create_symbolic_shapes在族中创建几何图形(矩形、圆形、多边形)作为符号线
create_reference_plane创建参照平面
get_reference_planes从模型或图元获取参照平面

曲线操作

工具说明
evaluate_curve在曲线上的参数处评估点
curve_distance_to_point获取点到曲线的最短距离
curve_get_end_point获取曲线的起点或终点
curve_get_end_parameter获取曲线末端的参数值
curve_get_end_point_reference获取曲线端点的稳定参考
create_clone_curve克隆曲线元素
create_offset_curve创建偏移曲线
curve_create_reversed创建反向曲线
curve_create_transformed创建变换曲线
curve_compute_closest_points计算两条曲线之间的最近点
curve_compute_derivatives计算参数的导数
curve_compute_normalized_parameter将原始参数转换为标准化参数
curve_compute_raw_parameter将标准化参数转换为原始参数
curve_intersect查找曲线之间的交点
curve_point_location_on_curve曲线上的投影点
calculate_line_direction计算直线的方向矢量

变换工具

工具说明
rotate_elements围绕轴旋转图元
transform_elements移动、复制、镜像或创建阵列

参数管理

工具说明
add_family_shared_parameter将共享参数添加到族中
remove_family_parameter从族中删除参数
get_family_parameters获取家族中的所有参数
add_project_shared_parameter将共享参数添加到项目中
remove_project_shared_parameter从项目中删除共享参数
get_project_shared_parameters获取项目中的所有共享参数

导出工具

工具说明
export_to_ifc将项目导出为IFC格式

交互式工具

工具说明
selection_tool选择操作:获取/设置/清除选择,拾取对象/点/面/边
task_dialog显示可自定义的弹出对话框

功能区UI工具

工具说明
ribbon_tool创建/管理功能区选项卡、面板、按钮、组合框、文本框

操作: create_tab, create_panel, create_push_button, create_split_button, create_pulldown_button, create_combo_box, create_text_box, create_stacked_items, list_tabs, list_panels, get_panel_items, get_image_folder, list_images

批量/自适应族工具

工具说明
family_points_tool在体量族中创建参照点、曲线和放样造型

操作:

  • create_single_point -创建单个参考点
  • create_point_row -创建一行点
  • create_point_grid -创建点网格
  • create_point_grid_formula -使用Z=f(x,y)公式创建网格
  • get_reference_points -列出所有参考点
  • delete_reference_points -删除参考点
  • create_curve_by_points -通过点创建曲线
  • create_curves_from_grid -从点栅格创建曲线
  • get_curves_by_points -列出所有CurveByPoints
  • create_loft_form -从曲线创建放样曲面
  • get_forms -列出所有表单
工具说明
revolve_tool使用轴和轮廓曲线创建旋转形状

操作:

  • create_axis_line -创建轴参照线
  • create_profile_curve -创建配置文件CurveByPoints
  • create_revolve -创建旋转形状
  • get_revolve_forms -列出所有表单
工具说明
cap_tool使用NewFormByCap从点或线创建帽形

操作:

  • create_cap_from_points -从XYZ点列表创建盖子(自动创建线条)
  • create_cap_from_lines -从现有模型线图元ID创建上限
  • get_cap_forms -列出所有表单
工具说明
extrusion_tool使用方向向量创建拉伸形状

操作:

  • create_extrusion_from_points -从具有方向的点创建拉伸
  • create_extrusion_from_lines -从具有方向的线ID创建拉伸
  • create_box_row_from_curves -从两条曲线创建具有高度的长方体行
  • get_extrusion_forms -列出所有表单
工具说明
plane_tool使用世界XYZ坐标创建草图平面

操作:

  • create_plane_by_normal -从原点和法向量创建平面
  • create_plane_by_three_points -通过三个点创建平面
  • create_xy_plane -在Z偏移处创建水平XY平面
  • create_xz_plane -在Y偏移处创建垂直XZ平面
  • create_yz_plane -在X偏移处创建垂直YZ平面
  • get_sketch_planes -列出所有草图平面
工具说明
model_curve_tool用直线、圆弧和数学公式绘制模型曲线

操作:

  • draw_line -在两点之间画一条直线
  • draw_arc -按中心/半径/角度或三个点绘制圆弧
  • draw_curve_by_points -通过参考点绘制样条曲线
  • draw_sine_wave -绘制z=振幅\*sin(频率\*x)
  • draw_cosine_wave -绘制z=振幅\*cos(频率\*x)
  • draw_spiral -绘制二维阿基米德螺旋(r=a+b\*theta)
  • draw_helix -绘制具有螺距和转弯的三维螺旋线
  • get_model_curves -列出所有模型曲线
工具说明
divided_surface_tool在造型面上创建分割曲面

操作:

  • create_divided_surface -从造型面创建分割曲面
  • set_uv_divisions -设置U和V分区计数
  • get_divided_surfaces -列出所有分割表面
  • get_forms -列出可用于分割表面的表格
工具说明
dimension_tool在项目或族中创建线性和径向尺寸标注

操作:

  • create_linear_dimension -在两个XYZ点之间创建尺寸
  • create_dimension_from_references -从元素引用创建维度
  • create_dimension_between_walls -两面墙之间的尺寸(中心/内/外表面)
  • create_dimension_between_grids -标注多条网格线
  • create_radial_dimension -在圆弧/圆上创建半径或直径标注
  • modify_dimension -设置值覆盖、文本上方/下方、前缀/后缀
  • get_dimension_types -列出可用的维度类型
  • get_dimensions -列出视图中的现有尺寸
工具说明
family_instance_tool使用各种方法放置族实例

操作:

  • place_at_point -放置在XYZ处,具有结构类型
  • place_at_point_in_view -在特定视图中放置在XYZ
  • place_on_host -放置在主体元素(墙/地板/天花板)上
  • place_on_host_with_direction -放置在带有方向矢量的主机上
  • place_along_line -沿直线放置在参考位置
  • place_along_line_in_view -在特定视图中沿线放置
  • place_on_face -用线条放在主人脸上
  • place_on_face_at_point -放在脸上有方向的点上
  • place_on_reference -放置在有方向的参考点上
  • get_family_symbols -列出可用的族类型
工具说明
family_modeling_tool在族文档(.rfa文件)中创建几何图形

操作:

  • new_extrusion -从轮廓点创建拉伸
  • new_blend -在底部和顶部轮廓之间创建混合
  • new_revolution -围绕轴创建旋转
  • new_sweep -沿路径曲线创建扫掠
  • new_swept_blend -创建具有不同轮廓的扫掠混合
  • new_loft_form -通过多个轮廓创建阁楼形状
  • new_form_by_cap -从轮廓曲线创建帽形
  • new_form_by_thicken -加厚表面形状
  • new_revolve_form -创建旋转形状(概念体量)
  • new_extrusion_form -创建具有方向的拉伸形状
  • new_swept_blend_form -创建扫掠混合形状
  • new_model_text -创建三维模型文本
  • new_opening -在几何图形中创建洞口
  • new_symbolic_curve -创建符号线/弧/圆
  • new_diameter_dimension -在圆弧上创建直径标注
  • get_forms -列出家庭中的所有表格
  • get_sketch_planes -列出所有草图平面
工具说明
connector_tool在族文档(.rfa文件)中创建MEP连接器

操作:

  • create_duct_connector -在平面上创建风管接头
  • create_pipe_connector -在平面上创建管道接头
  • create_electrical_connector -在平面上创建电气连接器
  • create_cable_tray_connector -在平面上创建电缆桥架连接器
  • create_conduit_connector -在平面上创建导管接头
  • change_host_reference -将连接器更改为其他面/边
  • get_connectors -列出系列中的所有连接器
工具说明
family_manager_tool管理族类型、参数、公式和图元参数关联

操作:

  • create_type -创建新的族类型
  • rename_type -重命名现有族类型
  • set_current_type -设置当前族类型
  • get_family_types -列出所有族类型
  • set_parameter_value -为族类型设置参数值
  • add_formula -将公式添加到族参数中
  • get_formula -获取族参数的公式
  • get_family_category -获取家庭类别
  • associate_element_parameter -将图元参数与族参数关联
  • dissociate_element_parameter -将图元参数与族参数分离
  • get_family_parameter_info -获取族参数的所有属性(存储类型、is_instance、is_shared、is_read_only、公式、guid、内置参数、当前值)
  • get_all_family_parameters -列出所有具有完整属性详细信息的族参数
工具说明
application_document_tool使用Application类从模板创建新的Revit文档

操作:

  • new_family_document -在C:\\ProgramData\\Autodesk\\RVT 2026\\族模板中使用自动模板路径搜索从模板(.rft)创建新的族文档
  • new_project_document -在C:\\ProgramData\\Autodesk\\RVT 2026\\Templates中使用自动模板路径搜索从模板(.rte)创建新的项目文档

______________________________________________________________________

示例用法

查询元素

# Get all walls
{"category": "Walls"}

# Get element parameters
{"element_id": "123456"}

创建几何体

# Create wall
{
  "start_x": 0, "start_y": 0,
  "end_x": 20, "end_y": 0,
  "level": "Level 1"
}

# Create spline
{
  "points": [
    {"x": 0, "y": 0, "z": 0},
    {"x": 5, "y": 2, "z": 0},
    {"x": 10, "y": 0, "z": 0}
  ]
}

大众家庭形式

# Create point grid with formula
{
  "operation": "create_point_grid_formula",
  "x": 0, "y": 0,
  "count_x": 10, "count_y": 10,
  "spacing_x": 1.0, "spacing_y": 1.0,
  "z_formula": "5*sin(x*0.5)*cos(y*0.5)"
}

# Create curves from grid and loft
{"operation": "create_curves_from_grid", "curve_direction": "rows"}
{"operation": "create_loft_form", "is_solid": true}

旋转形式

# Create axis
{
  "operation": "create_axis_line",
  "axis_start_x": 0, "axis_start_y": 0, "axis_start_z": 0,
  "axis_end_x": 0, "axis_end_y": 0, "axis_end_z": 10
}

# Create profile
{
  "operation": "create_profile_curve",
  "profile_points": [
    {"x": 2, "y": 0, "z": 0},
    {"x": 3, "y": 0, "z": 5},
    {"x": 2, "y": 0, "z": 10}
  ]
}

# Create revolve
{
  "operation": "create_revolve",
  "axis_line_id": 12345,
  "profile_curve_id": 12346,
  "start_angle": 0, "end_angle": 360
}

上限形式

# Create cap from points (auto-creates closed profile)
{
  "operation": "create_cap_from_points",
  "points": [
    {"x": 0, "y": 0, "z": 0},
    {"x": 10, "y": 0, "z": 0},
    {"x": 10, "y": 10, "z": 0},
    {"x": 0, "y": 10, "z": 0}
  ],
  "is_solid": true
}

挤压成型

# Create extrusion from points
{
  "operation": "create_extrusion_from_points",
  "points": [
    {"x": 0, "y": 0, "z": 0},
    {"x": 10, "y": 0, "z": 0},
    {"x": 10, "y": 10, "z": 0},
    {"x": 0, "y": 10, "z": 0}
  ],
  "direction_x": 0, "direction_y": 0, "direction_z": 15
}

# Create row of boxes with heights from curves
{
  "operation": "create_box_row_from_curves",
  "bottom_curve_id": 123456,
  "top_curve_id": 123457,
  "box_count": 10,
  "separation": 0.5,
  "box_width": 2.0
}

模型曲线

# Draw sine wave
{
  "operation": "draw_sine_wave",
  "amplitude": 3,
  "frequency": 0.5,
  "start_x": 0,
  "end_x": 30,
  "point_count": 60
}

# Draw helix
{
  "operation": "draw_helix",
  "radius": 5,
  "pitch": 2,
  "turns": 5,
  "point_count": 150
}

# Draw spiral
{
  "operation": "draw_spiral",
  "initial_radius": 1,
  "growth_rate": 0.3,
  "turns": 4
}

分割表面

# Get forms available
{"operation": "get_forms"}

# Create divided surface on form face
{
  "operation": "create_divided_surface",
  "form_id": 123456,
  "face_index": 0
}

# Set UV divisions
{
  "operation": "set_uv_divisions",
  "divided_surface_id": 123457,
  "u_divisions": 10,
  "v_divisions": 8
}

线性尺寸

# Create dimension between two walls
{
  "operation": "create_dimension_between_walls",
  "wall_id_1": 123456,
  "wall_id_2": 123457,
  "face": "center",
  "offset": 3
}

# Create dimension between grids
{
  "operation": "create_dimension_between_grids",
  "grid_ids": [123456, 123457, 123458],
  "offset": 5
}

# Create linear dimension from coordinates
{
  "operation": "create_linear_dimension",
  "start_x": 0, "start_y": 0, "start_z": 0,
  "end_x": 20, "end_y": 0, "end_z": 0,
  "offset": 2
}

# Modify dimension text
{
  "operation": "modify_dimension",
  "dimension_id": 123456,
  "value_override": "TYP",
  "above": "EQ",
  "prefix": "±"
}

# Get available dimension types
{"operation": "get_dimension_types"}

# Create radial dimension on arc
{
  "operation": "create_radial_dimension",
  "arc_element_id": 123456,
  "dimension_style": "radius"
}

# Create diameter dimension
{
  "operation": "create_radial_dimension",
  "arc_element_id": 123456,
  "dimension_style": "diameter",
  "location_x": 10, "location_y": 5, "location_z": 0
}

家庭实例

# Get available family types
{"operation": "get_family_symbols", "category": "Furniture"}

# Place family at point
{
  "operation": "place_at_point",
  "family_symbol_id": 123456,
  "x": 10, "y": 5, "z": 0,
  "structural_type": "NonStructural"
}

# Place family on host (wall, floor, etc.)
{
  "operation": "place_on_host",
  "family_symbol_id": 123456,
  "host_id": 789012,
  "x": 5, "y": 0, "z": 3
}

族建模(.rfa文件中)

# Create rectangular extrusion
{
  "operation": "new_extrusion",
  "profile_points": [
    {"x": 0, "y": 0, "z": 0},
    {"x": 10, "y": 0, "z": 0},
    {"x": 10, "y": 5, "z": 0},
    {"x": 0, "y": 5, "z": 0}
  ],
  "extrusion_end": 8,
  "is_solid": true
}

# Create blend between two profiles
{
  "operation": "new_blend",
  "bottom_profile_points": [
    {"x": 0, "y": 0, "z": 0},
    {"x": 10, "y": 0, "z": 0},
    {"x": 10, "y": 10, "z": 0},
    {"x": 0, "y": 10, "z": 0}
  ],
  "top_profile_points": [
    {"x": 2, "y": 2, "z": 10},
    {"x": 8, "y": 2, "z": 10},
    {"x": 8, "y": 8, "z": 10},
    {"x": 2, "y": 8, "z": 10}
  ],
  "is_solid": true
}

# Create revolution (lathe)
{
  "operation": "new_revolution",
  "profile_points": [
    {"x": 2, "y": 0, "z": 0},
    {"x": 3, "y": 0, "z": 5},
    {"x": 2, "y": 0, "z": 10}
  ],
  "axis_start_x": 0, "axis_start_y": 0, "axis_start_z": 0,
  "axis_end_x": 0, "axis_end_y": 0, "axis_end_z": 10,
  "start_angle": 0,
  "end_angle": 360,
  "is_solid": true
}

# Create model text
{
  "operation": "new_model_text",
  "text": "HELLO",
  "depth": 0.5,
  "x": 0, "y": 0, "z": 0,
  "horizontal_align": "center"
}

# Create opening in extrusion
{
  "operation": "new_opening",
  "host_element_id": 123456,
  "profile_points": [
    {"x": 2, "y": 2, "z": 0},
    {"x": 8, "y": 2, "z": 0},
    {"x": 8, "y": 3, "z": 0},
    {"x": 2, "y": 3, "z": 0}
  ]
}

# List forms in family
{"operation": "get_forms"}

# List sketch planes
{"operation": "get_sketch_planes"}

MEP连接器(.rfa文件中)

# Get available connectors in family
{"operation": "get_connectors"}

# Create duct connector on geometry face
{
  "operation": "create_duct_connector",
  "element_id": 123456,
  "face_index": 0,
  "system_type": "SupplyAir",
  "profile_type": "Round"
}

# Create pipe connector
{
  "operation": "create_pipe_connector",
  "element_id": 123456,
  "face_index": 1,
  "system_type": "SupplyHydronic"
}

# Create electrical connector
{
  "operation": "create_electrical_connector",
  "element_id": 123456,
  "face_index": 2,
  "system_type": "PowerCircuit"
}

# Create cable tray connector
{
  "operation": "create_cable_tray_connector",
  "element_id": 123456,
  "face_index": 0
}

# Create conduit connector with edge
{
  "operation": "create_conduit_connector",
  "element_id": 123456,
  "face_index": 0,
  "edge_index": 0
}

# Change connector to a different face
{
  "operation": "change_host_reference",
  "connector_id": 789012,
  "new_element_id": 123456,
  "new_face_index": 3
}

对话示例

查询项目数据:

  • 用户:“项目中有多少扇门?”
  • 克劳德使用 get_elements_by_category 分类为“门”的工具

修改元素:

  • 用户:“将101门的防火等级设置为2小时”
  • Claude按标记查询,然后使用 set_parameter_value

创建视图:

  • 用户:“创建一个名为‘HVAC系统’的三维视图”
  • 克劳德使用 create_view 工具

切换视图:

  • 用户:“切换到3D视图”
  • 克劳德使用 set_active_view view_type为“三维”的工具

创建墙:

  • 用户:“在1层创建一堵20米长的墙”
  • 克劳德使用 create_wall 带有坐标和水平的工具

获取项目信息:

  • 用户:“项目名称和作者是什么?”
  • 克劳德使用 get_project_info 工具

建筑

┌─────────────────┐
│   AI Assistant  │
│    (Claude)     │
└────────┬────────┘
         │ MCP Protocol (stdio)
┌────────▼────────┐
│   MCP Server    │
│   (Python)      │
└────────┬────────┘
         │ Named Pipe (RevitMCP)
┌────────▼────────┐
│  Revit Add-in   │
│     (C#)        │
└────────┬────────┘
         │ Revit API
┌────────▼────────┐
│  Revit 2026     │
└─────────────────┘

发展

运行测试

pytest tests/

代码格式化

black .
ruff check .

实施状态

已实施(50+工具)

  • MCP协议:具有命名管道通信的完整MCP服务器实现
  • 网元管理:查询、筛选、按类别、类型、参数查找元素
  • 参数控制:读/写实例和类型参数
  • 视图管理:创建视图、切换活动视图、明细表
  • 几何图形创建:墙、网格、线、曲线、样条曲线、点
  • 曲线操作:计算、变换、相交、偏移、克隆、反转曲线
  • 参考平面:创建和查询参照平面
  • 图形覆盖:颜色、透明度、半色调、可见性
  • 计划视图:创建计划、获取表格数据、修改筛选器/分组
  • 元素转换:移动、复制、旋转、镜像、阵列
  • 族参数:在族和项目中添加/删除共享参数
  • 选择工具:交互式拾取对象、点、面、边
  • 任务对话框:带有按钮和命令链接的可定制弹出对话框
  • 功能区UI:创建选项卡、面板、按钮、组合框、文本框
  • 批量族工具:参考点、曲线、带公式支撑的阁楼形式
  • 旋转形式:使用轴和轮廓曲线创建旋转几何体
  • 事务管理:所有操作都正确地包含在交易中
  • 错误处理:全面的错误处理和验证

实施

  1. 完整的IFC/DWG导出功能
  2. 维度创建工具
  3. 族实例放置工具
  4. 房间/空间边界工具
  5. 大型项目的性能优化

故障排除

服务器无法启动:

  • 验证Python 3.10+安装
  • 检查依赖关系: pip list
  • 测试pythonnet: python -c "import clr"

无法连接到Revit:

  • 确认Revit 2026正在运行
  • 验证加载项是否已加载
  • 检查加载项文件位置
  • 检查防火墙设置

许可证

MIT许可证-有关详细信息,请参阅许可证文件。

支持

  • 问题:GitHub问题
  • MCP文件:https://modelcontextprotocol.io
  • Revit API文档:https://www.revitapidocs.com/2026

目录标签

目录标签

C#Claude云端部署BIM自动化本地部署AI集成Revit插件建筑信息建模参数控制

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

51

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP