Logo mcp-servers-for-revit

mcp-servers-for-revit

Tổ chức
mcp-servers-for-revit

🔥💧🤖 Sparx fork of the mcp-servers-for-revit/revit-mcp project

Nhà phát hànhmcp-servers-for-revit
Kho mãmcp-servers-for-revit
Ngôn ngữC#
Bản fork
142
Sao
339
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    mcp-servers-for-revit cung cấp các chức năng MCP cho các ứng dụng khách AI và tác nhân AI tương thích.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Mẫu cấu hình có thể sao chép ngay

    Dùng các đoạn cấu hình mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Mức độ quan tâm của cộng đồng đến kho mã

    339 sao và 142 bản fork từ kho mã được liên kết.

Cover Image

mcp-servers-for-revit

Connect AI assistants to Autodesk Revit via the Model Context Protocol.

mcp-servers-for-revit enables AI clients like Claude, Cline, and other MCP-compatible tools to read, create, modify, and delete elements in Revit projects. It consists of three components: a TypeScript MCP server that exposes tools to AI, a C# Revit add-in that bridges commands into Revit, and a command set that implements the actual Revit API operations.

[!NOTE] This is a fork of the original revit-mcp project with additional tools and functionality improvements.

Architecture

The MCP Server (TypeScript) translates tool calls from AI clients into WebSocket messages. The Revit Plugin (C#) runs inside Revit, listens for those messages, and dispatches them to the Command Set (C#), which executes the actual Revit API operations and returns results back up the chain.

Requirements

  • Node.js 18+ (for the MCP server)
  • Autodesk Revit 2020 - 2026 (any supported version)

Quick Start (Using a Release)

  1. Download the ZIP for your Revit version from the Releases page (e.g., mcp-servers-for-revit-v1.0.0-Revit2025.zip)

  2. Extract the ZIP and copy the contents to your Revit addins folder:

    %AppData%\Autodesk\Revit\Addins\<your Revit version>\

    After copying you should have:

    Addins/2025/
    ├── mcp-servers-for-revit.addin
    └── revit_mcp_plugin/
        ├── RevitMCPPlugin.dll
        ├── ...
        └── Commands/
            └── RevitMCPCommandSet/
                ├── command.json
                └── 2025/
                    ├── RevitMCPCommandSet.dll
                    └── ...
  3. Configure the MCP server in your AI client (see MCP Server Setup)

  4. Start Revit — if prompted about an unknown add-in, click Always Load

  5. In Revit, click the Settings button on the mcp-servers-for-revit ribbon tab, enable the commands you want to use, and click Save

MCP Server Setup

The MCP server is published as an npm package and can be run directly with npx.

Claude Code

Run this in a terminal (not inside Claude Code):

bash
claude mcp add mcp-server-for-revit -- cmd /c npx -y mcp-server-for-revit

Claude Desktop

Claude Desktop → Settings → Developer → Edit Config → claude_desktop_config.json:

json
{
    "mcpServers": {
        "mcp-server-for-revit": {
            "command": "cmd",
            "args": ["/c", "npx", "-y", "mcp-server-for-revit"]
        }
    }
}

Restart Claude Desktop. When you see the hammer icon, the MCP server is connected.

Claude Desktop connection

Revit Plugin Setup

If using a release ZIP, the plugin is already included. For manual installation:

  1. Build the plugin from plugin/ (see Development)
  2. Copy mcp-servers-for-revit.addin to %AppData%\Autodesk\Revit\Addins\<version>\
  3. Copy the revit_mcp_plugin/ folder to the same addins directory

Command Set Setup

If using a release ZIP, the command set is pre-installed inside the plugin. For manual installation:

  1. Build the command set from commandset/ (see Development)
  2. Inside the plugin's installation directory, create Commands/RevitMCPCommandSet/<year>/
  3. Copy the built DLLs into that folder
  4. Copy command.json (from repo root) into Commands/RevitMCPCommandSet/

Supported Tools

ToolDescription
get_current_view_infoGet current active view info
get_current_view_elementsGet elements from the current active view
get_available_family_typesGet available family types in current project
get_selected_elementsGet currently selected elements
get_material_quantitiesCalculate material quantities and takeoffs
ai_element_filterIntelligent element querying tool for AI assistants
analyze_model_statisticsAnalyze model complexity with element counts
create_point_based_elementCreate point-based elements (door, window, furniture)
create_line_based_elementCreate line-based elements (wall, beam, pipe)
create_surface_based_elementCreate surface-based elements (floor, ceiling, roof)
create_gridCreate a grid system with smart spacing generation
create_levelCreate levels at specified elevations
create_roomCreate and place rooms at specified locations
create_dimensionsCreate dimension annotations in the current view
create_structural_framing_systemCreate a structural beam framing system
delete_elementDelete elements by ID
operate_elementOperate on elements (select, setColor, hide, etc.)
color_elementsColor elements based on a parameter value
tag_all_wallsTag all walls in the current view
tag_all_roomsTag all rooms in the current view
export_room_dataExport all room data from the project
store_project_dataStore project metadata in local database
store_room_dataStore room metadata in local database
query_stored_dataQuery stored project and room data
send_code_to_revitSend C# code to Revit to execute
say_helloDisplay a greeting dialog in Revit (connection test)

Testing

The test project uses Nice3point.TUnit.Revit to run integration tests against a live Revit instance. No separate addin installation is required — the framework injects into the running Revit process automatically.

Prerequisites

  • .NET 10 SDK — required by Nice3point.Revit.Sdk 6.1.0. Install via winget install Microsoft.DotNet.SDK.10
  • Autodesk Revit 2026 (or 2025) — must be installed and licensed on your machine

Running Tests

  1. Open Revit 2026 (or 2025) and wait for it to fully load
  2. Run the tests from the command line:
bash
# For Revit 2026
dotnet test -c Debug.R26 -r win-x64 tests/commandset

# For Revit 2025
dotnet test -c Debug.R25 -r win-x64 tests/commandset

Note: The -r win-x64 flag is required on ARM64 machines because the Revit API assemblies are x64-only.

Alternatively, you can use dotnet run:

bash
cd tests/commandset
dotnet run -c Debug.R26

IDE Support

  • JetBrains Rider — enable "Testing Platform support" in Settings > Build, Execution, Deployment > Unit Testing > Testing Platform
  • Visual Studio — tests should be discoverable through the standard Test Explorer

Test Structure

DirectoryPurpose
tests/commandset/AssemblyInfo.csGlobal [assembly: TestExecutor<RevitThreadExecutor>] registration
tests/commandset/Architecture/Tests for level and room creation commands
tests/commandset/DataExtraction/Tests for model statistics, room data export, and material quantities
tests/commandset/ColorSplashTests.csTests for color override functionality
tests/commandset/TagRoomsTests.csTests for room tagging functionality

Writing New Tests

Test classes inherit from RevitApiTest and use TUnit's async assertion API:

csharp
public class MyTests : RevitApiTest
{
    private static Document _doc;

    [Before(HookType.Class)]
    [HookExecutor<RevitThreadExecutor>]
    public static void Setup()
    {
        _doc = Application.NewProjectDocument(UnitSystem.Imperial);
    }

    [After(HookType.Class)]
    [HookExecutor<RevitThreadExecutor>]
    public static void Cleanup()
    {
        _doc?.Close(false);
    }

    [Test]
    public async Task MyTest_Condition_ExpectedResult()
    {
        var elements = new FilteredElementCollector(_doc)
            .WhereElementIsNotElementType()
            .ToElements();

        await Assert.That(elements.Count).IsGreaterThan(0);
    }
}

Development

MCP Server

bash
cd server
npm install
npm run build

The server compiles TypeScript to server/build/. During development you can run it directly with npx tsx server/src/index.ts.

Revit Plugin + Command Set

Open mcp-servers-for-revit.sln in Visual Studio. The solution contains both the plugin and command set projects. Build configurations target Revit 2020-2026:

  • Revit 2020-2024: .NET Framework 4.8 (Release R20 through Release R24)
  • Revit 2025-2026: .NET 8 (Release R25, Release R26)

Building the solution automatically assembles the complete deployable layout in plugin/bin/AddIn <year> <config>/ - the command set is copied into the plugin's Commands/ folder as part of the build.

Project Structure

mcp-servers-for-revit/
├── mcp-servers-for-revit.sln    # Combined solution (plugin + commandset + tests)
├── command.json     # Command set manifest
├── server/          # MCP server (TypeScript) - tools exposed to AI clients
├── plugin/          # Revit add-in (C#) - WebSocket bridge inside Revit
├── commandset/      # Command implementations (C#) - Revit API operations
├── tests/           # Integration tests (C#) - TUnit tests against live Revit
├── assets/          # Images for documentation
├── .github/         # CI/CD workflows, contributing guide, code of conduct
├── LICENSE
└── README.md

Releasing

A single v* tag drives the entire release. The release workflow automatically:

  • Builds the Revit plugin + command set for Revit 2020-2026
  • Creates a GitHub release with mcp-servers-for-revit-vX.Y.Z-Revit<year>.zip assets
  • Publishes the MCP server to npm as mcp-server-for-revit

To create a release:

  1. Run the bump script (updates server/package.json, server/package-lock.json, and plugin/Properties/AssemblyInfo.cs, then commits and tags):

    powershell
    ./scripts/release.ps1 -Version X.Y.Z
  2. Push to trigger the workflow:

    bash
    git push origin main --tags

[!NOTE] npm publish uses trusted publishing via OIDC — no npm token is required. Provenance attestation is generated automatically.

Acknowledgements

This project is a fork of the work by the mcp-servers-for-revit team. The original repositories:

Thank you to the original authors for creating the foundation that this project builds upon.

License

MIT

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "mcp-servers-for-revit-mcp-servers-for-revit": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-servers-for-revit"
      ]
    }
  }
}

Dùng MCP mcp-servers-for-revit với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối mcp-servers-for-revit, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Thiết lập trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Thiết lập trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh thiết lập trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Để tiến trình tiếp tục chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Để tiến trình tiếp tục chạy trong cửa sổ Terminal khi bạn dùng các công cụ MCP.
3

Thêm mcp-servers-for-revit làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của mcp-servers-for-revit.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "mcp-servers-for-revit-mcp-servers-for-revit": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-servers-for-revit"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của mcp-servers-for-revit, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của mcp-servers-for-revit.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện trên TypingMind dùng các công cụ MCP đã bật với mô hình AI đã chọn
Bạn có thể dùng mcp-servers-for-revit giúp tôi làm việc này không?
mcp-servers-for-revit
Được. Tôi đọc rồi.
Đây là kết quả tôi tìm được bằng mcp-servers-for-revit.

Câu hỏi thường gặp

Máy chủ MCP mcp-servers-for-revit dùng để làm gì?

mcp-servers-for-revit là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP mcp-servers-for-revit với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng mcp-servers-for-revit với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP mcp-servers-for-revit với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối mcp-servers-for-revit, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP mcp-servers-for-revit với TypingMind?

mcp-servers-for-revit hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP mcp-servers-for-revit cung cấp những công cụ nào trong TypingMind?

mcp-servers-for-revit cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP mcp-servers-for-revit không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu mcp-servers-for-revit yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇