Cutom Revit MCP Server
No description available
Ask AI about Cutom Revit MCP Server
Powered by Claude Β· Grounded in docs
I know everything about Cutom Revit MCP Server. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Revit MCP Server
Control Autodesk Revit through natural language using Claude AI. This project implements a Model Context Protocol (MCP) server that bridges Claude Desktop and Revit 2023, enabling AI-driven BIM operations through 61 tools.
Ask Claude "list all walls", "create a sheet with building elevations", or "count doors by level" and it executes directly in your Revit model.
Architecture
Claude Desktop ββ(stdio/MCP)βββΊ TypeScript MCP Server ββ(HTTP :8080)βββΊ C# Revit Plugin βββΊ Revit API
| Component | Language | Role |
|---|---|---|
| MCP Server | TypeScript / Node.js | Translates MCP tool calls from Claude Desktop into HTTP requests |
| Revit Plugin | C# / .NET Framework 4.8 | Receives HTTP requests and executes Revit API operations on the main thread |
The C# plugin uses the ExternalEvent pattern for thread-safe Revit API access. An HttpListener on localhost:8080 receives tool requests, queues them via ExternalEvent, and waits for the result.
Prerequisites
- Autodesk Revit 2023 (installed at default path
C:\Program Files\Autodesk\Revit 2023\) - Node.js v18+ (download)
- .NET Framework 4.8 Developer Pack (download)
- Claude Desktop (download)
Project Structure
revit-mcp-server/
βββ RevitPlugin/ # C# Revit Add-in
β βββ App.cs # Plugin entry point (IExternalApplication)
β βββ HttpServer.cs # HTTP server on localhost:8080
β βββ ExternalEventHandler.cs # Thread-safe Revit API execution
β βββ ToolRouter.cs # Routes tool names to handlers
β βββ RevitMcpPlugin.csproj # .NET project file
β βββ RevitMcpPlugin.addin # Revit add-in manifest
β βββ Tools/
β β βββ QueryTools.cs # get_elements, find_elements, quantities
β β βββ ElementTools.cs # create/delete/move/copy elements
β β βββ ParameterTools.cs # get/set parameter values
β β βββ ViewTools.cs # manage views, duplicate, filters
β β βββ SheetTools.cs # create sheets, place viewports
β β βββ SelectionTools.cs # select elements by criteria
β β βββ VisibilityTools.cs # hide/isolate/unhide elements
β β βββ LevelGridTools.cs # levels, grids, rename elements
β β βββ MEPTools.cs # panel schedules, conduit QA, room contents
β β βββ AnnotationTools.cs # tags, duplicate tag detection
β β βββ ProjectTools.cs # categories list, warnings
β βββ Helpers/
β βββ CategoryHelper.cs # Category name resolution (60+ aliases)
β βββ UnitHelper.cs # Unit conversions (mm/m/ft/in)
β βββ JsonHelper.cs # Element-to-JSON serialization
β
βββ mcp-server/ # TypeScript MCP Server
β βββ package.json
β βββ tsconfig.json
β βββ .env.example
β βββ src/
β βββ index.ts # Entry point
β βββ server.ts # MCP server setup + tool registration
β βββ revit-client.ts # HTTP client for Revit plugin
β βββ types.ts # TypeScript interfaces
β βββ tools/
β βββ query-tools.ts # Element query tools
β βββ element-tools.ts # Element creation/modification tools
β βββ parameter-tools.ts # Parameter tools
β βββ view-tools.ts # View management tools
β βββ sheet-tools.ts # Sheet management tools
β βββ selection-tools.ts # Selection tools
β βββ visibility-tools.ts # Visibility tools
β βββ level-grid-tools.ts # Level/grid tools
β βββ mep-tools.ts # MEP tools
β βββ annotation-tools.ts # Annotation tools
β βββ project-tools.ts # Project-wide tools
β
βββ README.md
Setup Instructions
Step 1: Build the C# Revit Plugin
- Open a terminal and navigate to the
RevitPluginfolder:
cd RevitPlugin
- Restore NuGet packages and build:
dotnet restore
dotnet build -c Release
Note: The
.csprojreferences Revit API DLLs fromC:\Program Files\Autodesk\Revit 2023\. If your Revit is installed elsewhere, update the<HintPath>entries inRevitMcpPlugin.csproj.
- The build output will be in
RevitPlugin\bin\Release\:RevitMcpPlugin.dllNewtonsoft.Json.dll
Step 2: Deploy the Revit Plugin
Copy three files to the Revit 2023 add-ins folder:
# Create target folder variable
set ADDIN_DIR=%APPDATA%\Autodesk\Revit\Addins\2023
# Copy the add-in manifest
copy RevitPlugin\RevitMcpPlugin.addin "%ADDIN_DIR%\"
# Copy the built DLLs
copy RevitPlugin\bin\Release\RevitMcpPlugin.dll "%ADDIN_DIR%\"
copy RevitPlugin\bin\Release\Newtonsoft.Json.dll "%ADDIN_DIR%\"
After copying, the folder should contain:
%APPDATA%\Autodesk\Revit\Addins\2023\
βββ RevitMcpPlugin.addin
βββ RevitMcpPlugin.dll
βββ Newtonsoft.Json.dll
Step 3: Install MCP Server Dependencies
cd mcp-server
npm install
Step 4: Build the MCP Server
cd mcp-server
npx tsc
This compiles TypeScript to JavaScript in the mcp-server/dist/ folder.
Step 5: Configure Claude Desktop
Open the Claude Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json
Add the revit entry under mcpServers:
{
"mcpServers": {
"revit": {
"command": "node",
"args": [
"C:\\FULL\\PATH\\TO\\github_revit_MCP_server\\mcp-server\\dist\\index.js"
],
"env": {
"REVIT_HOST": "localhost",
"REVIT_PORT": "8080"
}
}
}
}
Important: Replace
C:\\FULL\\PATH\\TO\\with the actual absolute path to your project folder. Use double backslashes\\in JSON.
Step 6: Launch
-
Start Revit 2023 and open a project. The plugin will automatically load and start the HTTP server on port 8080. You should see a confirmation dialog.
-
Restart Claude Desktop so it picks up the new MCP server configuration.
-
Start chatting! Open a new conversation in Claude Desktop and try:
- "List all walls in the model"
- "Get project information"
- "Count all doors grouped by type"
- "Create a new sheet A-501 called Building Elevations"
Verify the Connection
You can verify each component independently:
Check the Revit Plugin HTTP server:
curl http://localhost:8080/health
Expected response:
{
"success": true,
"status": "running",
"revitConnected": true,
"documentName": "YourProject.rvt",
"serverVersion": "1.0.0"
}
Test a tool call directly:
curl -X POST http://localhost:8080/execute -H "Content-Type: application/json" -d "{\"tool\": \"get_project_info\", \"parameters\": {}}"
Available Tools (61)
Query Tools (10)
| Tool | Description |
|---|---|
get_elements | Get elements by category with pagination |
get_element_parameters | Get all parameters for an element |
find_elements_by_parameter | Find elements matching a parameter value |
calculate_quantities | Calculate area, length, volume takeoffs |
count_elements_by_category | Count elements in one or all categories |
count_elements_by_family | Count elements grouped by family and type |
get_element_by_id | Get detailed info for a single element |
get_element_room | Find which room contains an element |
get_project_info | Get project metadata |
export_schedule_data | Export Revit schedule as JSON |
Element Tools (8)
| Tool | Description |
|---|---|
create_wall | Create a wall between two points |
create_floor | Create a floor from boundary points |
create_room | Create a room at a point on a level |
create_family_instance | Place a family instance (door, window, furniture) |
delete_elements | Delete elements by IDs |
move_element | Move an element by a translation vector |
rotate_element | Rotate an element by degrees |
copy_element | Copy an element to a new location |
Parameter Tools (4)
| Tool | Description |
|---|---|
get_parameter_value | Get a specific parameter value |
set_parameter_value | Set a parameter value |
get_parameter_names | List all parameters on an element |
batch_set_parameters | Set same parameter on multiple elements |
View Tools (6)
| Tool | Description |
|---|---|
get_views | List all views, filter by type |
get_active_view | Get the currently active view |
activate_view | Switch to a different view |
duplicate_view | Duplicate a view |
create_dependent_view | Create a dependent view |
get_view_filters | List filters applied to a view |
Sheet Tools (6)
| Tool | Description |
|---|---|
get_sheets | List all sheets with viewports |
create_sheet | Create a new sheet |
place_view_on_sheet | Place a view on a sheet |
get_sheet_viewports | List viewports on a sheet |
rename_sheet | Rename a sheet |
duplicate_and_place_view | Duplicate a view and place it on a sheet in one step |
Selection Tools (8)
| Tool | Description |
|---|---|
get_current_selection | Get currently selected elements |
select_elements_by_ids | Select elements by their IDs |
select_all_by_category | Select all elements of a category |
select_elements_by_level | Select elements on a specific level |
select_by_parameter_value | Select elements matching a parameter |
select_and_hide_category | Select and hide a category |
select_and_isolate_category | Isolate a category |
clear_selection | Clear the current selection |
Visibility Tools (6)
| Tool | Description |
|---|---|
hide_elements_by_category | Hide all elements of a category |
unhide_elements_by_category | Unhide a hidden category |
isolate_elements_by_category | Temporarily isolate a category |
isolate_elements_by_selection | Isolate the current selection |
unhide_all | Reset all hide/isolate in active view |
unisolate_all | Reset temporary isolation |
Level & Grid Tools (4)
| Tool | Description |
|---|---|
get_levels | List all levels with elevations |
get_grids | List all grids |
create_level | Create a new level |
rename_elements | Batch rename elements |
MEP Tools (5)
| Tool | Description |
|---|---|
get_panel_schedules | Get electrical panel schedules |
calculate_conduit_bends | Analyze conduit bend calculations |
conduit_qa_check | QA check on conduit systems |
analyze_wall_lengths_by_level | Wall lengths/areas grouped by level |
get_elements_in_room | Find elements within a room |
Annotation Tools (4)
| Tool | Description |
|---|---|
create_tag | Tag an element in the active view |
tag_all_in_view | Auto-tag all untagged elements of a category |
find_duplicate_tags | Find elements with multiple tags |
get_element_orientation | Get facing direction of an element |
Project Tools (2)
| Tool | Description |
|---|---|
get_all_categories | List all categories with element counts |
get_warnings | Get all Revit warnings/errors |
Adapting for Other Revit Versions
This project targets Revit 2023 (.NET Framework 4.8). To adapt for other versions:
Revit 2024+ (.NET Framework 4.8)
- Update
<HintPath>in.csprojto point to Revit 2024 installation - Deploy to
%APPDATA%\Autodesk\Revit\Addins\2024\ - API should be mostly compatible
Revit 2025+ (.NET 8)
- Change
<TargetFramework>in.csprojfromnet48tonet8.0-windows - Update
<HintPath>to Revit 2025 installation path - Replace deprecated API calls (some
SpecTypeIdpatterns may differ) - Deploy to
%APPDATA%\Autodesk\Revit\Addins\2025\
Troubleshooting
"Server disconnected" in Claude Desktop
- Check the MCP log: Open
%APPDATA%\Claude\logs\mcp-server-revit.log - Common fix: Make sure you built the TypeScript with
npx tscand the path inclaude_desktop_config.jsonpoints to thedist/index.jsfile (notsrc/index.ts) - Path issue: The
argsarray must contain the absolute path todist/index.jswith double backslashes
Revit plugin not loading
- Verify all 3 files are in
%APPDATA%\Autodesk\Revit\Addins\2023\:RevitMcpPlugin.addinRevitMcpPlugin.dllNewtonsoft.Json.dll
- Check that the
.addinfile is not blocked: right-click > Properties > Unblock - Restart Revit after deployment
"Tool execution timed out"
- Revit may be busy with another operation. Wait and retry.
- Large models may need more than the 30-second timeout
Health check returns revitConnected: false
- Make sure a Revit project document is open (not just the start screen)
How It Works
- Claude Desktop sends an MCP
tools/callrequest (e.g.,get_elementswith{category: "Walls"}) via stdio - The TypeScript MCP Server receives it, translates it to an HTTP POST to
localhost:8080/execute - The C# Revit Plugin HttpServer receives the request, sets the tool + parameters on the
ExternalEventHandler, and raises theExternalEvent - Revit picks up the
ExternalEventon its main thread and executes the Revit API call - The result flows back: Revit API response -> JSON -> HTTP response -> MCP response -> Claude Desktop
The ExternalEvent + ManualResetEventSlim pattern ensures all Revit API calls happen on the main thread (required by Revit), while the HTTP server can handle requests from a background thread.
Rebuilding After Changes
If you modify any source files:
C# Plugin changes:
cd RevitPlugin
dotnet build -c Release
# Re-copy DLLs to Revit addins folder
copy bin\Release\RevitMcpPlugin.dll "%APPDATA%\Autodesk\Revit\Addins\2023\"
# Restart Revit
TypeScript MCP Server changes:
cd mcp-server
npx tsc
# Restart Claude Desktop
License
MIT License - see LICENSE for details.
Acknowledgments
- Model Context Protocol by Anthropic
- Revit API Documentation
- Inspired by archsalem101/revit-mcp-server
