🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

Bimwright.Rvt.Server

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Bimwright.Rvt.Server

MCP gateway for Autodesk Revit 2022-2027 — expose the Revit API as AI-callable tools with progressive disclosure (toolset gating), a Transaction-safe batch_execute, and a ToolBaker self-evolution engine. Pair with the Revit plugin distributed on GitHub Releases.

Source
nugetNuGet
Version
0.3.0
Version published
Total downloads
429
Maintainers
1
Created
Source

rvt-mcp

rvt-mcp

build license .NET

📖 English · Tiếng Việt · 简体中文

I built this because I got tired of clicking.

You know the scene: 5 PM, your BIM Manager messages "rename everything to the new standard" — L01 - Basement, L02 - Commercial, on and on. The model has a few thousand elements. Doing it by hand is out. Writing a Dynamo script takes half a day. That's the itch.

rvt-mcp is an add-in that sits next to Revit 2022–2027. You tell Claude (or Cursor, Codex, OpenCode — whatever agent you use) what you want done, it calls one of 32 local tools, and Revit runs the thing inside a single transaction. Not happy? Ctrl+Z — one step, everything rolls back.

No cloud. Nothing leaves your machine. Apache-2.0, pure C#.

🤖 Using an AI agent? Point it at AGENTS.md — it'll install the server, the plugin, and wire your MCP client, previewing each step before it touches anything. You still need Revit and .NET 8 SDK on the machine.

A few things I care about:

  • Every Revit year from 2022 to 2027. One codebase, six plugin shells (.NET 4.8 → .NET 10). Compile gate is 6/6, core runtime coverage exists for R23–R26, and the accepted ToolBaker path has now been smoke-tested on R22, R26, and R27.
  • Pure C#, Apache-2.0. No Node.js on the Revit machine. License is enterprise-safe, dependency graph audits cleanly.
  • Atomic batches. batch_execute wraps a whole command list in one TransactionGroup. One undo step. If any command in the batch fails, the whole group rolls back — you never end up with a half-applied edit.
  • Weak models don't drown. --toolsets + --read-only gate what the agent can see. A Haiku-sized model doesn't need to know about delete_element when you asked it to pull quantities.
  • Self-shaping toolkit, opt-in. Adaptive bake is off by default. When enabled, repeated local usage can become a suggestion you accept into your own baked-tool registry. Accepted tools are available from the Revit ribbon and through list_baked_tools / run_baked_tool, with compatibility recorded per Revit version.

Architecture

+---------------------------+
| AI Client                 |
| Claude / Cursor / Codex   |
+---------------------------+
              |
              | stdio MCP
              v
+---------------------------+
| Bimwright.Rvt.Server      |
| .NET 8 / C#               |
+---------------------------+
              |
              | TCP (R22-R24)
              | Named Pipe (R25-R27)
              v
+---------------------------+
| Plugin Shell              |
| thin add-in per Revit yr  |
+---------------------------+
              |
              | shared command core
              | from `src/shared/`
              v
+---------------------------+
| ExternalEvent Marshal     |
| execution -> Revit UI     |
+---------------------------+
              |
              v
+---------------------------+
| Revit API                 |
+---------------------------+
              |
              v
+---------------------------+
| Model / Transaction /     |
| Undo                      |
+---------------------------+

rvt-mcp is a full C# MCP stack. The MCP server, per-version Revit plugin shells, transport bridge, command handlers, DTO mapping, and ToolBaker pipeline are all written in C# using the official MCP C# SDK. There is no Node.js sidecar on the Revit machine — just .NET + Revit.

That matters because many MCP examples and servers in the ecosystem are built around a Node.js/TypeScript runtime. This project is not. For Revit shops, that means one language, one build chain, and a simpler story for debugging, auditing, and deployment. The version split is explicit at the edge: one thin plugin shell per Revit year, all compiling the same src/shared/ source glob. See ARCHITECTURE.md for the full deep-dive.

Project Structure

rvt-mcp/
├── src/
│   ├── Bimwright.Rvt.sln         # Solution (server + 6 plugin shells)
│   ├── server/                   # Bimwright.Rvt.Server — .NET 8 global tool, stdio MCP
│   ├── shared/                   # Source glob shared by every plugin shell
│   │   ├── Handlers/             # One file per tool (create_grid, send_code, …)
│   │   ├── Commands/             # Revit ribbon commands
│   │   ├── ToolBaker/            # Self-evolution engine (baked-tool registry/runtime)
│   │   ├── Transport/            # TCP (R22–R24) + Named Pipe (R25–R27) abstraction
│   │   ├── Infrastructure/       # CommandDispatcher, ExternalEvent marshalling
│   │   └── Security/             # Auth token, secret masking
│   ├── plugin-r22/               # Revit 2022 shell — .NET 4.8, TCP
│   ├── plugin-r23/               # Revit 2023 shell — .NET 4.8, TCP
│   ├── plugin-r24/               # Revit 2024 shell — .NET 4.8, TCP
│   ├── plugin-r25/               # Revit 2025 shell — .NET 8, Named Pipe
│   ├── plugin-r26/               # Revit 2026 shell — .NET 8, Named Pipe
│   └── plugin-r27/               # Revit 2027 shell — .NET 10, Named Pipe
├── tests/                        # Golden snapshot + Haiku benchmark + policy tests
├── benchmarks/                   # Weak-model (Haiku) accuracy harness
├── scripts/                      # stage-plugin-zip.ps1, install.ps1, uninstall-all.ps1
├── docs/                         # Brainstorms, reviews, ADRs
├── server.json                   # MCP registry manifest
├── smithery.yaml                 # Smithery aggregator manifest
├── AGENTS.md                     # Agent-led install guide (9 host clients)
└── ARCHITECTURE.md               # Deep-dive on threading + transport + DTOs

Six plugin shells compile from the same src/shared/ glob — year-specific #if fences handle Revit API drift (ElementId.IntegerValue.Value in R26+, WPF in R27).

Install

1. Server — .NET tool

dotnet tool install -g Bimwright.Rvt.Server
bimwright-rvt --help

Requires .NET 8 SDK on the machine that runs the MCP client.

2. Plugin — Revit add-in

Download the latest release from GitHub Releases. Extract it and run:

pwsh install.ps1            # detects every installed Revit year
pwsh install.ps1 -WhatIf    # preview without changes
pwsh install.ps1 -Uninstall # clean removal

The script detects installed Revit versions via HKLM:\SOFTWARE\Autodesk\Revit\ and copies the matching plugin into %APPDATA%\Autodesk\Revit\Addins\<year>\Bimwright\.

3. Wire up your MCP client

Add one entry per Revit year to your client's MCP config (e.g. .mcp.json):

{
  "mcpServers": {
    "bimwright-rvt-r23": {
      "command": "bimwright-rvt",
      "args": ["--target", "R23"]
    }
  }
}

Drop the --target flag and Bimwright auto-detects the running Revit instance via discovery files in %LOCALAPPDATA%\Bimwright\.

Scripted wire for OpenCode / Codex

Instead of hand-editing opencode.json or ~/.codex/config.toml, run:

pwsh install.ps1 -WireClient opencode      # writes entries into %USERPROFILE%\.config\opencode\opencode.json
pwsh install.ps1 -WireClient codex         # writes entries into %USERPROFILE%\.codex\config.toml
pwsh install.ps1 -WireClient opencode -WhatIf   # preview

The script:

  • Adds one bimwright-rvt-r<YY> entry per Revit year detected on this machine.
  • Preserves every non-bimwright entry already in the config (merge-in-place).
  • Backs up the original as <file>.bimwright.bak before writing.
  • Does nothing if the host's config file is not present (host not installed).

Claude Code users: paste the JSON snippet above into your project's .mcp.json — the scripted path does not auto-edit project-level files.

Uninstall everything

To remove plugin, .NET global tool, host-config entries, discovery files, and ToolBaker cache in one pass:

pwsh uninstall-all.ps1 -WhatIf    # preview what will be removed
pwsh uninstall-all.ps1            # interactive confirm, then execute
pwsh uninstall-all.ps1 -Yes       # skip prompt
pwsh uninstall-all.ps1 -KeepLogs  # preserve *.log and *.jsonl files

Notes:

  • This removes Bimwright.Rvt.Server from every project on the machine (dotnet tool uninstall -g), not just the current directory.
  • Project-level .mcp.json files are not scanned — remove any bimwright-rvt-* entries in those manually.
  • install.ps1 -Uninstall remains the narrow plugin-only uninstall (backward compatible).
  • -KeepLogs preserves the logs\ subdirectory if present, plus any root-level *.log / *.jsonl files inside %LOCALAPPDATA%\Bimwright\.

Supported MCP clients

ClientStatusNotes
Claude Code CLIdocumentedproject .mcp.json or global ~/.claude.json
Claude Desktopdocumented%APPDATA%\Claude\claude_desktop_config.json
OpenCodescriptedinstall.ps1 -WireClient opencode
Codexscriptedinstall.ps1 -WireClient codex
Cursordocumentedproject or user mcp.json
Cline (VS Code)documentedCline MCP settings JSON
VS Code Copilotdocumentednative servers schema with type: stdio
Gemini CLIdocumentedgemini mcp add ... or settings JSON
AntigravitydocumentedGemini/Antigravity MCP config JSON

See AGENTS.md for exact config paths, schemas, dry-run expectations, and rollback notes for all supported hosts.

Quickstart — 5 minutes to first tool call

  • dotnet tool install -g Bimwright.Rvt.Server + pwsh install.ps1.
  • Open Revit, go to Add-Ins → BIMwright, then click the MCP toggle button.
  • In your MCP client, run tools/list — you should see the default toolsets (query, create, view, meta, lint).
  • Call get_current_view_info — you'll get back a DTO like:
    { "viewName": "Level 1", "viewType": "FloorPlan", "levelName": "Level 1", "scale": 100 }
    
  • Try something real:
    batch_execute({
      "commands": "[
        {\"command\":\"create_grid\",\"params\":{\"name\":\"A\",\"start\":[0,0],\"end\":[20000,0]}},
        {\"command\":\"create_level\",\"params\":{\"name\":\"L2\",\"elevation\":3000}}
      ]"
    })
    
    One undo step, both ops committed atomically.

Toolsets

32 tools across 11 toolsets. Five toolsets are on by default (query, create, view, meta, lint); the rest opt in via --toolsets or config. When adaptive bake is enabled, three suggestion lifecycle tools are added to the toolbaker surface, bringing the full adaptive surface to 35 tools.

ToolsetToolsDefault
queryget current view, selected elements, available family types, material quantities, model stats, AI element filteron
creategrid, level, room, line-based, point-based, surface-based elementon
viewcreate view, sheet layout, place view on sheeton
metashow_message, switch_target, batch_execute, usage statson
lintview-naming pattern analysis, correction suggestions, firm-profile detecton
modifyoperate_element, color_elementsoff
deletedelete_elementoff
annotationtag_all_rooms, tag_all_wallsoff
exportexport_room_dataoff
mepdetect_system_elementsoff
toolbakeraccepted-tool list/run, send-code, and adaptive suggestion lifecycle tools (env/config opt-in)off

Enable with --toolsets query,create,modify,meta or --toolsets all. Add --read-only to strip create/modify/delete regardless of what you requested.

All tools

ToolsetToolDescription
queryget_current_view_infoActive view metadata (type, level, scale, detail level).
queryget_selected_elementsCurrently selected elements with id, name, category, type.
queryget_available_family_typesFamily types in the project, filterable by category.
queryai_element_filterFilter by category + parameter + operator (values in mm).
queryanalyze_model_statisticsElement counts grouped by category.
queryget_material_quantitiesArea (m²) and volume (m³) for a category.
createcreate_line_based_elementWall or other line-based element.
createcreate_point_based_elementDoor, window, furniture or other point element.
createcreate_surface_based_elementFloor or ceiling from a polyline.
createcreate_levelLevel at elevation (mm).
createcreate_gridGrid line between two points (mm).
createcreate_roomRoom at a point, bound by walls.
modifyoperate_elementSelect, hide, unhide, isolate, or set-color on IDs.
modifycolor_elementsColor-code a category by parameter value (auto palette).
deletedelete_elementDelete by ID list (destructive; not MCP-undoable).
viewcreate_viewFloor plan or 3D view.
viewplace_view_on_sheetDrop a view onto a new or existing sheet.
viewanalyze_sheet_layoutTitle block + viewport positions and scales (mm).
exportexport_room_dataAll rooms: name, number, area, perimeter, level, volume.
annotationtag_all_wallsWall-type tags at midpoint (skips already-tagged).
annotationtag_all_roomsRoom tags at location point (skips already-tagged).
mepdetect_system_elementsTraverse connectors from a seed; return system members.
toolbakersend_code_to_revitRun ad-hoc C# body inside Revit after plugin-visible adaptive-bake opt-in.
toolbakerlist_baked_toolsList registered baked tools.
toolbakerrun_baked_toolInvoke a baked tool by name.
toolbakerlist_bake_suggestionsAdaptive-bake only: list local suggestions.
toolbakeraccept_bake_suggestionAdaptive-bake only: accept and apply a local suggestion.
toolbakerdismiss_bake_suggestionAdaptive-bake only: snooze or dismiss a local suggestion.
metashow_messageTaskDialog inside Revit — connection test or user notification.
metaswitch_targetSwitch the active Revit connection when multiple versions are running.
metabatch_executeRun N commands atomically in one TransactionGroup (single undo).
metaanalyze_usage_patternsUsage stats: tool call counts, sessions, errors (last N days).
lintanalyze_view_naming_patternsInfer dominant view-naming pattern + coverage + outliers.
lintsuggest_view_name_correctionsPropose corrected names for view outliers (inferred or profile-based).
lintdetect_firm_profileFingerprint project naming, match against firm-profile library.

Supported Revit versions

RevitTarget FrameworkTransportNotes
2022.NET 4.8TCPAccepted ToolBaker path smoke-tested
2023.NET 4.8TCPCore runtime coverage
2024.NET 4.8TCPCore runtime coverage
2025.NET 8 (net8.0-windows7.0)Named PipeFirst .NET 8 shell; core runtime coverage
2026.NET 8 (net8.0-windows7.0)Named PipeCore runtime coverage; accepted ToolBaker path smoke-tested
2027.NET 10 (net10.0-windows7.0)Named PipeAccepted ToolBaker path smoke-tested

Compile gate is 6/6. Core runtime coverage has passed on R23–R26, and manual smoke testing has now covered the accepted ToolBaker list/run/ribbon path on R22, R26, and R27. Treat that as practical runtime evidence, not a promise that every baked tool is portable across every Revit year; Revit API drift can still affect custom C# bodies.

Security

Short version: your model stays on your machine. The MCP server runs locally, the plugin runs inside your Revit process, they talk over localhost. That's the whole picture.

Longer version, for the people reviewing this for their org:

  • Loopback bind by default. TCP transport listens on 127.0.0.1 only. If you actually need LAN access, you have to set BIMWRIGHT_ALLOW_LAN_BIND=1 — I'd rather you knew you were turning it on.
  • Per-session token handshake. Every connection has to present a token written only to %LOCALAPPDATA%\Bimwright\portR<nn>.txt. Same-user attacker still wins (they can read the file). Anyone without read access to your user profile is out.
  • Schema validation before handlers run. Malformed tool calls get an error-as-teacher envelope (error, suggestion, hint) instead of crashing something.
  • Path masking on exceptions. If a handler throws, the MCP response and logs get sanitized — no absolute paths, no UNC shares, no user-home dirs.

Full threat model in the security appendix.

Configuration

Three layers, later wins: JSON file → env vars → CLI args.

SettingCLIEnvJSON key
Target Revit year--target R23BIMWRIGHT_TARGETtarget
Toolsets--toolsets query,createBIMWRIGHT_TOOLSETStoolsets
Read-only--read-onlyBIMWRIGHT_READ_ONLY=1readOnly
Allow LAN bindBIMWRIGHT_ALLOW_LAN_BIND=1allowLanBind
Allow ToolBaker when selected--enable-toolbaker / --disable-toolbakerBIMWRIGHT_ENABLE_TOOLBAKERenableToolbaker
Enable adaptive bake suggestionsBIMWRIGHT_ENABLE_ADAPTIVE_BAKE=1enableAdaptiveBake
Cache send-code bodies for clusteringBIMWRIGHT_CACHE_SEND_CODE_BODIES=1cacheSendCodeBodies

JSON file path: %LOCALAPPDATA%\Bimwright\bimwright.config.json.

Self-shaping toolkit

Adaptive bake is the opt-in path for turning repeated local Revit workflows into personal tools. It is default OFF. Enable it only when you want Bimwright to record local usage patterns and propose bake suggestions.

Usage data stays on the machine under %LOCALAPPDATA%\Bimwright\. The server is the sole SQLite writer; the Revit plugin reads bake.db and owns only the runtime command cache and ribbon buttons. No usage collection endpoint is involved.

Accepted baked tools are available through the Revit ribbon and the toolbaker indirection tools: call list_baked_tools to inspect your accepted tools, then run_baked_tool with name=<tool_name> to execute one. In v0.3.x, baked tools do not appear as separate native MCP tools. The accepted-tool path has been smoke-tested across R22, R26, and R27, including cross-version compatibility metadata updates.

bake_tool was removed in v0.3.0. New bakes come from measured suggestions and explicit user acceptance through accept_bake_suggestion; legacy accepted tools remain callable through list_baked_tools / run_baked_tool.

See docs/bake.md for enabling, privacy, suggestion handling, archive behavior, and cross-Revit compatibility notes.

Documentation

  • ARCHITECTURE.md — process model, transport, multi-version strategy, ToolBaker pipeline.
  • CONTRIBUTING.md — dev setup, build matrix, coding style.
  • docs/bake.md — adaptive bake opt-in, privacy, suggestions, accepted tools, and compat behavior.
  • docs/roadmap.md — v0.2 (MCP Resources, ToolBaker hardening), v0.3 (ToolBaker redesign, async job polling, aggregator listings), v1.0 (governance).

License

Apache-2.0. See LICENSE.

If you use it for something real, give the repo a star — helps others find it.

A bimwright project — bimwright

Keywords

mcp

FAQs

Package last updated on 27 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts