Skip to content

Open-source Revit MCP server: let Claude and other AI assistants read and edit BIM models, with human approval on every change.

3.3 KB
Raw Blame

Build And Install Scripts

The scripts/ directory is the operational entry surface for building, packaging, installing, and running the stack.

Script Roles

scripts/build-addin.ps1

Builds the C# add-in for a selected Revit version.

Key behavior:

  • blocks unsafe execution from C:\Windows
  • prefers MSBuild discovered through vswhere
  • falls back to dotnet build
  • passes RevitVersion into RevitBridge.csproj

scripts/package.ps1

Creates a distribution package under dist\AECModelBridge.

Key behavior:

  • builds add-in binaries for one or more Revit versions
  • copies versioned binaries into dist\bin\{year}
  • attempts PyInstaller packaging for the Python server
  • always builds a wheel as fallback
  • writes default.json and README.txt into the distribution payload

scripts/build-installer.ps1

Builds the double-click Windows installer.

Key behavior:

  • runs package.ps1 for all Revit years first (skip with -SkipPackage when dist\AECModelBridge is current)
  • refuses to build if the payload is incomplete or contains Autodesk assemblies (assert-no-autodesk-assemblies.ps1)
  • locates Inno Setup (ISCC.exe); outside CI it tries winget if missing
  • writes AECModelBridge-Setup-<version>.exe to dist\ (or -OutputDir); -UpdateChecksums adds it to SHA256SUMS.txt
  • uses the wizard images and app icon from assets/, generated by scripts/make_brand_assets.py
  • the installer script is scripts/installer/AECModelBridge.iss; its AppVersion line is kept in sync by scripts/version.py

scripts/test-installer.ps1

Silent install, upgrade, failure and uninstall smoke test for the built installer. It changes C:\ProgramData\AECModelBridge and %APPDATA%, so it only runs with -AllowOverwrite; use a throw-away machine. The release workflow runs it before publishing.

scripts/install.ps1

Installs from a prepared distribution package.

Key behavior:

  • auto-triggers packaging if dist\AECModelBridge is missing
  • copies bridge binaries into C:\ProgramData\AECModelBridge\bin\{year}
  • installs the add-in manifest into the selected Revit add-in directory
  • copies default configuration into C:\ProgramData\AECModelBridge\config

scripts/install-addin.ps1

Performs the minimal manifest copy for a chosen Revit year.

This is the narrowest install path and is useful when the binaries are already built.

scripts/setup.ps1

Acts as the orchestration script.

It runs:

  1. build
  2. package
  3. optional install

scripts/start-server.ps1

Prepares and launches the Python MCP server.

Key behavior:

  • creates .env from .env.example if needed
  • checks Python availability
  • installs the Python package in editable mode
  • optionally probes the dynamic Revit bridge endpoint from the local registry in bridge mode
  • launches python -m revit_mcp_server

scripts/run-server.ps1

This is the thinnest launch path and only executes python -m revit_mcp_server.

Safety Pattern

The more powerful scripts include a path guard that refuses execution from C:\Windows. That is an intentional operational safeguard, not decoration.

Working Rule

Use setup.ps1 when you want the full build-package-install path. Use start-server.ps1 when the add-in is already in place and you only need to validate or run the Python side.