AI-driven command execution framework for Autodesk Revit.
RevitCommandRunner installs as a Revit application plugin and exposes an MCP server so AI agents can execute Revit commands, read results, fix code, rebuild, and run again without restarting Revit.
src/RevitCommandRunner- Revit add-in source.mcp-server- Node.js MCP server used by AI clients.installer/RevitCommandRunnerInstaller- WPF installer EXE source.installer/Create-Embedded-Installer.ps1- embeds the built bundle and MCP server into one distributable installer.Rebuild-Installer.bat- one-click release build wrapper.
Run from the repository root:
Rebuild-Installer.bat 1.0.2The output is:
releases\RevitCommandRunner-v1.0.2-Installer.exe
Distribute only that EXE. It contains the Revit bundle, MCP server, and dependencies.
The installer places the bundle here:
%APPDATA%\Autodesk\ApplicationPlugins\RevitCommandRunner.bundle
After installing the bundle, it shows a WPF checkbox dialog for MCP client configuration. All clients are checked by default:
- Claude Code
- Claude Desktop
- OpenCode
- Antigravity
- Cursor
The installer creates or updates the relevant MCP config entry. Existing unrelated MCP servers are preserved. If revit-command-runner already exists, it is updated instead of duplicated.
All clients point to the bundled MCP server:
%APPDATA%/Autodesk/ApplicationPlugins/RevitCommandRunner.bundle/mcp-server/index.js
- Windows
- Autodesk Revit 2021-2027
- .NET 8 Desktop Runtime (x64)
- Windows
- Autodesk Revit 2021-2027
- .NET SDK 8.0+
- Node.js 18+ and npm
- PowerShell 7+ (
pwsh)
Rebuild-Installer.bat runs these steps:
pwsh -NoProfile -ExecutionPolicy Bypass -File src\RevitCommandRunner\Build-AllVersions.ps1 -Configuration Release
cd mcp-server
npm install
npm run build
cd ..
pwsh -NoProfile -ExecutionPolicy Bypass -File installer\Create-Embedded-Installer.ps1 -Version 1.0.2The add-in and MCP server communicate through JSON files in:
%LOCALAPPDATA%\RevitCommandRunner
Main files:
command-queue.jsonresults\results-{id}.json
Commands can implement IExternalCommandWithUIApp for direct UIApplication access:
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using RevitCommandRunner.Core;
public class MyCommand : IExternalCommandWithUIApp
{
public Result Execute(UIApplication app, ref string message, ElementSet elements)
{
var doc = app.ActiveUIDocument.Document;
message = $"Active document: {doc.Title}";
return Result.Succeeded;
}
}Standard IExternalCommand is also supported, but IExternalCommandWithUIApp is preferred.
If you encounter errors like:
Could not load file or assembly 'YourDLL, Version=X.X.X.X, Culture=neutral, PublicKeyToken=null'.
Operation is not supported. (0x80131515)
This is the LOAD_FROM_BLOCKED_ZONE error caused by Windows security restrictions. It occurs when:
- Your DLL is in a cloud-synced folder (OneDrive, Dropbox, Google Drive, etc.)
- The DLL is marked as "downloaded from the internet" by Windows
- The path is treated as an untrusted zone
The Fix (Automatic in v1.0.3+)
RevitCommandRunner automatically handles this by:
- Programmatically unblocking files - Removes the
Zone.Identifieralternate data stream - Fallback to byte-stream loading - If unblocking fails, loads assemblies via memory stream
- Dependency resolution - Applies the same logic to all dependency DLLs
Manual Workaround (If Needed)
If issues persist, manually unblock your DLLs:
Unblock-File -Path "d:\YourProject\bin\2026\*.dll"Or move your project outside cloud-synced folders to a local directory like C:\Projects\.
Technical Details
The error code 0x80131515 specifically means the assembly is from an untrusted zone. The fix is implemented in:
AssemblyLoaderV2.cs- Main assembly loader with unblockingCommandExecutor.cs- Dependency resolver with fallbackCollectibleAssemblyLoadContext- .NET 8+ context loader