# bimwright/rvt-mcp architecture

> Architecture diagram of the GitHub repository bimwright/rvt-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bimwright/rvt-mcp
- Repository: https://github.com/bimwright/rvt-mcp

## Overview

rvt-mcp is a local MCP gateway that lets an agent operate a running Revit session. The documented path is MCP client → .NET server tools → localhost transport → year-specific Revit add-in → Revit API, with results returned to the client. ToolBaker is an optional branch for capturing and reusing personal tools; typed Revit tools span model querying, creation, editing, views, schedules, exports, and workflows. The graph emphasizes that runtime path and major documented capabilities. Several implementation details are unsampled, so unverified links are omitted.

Main entry points: [`src/server/Program.cs`](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Program.cs) (MCP server), [`src/plugin-r27/App.cs`](https://github.com/bimwright/rvt-mcp/blob/master/src/plugin-r27/App.cs) (Revit add-in), [`src/shared/Infrastructure/Execution/McpEventHandler.cs`](https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Infrastructure/Execution/McpEventHandler.cs) (Command execution), [`src/server/Gateway/ToolGateway.cs`](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Gateway/ToolGateway.cs) (Tool gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["MCP gateway"]
  node_server["MCP server<br/>[Program.cs]"]
  node_gatewaycore["Tool gateway<br/>[ToolGateway.cs]"]
end

subgraph group_addin["Revit add-in"]
  node_plugin["Revit add-in<br/>[App.cs]"]
  node_dispatch["Command dispatcher"]
  node_eventhandler["Command execution<br/>[McpEventHandler.cs]"]
end

subgraph group_tools["Revit capabilities"]
  node_query["Model queries<br/>[QueryTools.cs]"]
  node_create["Model authoring<br/>[CreateTools.cs]"]
  node_modify["Model editing<br/>[ModifyTools.cs]"]
  node_views["Views and graphics<br/>[ViewTools.cs]"]
  node_schedules["Schedules and sheets<br/>[ScheduleTools.cs]"]
  node_exports["Exports<br/>[ExportTools.cs]"]
  node_workflows["Model workflows"]
end

subgraph group_baker["Personal tools"]
  node_bake["ToolBaker"]
  node_bakehandlers["Bake suggestions"]
end

subgraph group_state["History and state"]
  node_history[("Change history")]
  node_tracker["Change tracking"]
  node_config["Configuration<br/>[RvtMcpConfig.cs]"]
end

node_agent(("MCP client"))
node_revit["Autodesk Revit"]

node_agent -->|"sends MCP"| node_server
node_server -->|"routes tools"| node_gatewaycore
node_gatewaycore -.->|"sends commands"| node_plugin
node_plugin -->|"registers commands"| node_dispatch
node_dispatch -.->|"dispatches commands"| node_eventhandler
node_eventhandler -->|"executes in"| node_revit
node_server -->|"registers tools"| node_query
node_server -->|"registers tools"| node_create
node_server -->|"registers tools"| node_modify
node_server -->|"registers tools"| node_views
node_server -->|"registers tools"| node_schedules
node_server -.->|"registers tools"| node_exports
node_server -.->|"registers tools"| node_workflows
node_server -->|"supports optional baking"| node_bake
node_bakehandlers -->|"accepts suggestions"| node_bake
node_eventhandler -.->|"captures changes"| node_tracker
node_tracker -.->|"stores history"| node_history
node_plugin -->|"loads settings"| node_config

click node_server "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Program.cs"
click node_gatewaycore "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Gateway/ToolGateway.cs"
click node_plugin "https://github.com/bimwright/rvt-mcp/blob/master/src/plugin-r27/App.cs"
click node_dispatch "https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Infrastructure/Execution/CommandDispatcher.cs"
click node_eventhandler "https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Infrastructure/Execution/McpEventHandler.cs"
click node_query "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/QueryTools.cs"
click node_create "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/CreateTools.cs"
click node_modify "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ModifyTools.cs"
click node_views "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ViewTools.cs"
click node_schedules "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ScheduleTools.cs"
click node_exports "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ExportTools.cs"
click node_workflows "https://github.com/bimwright/rvt-mcp/tree/master/src/shared/Handlers/Workflows"
click node_bake "https://github.com/bimwright/rvt-mcp/tree/master/src/server/Bake"
click node_bakehandlers "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Handlers/AcceptBakeSuggestionHandler.cs"
click node_history "https://github.com/bimwright/rvt-mcp/blob/master/src/server/Memory/ChangeHistoryStore.cs"
click node_tracker "https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Infrastructure/ChangeTracking/McpChangeTracker.cs"
click node_config "https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Config/RvtMcpConfig.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_gatewaycore,node_agent toneBlue
class node_plugin,node_dispatch,node_eventhandler toneAmber
class node_query,node_create,node_modify,node_views,node_schedules,node_exports,node_workflows toneMint
class node_bake,node_bakehandlers toneRose
class node_history,node_tracker,node_config,node_revit toneIndigo
```

## Components

### MCP gateway

- [MCP server](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Program.cs): `src/server/Program.cs`
- [Tool gateway](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Gateway/ToolGateway.cs): `src/server/Gateway/ToolGateway.cs`

### Revit add-in

- [Revit add-in](https://github.com/bimwright/rvt-mcp/blob/master/src/plugin-r27/App.cs): `src/plugin-r27/App.cs`
- [Command dispatcher](https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Infrastructure/Execution/CommandDispatcher.cs): `src/shared/Infrastructure/Execution/CommandDispatcher.cs`
- [Command execution](https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Infrastructure/Execution/McpEventHandler.cs): `src/shared/Infrastructure/Execution/McpEventHandler.cs`

### Revit capabilities

- [Model queries](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/QueryTools.cs): `src/server/Tools/QueryTools.cs`
- [Model authoring](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/CreateTools.cs): `src/server/Tools/CreateTools.cs`
- [Model editing](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ModifyTools.cs): `src/server/Tools/ModifyTools.cs`
- [Views and graphics](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ViewTools.cs): `src/server/Tools/ViewTools.cs`
- [Schedules and sheets](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ScheduleTools.cs): `src/server/Tools/ScheduleTools.cs`
- [Exports](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Tools/ExportTools.cs): `src/server/Tools/ExportTools.cs`
- [Model workflows](https://github.com/bimwright/rvt-mcp/tree/master/src/shared/Handlers/Workflows): `src/shared/Handlers/Workflows`

### Personal tools

- [ToolBaker](https://github.com/bimwright/rvt-mcp/tree/master/src/server/Bake): `src/server/Bake`
- [Bake suggestions](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Handlers/AcceptBakeSuggestionHandler.cs): `src/server/Handlers/AcceptBakeSuggestionHandler.cs`

### History and state

- [Change history](https://github.com/bimwright/rvt-mcp/blob/master/src/server/Memory/ChangeHistoryStore.cs): `src/server/Memory/ChangeHistoryStore.cs`
- [Change tracking](https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Infrastructure/ChangeTracking/McpChangeTracker.cs): `src/shared/Infrastructure/ChangeTracking/McpChangeTracker.cs`
- [Configuration](https://github.com/bimwright/rvt-mcp/blob/master/src/shared/Config/RvtMcpConfig.cs): `src/shared/Config/RvtMcpConfig.cs`

### Other components

- **MCP client**
- **Autodesk Revit**

## Connections

- MCP client → MCP server: sends MCP (evidence: `README.md`)
- MCP server → Tool gateway: routes tools
- Tool gateway → Revit add-in: sends commands
- Revit add-in → Command dispatcher: registers commands (evidence: `src/plugin-r27/App.cs`)
- Command dispatcher → Command execution: dispatches commands (evidence: `src/shared/Infrastructure/Execution/McpEventHandler.cs`)
- Command execution → Autodesk Revit: executes in (evidence: `src/shared/Infrastructure/Execution/McpEventHandler.cs`)
- MCP server → Model queries: registers tools
- MCP server → Model authoring: registers tools
- MCP server → Model editing: registers tools
- MCP server → Views and graphics: registers tools
- MCP server → Schedules and sheets: registers tools
- MCP server → Exports: registers tools
- MCP server → Model workflows: registers tools
- MCP server → ToolBaker: supports optional baking (evidence: `README.md`)
- Bake suggestions → ToolBaker: accepts suggestions (evidence: `src/server/Handlers/AcceptBakeSuggestionHandler.cs`)
- Command execution → Change tracking: captures changes (evidence: `src/shared/Infrastructure/Execution/McpEventHandler.cs`)
- Change tracking → Change history: stores history
- Revit add-in → Configuration: loads settings (evidence: `src/plugin-r27/App.cs`)
