MCP ExplorerExplorer

Revit Mcp Templates

@revit-mcpon 10 months ago
3 MIT
FreeCommunity
AI Systems
A template for developing Revit commands using the revit-mcp protocol.

Overview

What is Revit Mcp Templates

Revit MCP Templates is a standard template for developing Revit commands based on the revit-mcp protocol. It provides a structured environment for developers to quickly set up command development without starting from scratch.

Use cases

Use cases include developing custom commands for Revit, integrating AI conversation clients with Revit, and enhancing Revit’s functionality through automated commands.

How to use

To use Revit MCP Templates, install the template using the command ‘dotnet new --install revit-mcp-templates’. Create a new project via command line with ‘dotnet new revitmcp -n YourProjectName’ or through Visual Studio by selecting ‘Revit MCP Development Template’ from the templates list.

Key features

Key features include a basic project structure, references to necessary SDKs, a sample command ‘say_hello’, and a straightforward setup process for command development.

Where to use

Revit MCP Templates are used in the field of software development, specifically for creating commands that interact with Autodesk Revit software through the MCP protocol.

Content

Revit MCP Command Development Template

English | 简体中文

This is a standard template for developing Revit commands based on the revit-mcp protocol. By using this template, you can quickly set up a command development environment without configuring the project structure from scratch.

Project Overview

This template provides the basic structure and configuration needed for developing Revit commands, including:

  • References to revit-mcp-sdk (version 1.0.0-beta.1)
  • A sample command “say_hello” demonstrating how to create a basic Revit command

This template is mainly used for developing commands that conform to the revit-mcp project. revit-mcp is a framework that implements the mcp protocol based on Autodesk Revit software, allowing AI conversation clients compatible with the mcp protocol to drive Revit.

Requirements

  • .NET Framework 4.8
  • Visual Studio 2019 or newer

Dependencies

  • Revit_API_x64 (2024.0.2) - Revit API NuGet package
  • revit-mcp-sdk (1.0.0-beta.1)
  • Newtonsoft.Json (13.0.3)

Project Structure

Standard/
├── Commands/             # Folder for command classes
│   ├── SayHelloCommand.cs      # Sample command class
│   └── SayHelloEventHandler.cs # Command event handler
├── Models/               # Folder for data models
├── Utils/                # Folder for utility classes
├── Properties/           # Assembly properties
├── Standard.csproj       # Project file
└── packages.config       # NuGet package configuration

How to Use

Install Template

dotnet new --install revit-mcp-templates

Create New Project

Using Command Line

dotnet new revitmcp -n YourProjectName

Using Visual Studio

  1. Open Visual Studio
  2. Select “Create a new project”
  3. Search for “Revit MCP” in the templates list
  4. Select “Revit MCP Development Template”
  5. Specify a name and location for your project, then click “Create”

Add New Commands

  1. Create new command classes and corresponding event handlers in the Commands folder
  2. Command classes should inherit from ExternalEventCommandBase
  3. Event handlers should implement the IExternalEventHandler and IWaitableExternalEventHandler interfaces

Sample Command and Cleanup

The project includes a sample command named “say_hello” that displays a simple dialog box when executed. This is a basic example showing how to create and use MCP-based Revit commands.

In actual development, you can delete the sample command files (SayHelloCommand.cs and SayHelloEventHandler.cs) and add your own command implementations.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers