Visitar URL original
Protocol | RevitDevTool
Skip to main content

Protocol

The Model Context Protocol (MCP) is a standard way for an AI client to discover and use capabilities exposed by a server. RevitDevTool uses the protocol to connect an AI client to running Revit or AutoCAD-family hosts.

  • MCP
  • Cursor
  • Claude
  • GitHub Copilot
  • CodexCodex
Any MCP 2.0 client

Any client that supports MCP 2.0 can connect. Read the latest protocol specification.

Official SDKs​

RevitDevTool pins the SDK versions used by its two toolset entry points:

SDKPinned versionOfficial documentation
.NET SDK2.3.0C# SDK Getting Started · C# SDK repository
Python SDK2.3.0Python SDK documentation · Python SDK repository

For the protocol itself, see the official MCP specification.

Core concepts​

MCP conceptMeaning
ClientThe AI application, such as Cursor, Claude, GitHub Copilot or Codex
ServerThe local RevitDevTool MCP service that connects the client to hosts
ToolAn operation the client can call, such as querying a model or opening a document
ResourceReadable context identified by a URI, such as model state or an API cheatsheet
PromptA reusable instruction template exposed to the client

The normal user-facing flow is: connect the client, list running hosts, then write one code_mode program that searches the host's capabilities, calls the best match, and returns only the result you need.

The MCP view​

The MCP toggle in the panel shows a list of every tool the host can offer: the built-in ones and those from the .NET and Python toolsets you load. It shows how many tools each source provides, how often each was called, and lets you search by name.

MCP view listing built-in, .NET and Python tools

Use Load .NET Toolset and Load Python Toolset at the bottom to add a toolset.

Settings only lists and removes sources

Toolsets are added from the MCP view. Settings → MCP lists the sources you have loaded under Custom Loaded Sources and lets you remove them.

MCP settings listing custom loaded sources

Tools your client sees​

The MCP service exposes a small, fixed tool list:

ToolPurpose
list_processesShow running Revit and AutoCAD-family instances
launch_hostStart a supported host instance
read_file_infoRead metadata and a safe summary for a local file
code_modeRun a short C# program that searches, describes, invokes, and reads host capabilities

The list does not change when you register toolsets. Host and toolset capabilities are reached from inside code_mode, not added to the client's tool list.

Host capabilities​

code_mode searches the catalog of the selected host. Typical built-in capabilities are:

CapabilityPurpose
execute_csharp_codeRun C# code in the host context
execute_python_codeRun Python code in the host context
open_documentOpen a document in the host
navigate_historyMove backward or forward through supported model changes
view_screenshotCapture the current host view for visual inspection

Specialized capabilities and registered toolsets are preferred over the code-execution fallbacks. Pass readOnly: true to code_mode to block any capability that is not marked read-only. The exact entries depend on which host is running and which toolsets are registered.

Default resources​

RevitDevTool provides host reference and context resources. The available set depends on the connected host:

HostResource URIPurpose
Revitrevit://python-cheatsheetRevit Python usage guidance
Revitrevit://csharp-cheatsheetRevit C# usage guidance
Revitrevit://model/contextCurrent model context and summary
Revitrevit://model/warningsCurrent model warnings
Revitrevit://versionHost and API version information
AutoCAD-familyacad://python-cheatsheetAutoCAD Python usage guidance
AutoCAD-familyacad://csharp-cheatsheetAutoCAD C# usage guidance

These resources are read-only context. Registered .NET or Python toolsets may add additional tools and resources for their own domain.

Default prompts​

The local service exposes:

  • revit_code for Revit code-generation guidance;
  • acad_code for AutoCAD-family code-generation guidance.

.NET and Python toolsets​

RevitDevTool accepts both compiled .NET assemblies and Python toolset folders containing a *mcp.py entry file. The entry file carries its own PEP 723 dependency metadata; its capabilities appear alongside the defaults when the relevant host is running.

Use MCP .NET or MCP Python for registration guidance.