RevitMCPBridge
"Teaching AI to Build"
Episode 2: Building the Bridge
Connecting two worlds that were never meant to talk
THE CHALLENGE
CLAUDE
- Runs in cloud
- Text in/out
- No file access
- Stateless
REVIT
- Runs on desktop
- GUI-based
- C#/.NET
- Stateful
How do you make these talk to each other?
THE KEY INSIGHT
Model Context Protocol (MCP)
CLAUDE
JSON ─►
MCP
SERVER
─► JSON
TOOL
Anthropic built MCP so Claude could use external tools.
We just needed to make Revit... a tool.
THE ARCHITECTURE
LAYER 1: Claude Code
User ─► "Create a 20x30 room" ─► Claude Code (WSL)
│ stdio
LAYER 2: MCP Server (Python)
Translates MCP calls ─► Named Pipe messages
│ Named Pipe
LAYER 3: Revit Add-in (C#)
Receives JSON ─► Executes Revit API ─► Returns data
NAMED PIPES
A persistent communication channel in Windows
\\.\pipe\RevitMCPBridge2026
{"method":"createWall",...} ─►
◄─ {"success":true,"wallId":12345}
Messages flow both directions. Instantly.
INSIDE REVIT: THE ADD-IN
MCPServer.cs
▼
WallMethods │ ViewMethods │ SheetMethods │ ...
▼
REVIT API
THE FIRST TEST
$ echo '{"method":"ping"}' | nc -U /pipe/RevitMCP2026
{"success": true, "result": "pong"}
$ _
IT WORKS.
ANATOMY OF A COMMAND
{
"method": "createWall",
"params": {
"startPoint": [0, 0, 0],
"endPoint": [20, 0, 0],
"levelId": 30,
"height": 10
}
}
Plain JSON. Human readable. Machine executable.
FIRST METHODS
November 2024
ping
getLevels
getProjectInfo
getWallTypes
createWall
getViews
getElements
getSheets
~30 methods total
Enough to prove the concept.
THE REVIT CONTEXT CHALLENGE
REVIT'S RULE: All API calls must happen on
Revit's main thread
External command
─► Direct API access ✓
Named pipe listener
─► Background thread ✗
SOLUTION: ExternalEvent + IExternalEventHandler
Queue commands, execute on main thread
THE BRIDGE: COMPLETE
CLAUDE
═══════════►
REVIT
Natural language in. BIM model changes out.
Next Episode:
"First Autonomous Breakthrough"
December 2024.
30 walls appeared in Revit.
No human touched the mouse.
BIM Ops Studio
www.bimopsstudio.com