Skip to content
Back to search

mcp-servers-for-revit

πŸ”₯πŸ’§πŸ€– Sparx fork of the mcp-servers-for-revit/revit-mcp project

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mcp-servers-for-revit--mcp-servers-for-revit/badge.svg)](/listings/mcp-servers-for-revit--mcp-servers-for-revit)

HTML

<a href="/listings/mcp-servers-for-revit--mcp-servers-for-revit"><img src="/api/listings/mcp-servers-for-revit--mcp-servers-for-revit/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Download the ZIP for your Revit version from the [Releases](https://github.com/mcp-servers-for-revit/mcp-servers-for-revit/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](#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**

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md Β· README Β· 296 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![Cover Image](./assets/cover.png?v=2)](https://github.com/mcp-servers-for-revit/mcp-servers-for-revit)
  2. # mcp-servers-for-revit
  3. **Connect AI assistants to Autodesk Revit via the Model Context Protocol.**
  4. 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.
  5. > [!NOTE]
  6. > This is a fork of the original [revit-mcp](https://github.com/mcp-servers-for-revit/revit-mcp) project with additional tools and functionality improvements.
  7. ## Architecture
  8. ```mermaid
  9. flowchart LR
  10. Client["MCP Client<br/>(Claude, Cline, etc.)"]
  11. Server["MCP Server<br/><code>server/</code>"]
  12. Plugin["Revit Plugin<br/><code>plugin/</code>"]
  13. CommandSet["Command Set<br/><code>commandset/</code>"]
  14. Revit["Revit API"]
  15. Client <-->|stdio| Server
  16. Server <-->|WebSocket| Plugin
  17. Plugin -->|loads| CommandSet
  18. CommandSet -->|executes| Revit
  19. ```
  20. 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.
  21. ## Requirements
  22. - **Node.js 18+** (for the MCP server)
  23. - **Autodesk Revit 2020 - 2026** (any supported version)
  24. ## Quick Start (Using a Release)
  25. 1. Download the ZIP for your Revit version from the [Releases](https://github.com/mcp-servers-for-revit/mcp-servers-for-revit/releases) page (e.g., `mcp-servers-for-revit-v1.0.0-Revit2025.zip`)
  26. 2. Extract the ZIP and copy the contents to your Revit addins folder:
  27. ```
  28. %AppData%\Autodesk\Revit\Addins\<your Revit version>\
  29. ```
  30. After copying you should have:
  31. ```
  32. Addins/2025/
  33. β”œβ”€β”€ mcp-servers-for-revit.addin
  34. └── revit_mcp_plugin/
  35. β”œβ”€β”€ RevitMCPPlugin.dll
  36. β”œβ”€β”€ ...
  37. └── Commands/
  38. └── RevitMCPCommandSet/
  39. β”œβ”€β”€ command.json
  40. └── 2025/
  41. β”œβ”€β”€ RevitMCPCommandSet.dll
  42. └── ...
  43. ```
  44. 3. Configure the MCP server in your AI client (see [MCP Server Setup](#mcp-server-setup))
  45. 4. Start Revit β€” if prompted about an unknown add-in, click **Always Load**
  46. 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**
  47. ## MCP Server Setup
  48. The MCP server is published as an npm package and can be run directly with `npx`.
  49. **Claude Code**
  50. Run this in a **terminal** (not inside Claude Code):
  51. ```bash
  52. claude mcp add mcp-server-for-revit -- cmd /c npx -y mcp-server-for-revit
  53. ```
  54. **Claude Desktop**
  55. Claude Desktop β†’ Settings β†’ Developer β†’ Edit Config β†’ `claude_desktop_config.json`:
  56. ```json
  57. {
  58. "mcpServers": {
  59. "mcp-server-for-revit": {
  60. "command": "cmd",
  61. "args": ["/c", "npx", "-y", "mcp-server-for-revit"]
  62. }
  63. }
  64. }
  65. ```
  66. Restart Claude Desktop. When you see the hammer icon, the MCP server is connected.
  67. ![Claude Desktop connection](./assets/claude.png)
  68. ## Revit Plugin Setup
  69. If using a release ZIP, the plugin is already included. For manual installation:
  70. 1. Build the plugin from `plugin/` (see [Development](#development))
  71. 2. Copy `mcp-servers-for-revit.addin` to `%AppData%\Autodesk\Revit\Addins\<version>\`
  72. 3. Copy the `revit_mcp_plugin/` folder to the same addins directory
  73. ## Command Set Setup
  74. If using a release ZIP, the command set is pre-installed inside the plugin. For manual installation:
  75. 1. Build the command set from `commandset/` (see [Development](#development))
  76. 2. Inside the plugin's installation directory, create `Commands/RevitMCPCommandSet/<year>/`
  77. 3. Copy the built DLLs into that folder
  78. 4. Copy `command.json` (from repo root) into `Commands/RevitMCPCommandSet/`
  79. ## Supported Tools
  80. | Tool | Description |
  81. | ---- | ----------- |
  82. | `get_current_view_info` | Get current active view info |
  83. | `get_current_view_elements` | Get elements from the current active view |
  84. | `get_available_family_types` | Get available family types in current project |
  85. | `get_selected_elements` | Get currently selected elements |
  86. | `get_material_quantities` | Calculate material quantities and takeoffs |
  87. | `ai_element_filter` | Intelligent element querying tool for AI assistants |
  88. | `analyze_model_statistics` | Analyze model complexity with element counts |
  89. | `create_point_based_element` | Create point-based elements (door, window, furniture) |
  90. | `create_line_based_element` | Create line-based elements (wall, beam, pipe) |
  91. | `create_surface_based_element` | Create surface-based elements (floor, ceiling, roof) |
  92. | `create_grid` | Create a grid system with smart spacing generation |
  93. | `create_level` | Create levels at specified elevations |
  94. | `create_room` | Create and place rooms at specified locations |
  95. | `create_dimensions` | Create dimension annotations in the current view |
  96. | `create_structural_framing_system` | Create a structural beam framing system |
  97. | `delete_element` | Delete elements by ID |
  98. | `operate_element` | Operate on elements (select, setColor, hide, etc.) |
  99. | `color_elements` | Color elements based on a parameter value |
  100. | `tag_all_walls` | Tag all walls in the current view |
  101. | `tag_all_rooms` | Tag all rooms in the current view |
  102. | `export_room_data` | Export all room data from the project |
  103. | `store_project_data` | Store project metadata in local database |
  104. | `store_room_data` | Store room metadata in local database |
  105. | `query_stored_data` | Query stored project and room data |
  106. | `send_code_to_revit` | Send C# code to Revit to execute |
  107. | `say_hello` | Display a greeting dialog in Revit (connection test) |
  108. ## Testing
  109. The test project uses [Nice3point.TUnit.Revit](https://github.com/Nice3point/RevitUnit) to run integration tests against a live Revit instance. No separate addin installation is required β€” the framework injects into the running Revit process automatically.
  110. ### Prerequisites
  111. - **.NET 10 SDK** β€” required by Nice3point.Revit.Sdk 6.1.0. Install via `winget install Microsoft.DotNet.SDK.10`
  112. - **Autodesk Revit 2026** (or 2025) β€” must be installed and licensed on your machine
  113. ### Running Tests
  114. 1. Open Revit 2026 (or 2025) and wait for it to fully load
  115. 2. Run the tests from the command line:
  116. ```bash
  117. # For Revit 2026
  118. dotnet test -c Debug.R26 -r win-x64 tests/commandset
  119. # For Revit 2025
  120. dotnet test -c Debug.R25 -r win-x64 tests/commandset
  121. ```
  122. > **Note:** The `-r win-x64` flag is required on ARM64 machines because the Revit API assemblies are x64-only.
  123. Alternatively, you can use `dotnet run`:
  124. ```bash
  125. cd tests/commandset
  126. dotnet run -c Debug.R26
  127. ```
  128. ### IDE Support
  129. - **JetBrains Rider** β€” enable "Testing Platform support" in Settings > Build, Execution, Deployment > Unit Testing > Testing Platform
  130. - **Visual Studio** β€” tests should be discoverable through the standard Test Explorer
  131. ### Test Structure
  132. | Directory | Purpose |
  133. |-----------|---------|
  134. | `tests/commandset/AssemblyInfo.cs` | Global `[assembly: TestExecutor<RevitThreadExecutor>]` registration |
  135. | `tests/commandset/Architecture/` | Tests for level and room creation commands |
  136. | `tests/commandset/DataExtraction/` | Tests for model statistics, room data export, and material quantities |
  137. | `tests/commandset/ColorSplashTests.cs` | Tests for color override functionality |
  138. | `tests/commandset/TagRoomsTests.cs` | Tests for room tagging functionality |
  139. ### Writing New Tests
  140. Test classes inherit from `RevitApiTest` and use TUnit's async assertion API:
  141. ```csharp
  142. public class MyTests : RevitApiTest
  143. {
  144. private static Document _doc;
  145. [Before(HookType.Class)]
  146. [HookExecutor<RevitThreadExecutor>]
  147. public static void Setup()
  148. {
  149. _doc = Application.NewProjectDocument(UnitSystem.Imperial);
  150. }
  151. [After(HookType.Class)]
  152. [HookExecutor<RevitThreadExecutor>]
  153. public static void Cleanup()
  154. {
  155. _doc?.Close(false);
  156. }
  157. [Test]
  158. public async Task MyTest_Condition_ExpectedResult()
  159. {
  160. var elements = new FilteredElementCollector(_doc)
  161. .WhereElementIsNotElementType()
  162. .ToElements();
  163. await Assert.That(elements.Count).IsGreaterThan(0);
  164. }
  165. }
  166. ```
  167. ## Development
  168. ### MCP Server
  169. ```bash
  170. cd server
  171. npm install
  172. npm run build
  173. ```
  174. The server compiles TypeScript to `server/build/`. During development you can run it directly with `npx tsx server/src/index.ts`.
  175. ### Revit Plugin + Command Set
  176. 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:
  177. - **Revit 2020-2024**: .NET Framework 4.8 (`Release R20` through `Release R24`)
  178. - **Revit 2025-2026**: .NET 8 (`Release R25`, `Release R26`)
  179. 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.
  180. ## Project Structure
  181. ```
  182. mcp-servers-for-revit/
  183. β”œβ”€β”€ mcp-servers-for-revit.sln # Combined solution (plugin + commandset + tests)
  184. β”œβ”€β”€ command.json # Command set manifest
  185. β”œβ”€β”€ server/ # MCP server (TypeScript) - tools exposed to AI clients
  186. β”œβ”€β”€ plugin/ # Revit add-in (C#) - WebSocket bridge inside Revit
  187. β”œβ”€β”€ commandset/ # Command implementations (C#) - Revit API operations
  188. β”œβ”€β”€ tests/ # Integration tests (C#) - TUnit tests against live Revit
  189. β”œβ”€β”€ assets/ # Images for documentation
  190. β”œβ”€β”€ .github/ # CI/CD workflows, contributing guide, code of conduct
  191. β”œβ”€β”€ LICENSE
  192. └── README.md
  193. ```
  194. ## Releasing
  195. A single `v*` tag drives the entire release. The [release workflow](.github/workflows/release.yml) automatically:
  196. - Builds the Revit plugin + command set for Revit 2020-2026
  197. - Creates a GitHub release with `mcp-servers-for-revit-vX.Y.Z-Revit<year>.zip` assets
  198. - Publishes the MCP server to npm as [`mcp-server-for-revit`](https://www.npmjs.com/package/mcp-server-for-revit)
  199. To create a release:
  200. 1. Run the bump script (updates `server/package.json`, `server/package-lock.json`, and `plugin/Properties/AssemblyInfo.cs`, then commits and tags):
  201. ```powershell
  202. ./scripts/release.ps1 -Version X.Y.Z
  203. ```
  204. 2. Push to trigger the workflow:
  205. ```bash
  206. git push origin main --tags
  207. ```
  208. > [!NOTE]
  209. > npm publish uses [trusted publishing](https://docs.npmjs.com/trusted-publishers/) via OIDC β€” no npm token is required. Provenance attestation is generated automatically.
  210. ## Acknowledgements
  211. This project is a fork of the work by the [mcp-servers-for-revit](https://github.com/mcp-servers-for-revit) team. The original repositories:
  212. - [revit-mcp](https://github.com/mcp-servers-for-revit/revit-mcp) - MCP server
  213. - [revit-mcp-plugin](https://github.com/mcp-servers-for-revit/revit-mcp-plugin) - Revit plugin
  214. - [revit-mcp-commandset](https://github.com/mcp-servers-for-revit/revit-mcp-commandset) - Command set
  215. Thank you to the original authors for creating the foundation that this project builds upon.
  216. ## License
  217. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.