Professional template for multi-version Revit plugins, with clean architecture, WPF, local MCP bridge, AI gateway, and agent-ready documentation.
This template was designed to be a safe starting point for professional Revit 2024, 2025, 2026, and 2027 add-ins.
It separates:
- domain and use cases without Revit API dependencies;
- versioned Revit API layer;
- decoupled WPF/WebView2 UI;
- local bridge for MCP;
- AI gateway outside the Revit process;
- documentation and instructions for AI agents.
| Revit | Recommended runtime | Add-in build |
|---|---|---|
| 2024 | .NET Framework 4.8 | -p:RevitVersion=2024 |
| 2025 | .NET 8 Windows | -p:RevitVersion=2025 |
| 2026 | .NET 8 Windows | -p:RevitVersion=2026 |
| 2027 | .NET 10 Windows | -p:RevitVersion=2027 |
Do not use a single binary for all versions. Generate one binary per version and keep domain, application services, DTOs, and contracts shared.
- Windows 10/11.
- Visual Studio 2022 or later, with the .NET desktop workload.
- Revit installed for each version you want to build/test.
- .NET SDK 8 for Revit 2025/2026.
- .NET SDK 10 for Revit 2027, MCP server, and AI Gateway.
- .NET Framework 4.8 Developer Pack for Revit 2024.
# Build a specific version
./scripts/build.ps1 -RevitVersion 2024
./scripts/build.ps1 -RevitVersion 2025
./scripts/build.ps1 -RevitVersion 2026
./scripts/build.ps1 -RevitVersion 2027
# Build all installed versions
./scripts/build.ps1 -RevitVersion all./scripts/dev-install.ps1 -RevitVersion 2026This script builds the selected version and writes a .addin file to:
%APPDATA%\Autodesk\Revit\Addins\<year>- Install in development mode.
- Open the corresponding Revit version.
- Look for the
AI Templatetab. - Click
Assistant.
This template includes an external MCP server at:
src/RevitAiTemplate.Mcp.ServerFlow:
Claude/Cursor/Copilot Agent
-> MCP stdio
RevitAiTemplate.Mcp.Server
-> local named pipe
RevitAiTemplate.Revit add-in
-> ExternalEvent
Valid Revit API on the Revit thread/contextThe MCP server should only execute tools that you have declared and tested. Start with read-only tools.
The add-in does not call OpenAI/Anthropic/Azure directly by default. It calls a local/remote AI Gateway:
src/RevitAiTemplate.AiGatewayReasons:
- avoids API keys inside Revit;
- reduces dependency conflicts in the Revit process;
- enables rate limiting, auditing, policy, and fallback;
- makes it easier to switch AI providers.
Configure:
$env:REVIT_AI_GATEWAY_URL = "http://localhost:5088"Run:
dotnet run --project src/RevitAiTemplate.AiGateway/RevitAiTemplate.AiGateway.csprojsrc/
RevitAiTemplate.Core/ Domain, DTOs, and ports
RevitAiTemplate.Application/ Use cases
RevitAiTemplate.Infrastructure/ AI Gateway client, logging, configuration
RevitAiTemplate.Ui.Wpf/ WPF/MVVM UI without Revit API
RevitAiTemplate.Revit/ Host Revit, ExternalApplication, ExternalCommand, adapters
RevitAiTemplate.RevitBridge/ Local bridge contracts between MCP and Revit
RevitAiTemplate.Mcp.Server/ Local MCP server via stdio
RevitAiTemplate.AiGateway/ Optional AI Gateway
tests/
RevitAiTemplate.Application.Tests/
docs/
architecture/
adr/
ai/
domain/
security/
testing/- Replace names, GUIDs, VendorId, and namespaces.
- Define read-only and write MCP tools separately.
- Add tests with real fixtures.
- Create an installer per version.
- Sign binaries.
- Enable CI, secret scanning, dependency scanning, and branch protection.
- Publish support documentation, version documentation, changelog, and data/AI policy.