Revit MCP: Read data from the active document
Jun 2026I used MCP to expose a few Revit API calls to an LLM, so you can ask questions about the open model in plain language.

Overview
Revit MCP is a desktop assistant that lets you talk to a Revit model in plain language. Instead of clicking through menus or writing one-off scripts, you type something like "what is the floor area on Level 1?" and the model decides which tools to call against the active document.
This first version is read-only. It answers questions about the model, it does not change anything in it.
Why there are two runtimes
The annoying part of this project is not the AI, it is Revit.
- The Revit API only works inside Revit. You cannot call it from a normal app. Your code has to be loaded as an add-in and run on Revit's main thread.
- The add-in is stuck on .NET Framework 4.8, while the UI and the MCP server are on .NET 8.
So the stack is split on purpose:
- WPF app (.NET 8) hosts the chat UI and the Gemini integration.
- MCP server (.NET 8) exposes the tools to the model over stdio.
- Revit add-in (.NET Framework 4.8) lives inside
Revit.exeand is the only piece that touches the Revit DB API.
The bridge between the MCP server and the add-in is a named pipe. The server sends a small request down the pipe, the add-in runs it against the open document and sends JSON back.
The three tools
I have exposed three calls through the MCP server so far. One thing to know before reading them: Revit stores everything internally in feet, so every tool converts to metric before returning.
GetWallLength takes a wall id and returns its length in millimeters and meters.
public object GetWallLength(string wallId) { var id = new ElementId(long.Parse(wallId)); var wall = _doc.GetElement(id) as Wall; if (wall == null) return new { error = "Wall not found" }; var lengthInternal = wall.get_Parameter(BuiltInParameter.CURVE_ELEM_LENGTH).AsDouble(); var lengthMm = UnitUtils.ConvertFromInternalUnits(lengthInternal, UnitTypeId.Millimeters); var lengthM = UnitUtils.ConvertFromInternalUnits(lengthInternal, UnitTypeId.Meters); return new { wall_id = wallId, length_mm = System.Math.Round(lengthMm, 2), length_m = System.Math.Round(lengthM, 3) }; }
GetFloorArea takes a level name, finds every floor on that level and adds up the area in square meters.
public object GetFloorArea(string levelName) { var level = new FilteredElementCollector(_doc) .OfClass(typeof(Level)) .Cast<Level>() .FirstOrDefault(l => l.Name == levelName); if (level == null) return new { error = $"Level '{levelName}' not found" }; var floors = new FilteredElementCollector(_doc) .OfClass(typeof(Floor)) .Cast<Floor>() .Where(f => f.LevelId == level.Id) .ToList(); var totalArea = floors .Sum(f => f.get_Parameter(BuiltInParameter.HOST_AREA_COMPUTED).AsDouble() * 0.0929); return new { level = levelName, area_sqm = System.Math.Round(totalArea, 2) }; }
ListRoomsByLevel returns the name, number and area of every room on a level. This one is way easier, as you only have to write one LINQ.
var rooms = new FilteredElementCollector(_doc) .OfClass(typeof(SpatialElement)) .OfType<Room>() .Where(r => r.Level?.Name == levelName) .Select(r => new { name = r.Name, number = r.Number, area_sqm = System.Math.Round(r.Area * 0.0929, 2) }) .ToList();
Notice that when something is missing, the tools return an error field instead of throwing. That message goes back to the model as a normal tool result, so it can tell you "that level does not exist" instead of the whole request blowing up.
Full request flow
Here is what happens between typing a prompt and seeing an answer:
User types prompt in WPF UI ↓ GeminiService.SendPromptAsync() ↓ HTTPS Google Gemini API (gemini-2.5-flash) ↓ tool_use: open_revit_document McpClientService.CallToolAsync() ↓ stdio (MCP protocol) RevitMCP.Server.exe ↓ named pipe (RevitMCPPipe) RevitMCP.Addin (inside Revit.exe) ↓ Revit DB API Real Revit data (.rvt file) ↑ JSON result Back through pipe → MCP server → Gemini ↑ tool_result Gemini reasons, calls more tools if needed ↑ final text answer ResponseText shown in WPF UI
The part I like is the loop near the bottom. Gemini is not limited to one call. It can ask for the rooms on a level, look at the result, then ask for a wall length, and only answer once it has what it needs. I never write that sequence myself, I only describe the tools.
2 cents and conclusion
It took me 12 days to build this while I was automating Revit workflows. As a new-generation engineer, I thought, "Why not build AI projects?"
They are very simple and easy to do in my openion. I think this is way simpler than automating Revit workflows and writing those LINQs, yet it will still be considered a very good project for a resume. Haha.
This is my first blog post and I hope to write more in the future. let's see if I can keep this up or it dies like my other projects. chop chop !!!