Skip to main content
Glama

Alaamri Revit MCP

An MCP server that gives Claude (or any MCP client) full Revit API access inside a running Autodesk Revit 2025, 2026 or 2027 session: run any C# against the live model, plus ready tools to read, edit, select, delete, open, save and export.

It has two parts:

  1. Revit add-in (addin/, prebuilt per version in dist/2025, dist/2026, dist/2027): adds an Alaamri ribbon tab with a Start/Stop Claude button (green = connected) and About. It opens a bridge on 127.0.0.1 only, protected by a per-session token, and runs every request on Revit's API thread through ExternalEvent. C# is compiled at runtime with Roslyn, isolated in its own load context so other add-ins' Roslyn versions don't clash.

  2. MCP server (server.py): exposes the bridge as MCP tools over stdio.

بالعربي: القسم العربي · برومبت التثبيت عبر Claude · تثبيت بنقرة واحدة: install.bat

Requirements

  • Windows, Autodesk Revit 2025, 2026 or 2027 (2027 is live-tested; 2025/2026 builds target .NET 8)

  • Python 3.10 or newer

Related MCP server: Horizun Revit MCP

Install

Let Claude do it: paste the prompt in prompts/install-with-claude.md into Claude Code.

Quick (Windows): close Revit, then double-click install.bat (inside the cloned folder or on its own). It copies the add-in for every supported Revit version it finds to %APPDATA%\Autodesk\Revit\Addins\<year>, installs the server into %LOCALAPPDATA%\Alaamri-Revit-MCP and registers it in Claude Desktop (keeping a .bak of your config). Fully quit and reopen Claude Desktop, open Revit and choose Always Load for the add-in.

Claude Code:

claude mcp add alaamri-revit -- "%LOCALAPPDATA%\Alaamri-Revit-MCP\.venv\Scripts\alaamri-revit-mcp.exe"

Build the add-in from source (.NET 10 SDK; 2025/2026 use the Nice3point Revit API reference packages, so Revit need not be installed):

dotnet build addin\AlaamriRevitMcp.csproj -c Release -p:RevitYear=2026 -o dist\2026

Tools

Tool

What it does

execute_csharp

Run any C# inside Revit with globals uiapp, app, uidoc, doc, print(), mm(), ft(), id(). Runs in one named transaction (undo with Ctrl+Z), rolled back on error

status

Bridge, Revit version/build, active document and view, open documents

document_info

Title, path, units, levels, phases, worksharing, model element counts

list_elements

Elements by category or API class, optional active-view / name filter

get_parameters

All instance (and type) parameters of an element

set_parameters

Set one parameter on many elements or their types

get_selection / select_elements

Read or set the Revit selection (and zoom)

delete_elements

Delete elements (undoable)

open_document / new_document / save_document

File operations

export_view_image

Export the active view to PNG for visual checking

about

Version, author, license, links

Example execute_csharp code:

var level = new FilteredElementCollector(doc).OfClass(typeof(Level)).Cast<Level>().OrderBy(l => l.Elevation).First();
var w = Wall.Create(doc, Line.CreateBound(XYZ.Zero, new XYZ(ft(6000), 0, 0)), level.Id, false);
return w;   // -> {id, name, category, type, level}

Safety

This tool gives an AI unrestricted control of the open Revit model. Work on a copy of real projects, keep backups, and review what the agent is doing. Each call is a single named transaction you can undo with Ctrl+Z; calls with transaction=false (open/save/close or self-managed transactions) are not wrapped. The bridge listens on 127.0.0.1 only, rejects browser requests, and needs the random token written to %LOCALAPPDATA%\Alaamri-Revit-MCP\bridge.json each time it starts. Click Stop Claude to switch it off; the choice is remembered.

Author

Developed by Dr Ibrahim M.A. Alaamri: LinkedIn · Also: Alaamri MS Project MCP

Feedback and ratings are welcome in Issues.

License

MIT, see LICENSE.


بالعربية

Alaamri Revit MCP خادم MCP يمنح Claude (أو أي عميل MCP) صلاحية كاملة على Revit API داخل جلسة Revit المفتوحة (الإصدارات 2025 و2026 و2027): تنفيذ أي كود C# على النموذج مباشرة، إضافة إلى أدوات جاهزة للقراءة والتعديل والتحديد والحذف والفتح والحفظ والتصدير.

المكوّنان

  1. إضافة Revit: تضيف تبويب Alaamri فيه زر Start/Stop Claude (أخضر عند الاتصال) وزر About. الاتصال محلي فقط على 127.0.0.1 ومحمي برمز سري يتجدد في كل تشغيل.

  2. خادم MCP (server.py) يعرض هذه الإمكانات أدواتٍ لـ Claude.

التثبيت

  • عبر Claude: الصق البرومبت الموجود في prompts/install-with-claude.md في Claude Code وسيتولى التثبيت والاختبار.

  • بنقرة واحدة: أغلق Revit ثم شغّل install.bat، ثم أعد فتح Claude Desktop، وافتح Revit واختر Always Load.

الأدوات

execute_csharp (تنفيذ أي كود C# داخل Revit)، وstatus، وdocument_info، وlist_elements، وget_parameters، وset_parameters، وget_selection، وselect_elements، وdelete_elements، وopen_document، وnew_document، وsave_document، وexport_view_image، وabout.

تنبيه

الأداة تمنح الذكاء الاصطناعي تحكماً غير مقيّد بالنموذج المفتوح، فاعمل على نسخة من المشاريع الحقيقية واحتفظ بنسخ احتياطية. كل أمر يُنفَّذ في Transaction واحدة باسم واضح يمكن التراجع عنها بـ Ctrl+Z، ويُلغى أثره تلقائياً عند الخطأ. لإيقاف الاتصال اضغط Stop Claude.

المطوّر

تطوير د. إبراهيم م. أ. العامري (Dr Ibrahim M.A. Alaamri): LinkedIn

يسعدني تقييمك وملاحظاتك عبر Issues.

الترخيص

MIT، راجع ملف LICENSE.

Available Tools

14 tools
aboutC

Server name, version, author, license and links.

Inputs: no named parameters. Returns: result

delete_elementsB

Delete elements (one undoable transaction). Returns all ids Revit removed, including dependents.

Inputs: element_ids (required). Returns: result

document_infoA

Active document: title, path, units, levels, phases, worksharing, element counts by category.

Inputs: no named parameters. Returns: result

execute_csharpA

Run any C# code inside Revit with FULL Revit API access (the main tool).

Write a C# script body (statements, optional return value;). Available globals: uiapp (UIApplication), app (Application), uidoc (UIDocument), doc (active Document), print(obj) to add output lines, mm(feet)->mm, ft(mm)->feet, id(long)->ElementId. Namespaces already imported: System, System.Linq, System.Collections.Generic, System.IO, System.Text, Autodesk.Revit.DB (+ .Architecture .Structure .Mechanical .Plumbing .Electrical), Autodesk.Revit.UI(.Selection). Revit internal units are feet. With transaction=true (default) the code runs inside one named transaction that is committed on success and rolled back on any exception; the user can undo it with Ctrl+Z. Use transaction=false for read-only code or when the code opens/closes/saves documents or manages its own transactions. Example: return new FilteredElementCollector(doc).OfClass(typeof(Wall)).Count();

Inputs: code (required), timeout_s, transaction, transaction_name. Returns: result

export_view_imageB

Export the active view as a PNG image to path, so the result can be checked visually.

Inputs: path (required), pixel_width. Returns: result

get_parametersB

All instance parameters of one element (and its type parameters if include_type).

Inputs: element_id (required), include_type. Returns: result

get_selectionC

Elements currently selected in Revit.

Inputs: no named parameters. Returns: result

list_elementsA

List element instances filtered by category name (e.g. 'Walls', 'Doors') or API class (e.g. 'Wall', 'FamilyInstance'), optionally only in the active view and/or by name substring.

Inputs: limit, category, view_only, class_name, +1 more. Returns: result

new_documentA

Create a new project from a template (default template if empty) and activate it.

Inputs: template_path. Returns: result

open_documentC

Open an .rvt/.rfa file (activates it in the UI by default).

Inputs: path (required), activate. Returns: result

save_documentC

Save the active document, or Save As a new path.

Inputs: overwrite, save_as_path. Returns: result

select_elementsC

Select elements in Revit (and zoom to them).

Inputs: element_ids (required), zoom. Returns: result

set_parametersB

Set one parameter on many elements (or on their types). Value is text: numbers for Double params use display units via SetValueString (e.g. '3000' mm), Integer/Yes-No as '1'/'0', ElementId as the id.

Inputs: value (required), parameter (required), element_ids (required), on_type. Returns: result

statusA

Is Revit running with the bridge on? Revit version, active document, open documents.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have clearly distinct resource+action targets (list_elements, get_parameters, set_parameters, delete_elements, open/save/new_document). The only mild overlap is between status (Revit version, active doc, open docs), about (server metadata) and document_info (active doc details), which a careful reader can separate from the descriptions but could still momentarily confuse. execute_csharp is explicitly framed as the general-purpose escape hatch, which helps rather than muddies the set.

    Naming Consistency4/5

    The dominant convention is consistent snake_case verb_noun (list_elements, get_parameters, set_parameters, select_elements, delete_elements, open_document, export_view_image). The metadata tools 'status' and 'about' are noun-only and break the pattern, and 'execute_csharp' names a technology rather than an operation, but overall the set reads predictably.

    Tool Count5/5

    14 tools is squarely in the well-scoped band for a Revit bridge server. Each tool covers a distinct slice of the workflow (connection/inspection, element query, parameter read/write, selection, document lifecycle, export, raw API execution) with no filler.

    Completeness4/5

    The surface covers connection check, document lifecycle (open/new/save), element listing, parameter read/write, selection, deletion and visual verification. Notable omissions are element creation helpers, family/view management, document close, and no update/rename tool, but execute_csharp with full API access makes all of these reachable, so no true dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers