Get the FREE Ultimate OpenClaw Setup Guide →

mcp -for-revit-dotnet

This is a mcp project by using c# full stack, also is a tutorial about how to use mcp in revit

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mcp-servers-for-revit-mcp-server-for-revit-dotnet dotnet NET.Mcp.Server/NET.Mcp.Server.dll \
  --env MCP_HOST="localhost" \
  --env MCP_PORT="5000" \
  --env MCP_LOG_LEVEL="info" \
  --env REVIT_VERSION_SUPPORT="2021;2023;2024;2025;2026"

How to use

This MCP server adapts the .NET MCP framework for Revit integration, enabling a single Function-Calling style interface to drive Revit automation through a standard MCP Server. The server is designed to run in a console-based (stdio) or HTTP-based transport, with Revit workflows typically using the stdio mode for local automation or a streaming transport for web-based control. Clients interact with the server through the MCP protocol, sending function-call specifications that map to Revit automation tasks (e.g., open a project, run a command, query model data) and receiving structured results. The README describes a .NET MCP framework that uses attributes like McpServerTool and McpServerToolType to expose Revit-related commands, enabling LLM-powered tool selection for BIM tasks. Typical usage involves starting the server and invoking Revit-related tools from a client (CLI, IDE, or LLM) via the MCP transport, then processing the returned results or logs in real time.

How to install

Prerequisites:

  • .NET 6.0+ SDK (or the version compatible with the project, as noted in the repository)
  • Revit installed (versions supported: 2021, 2023, 2024, 2025, 2026 as per README)
  • Basic familiarity with MCP framework and Revit add-in workflow

Installation steps:

  1. Install a .NET SDK supported by the project (example for Windows):
  2. Clone the repository:
    • git clone <repository-url>
  3. Build the .NET MCP server:
    • cd path/to/NET.Mcp.Server
    • dotnet restore
    • dotnet build -c Release
  4. Run the MCP server (stdio-based or HTTP-based transport as configured):
    • dotnet NET.Mcp.Server.dll
    • Or use a specific transport if configured (e.g., a wrapper script or MVVM tool) depending on your environment.
  5. Ensure prerequisites for Revit integration are present (Revit path, add-in setup as described in the repo).

Additional notes

Tips and notes:

  • The server supports Stdio for Revit integration, which is commonly used when launching from Revit or a local automation workflow.
  • If you switch to HTTP-based streaming, ensure proper port exposure and firewall rules (default port 5000 as suggested in env).
  • Environment variables can tailor logging, host/port, and Revit compatibility versions; adjust MCP_HOST, MCP_PORT, and REVIT_VERSION_SUPPORT as needed.
  • When upgrading Revit or the .NET MCP framework, re-validate tool bindings (McpServerTool) and ensure any custom commands reflect current Revit APIs.
  • For troubleshooting, enable verbose logging (MCP_LOG_LEVEL=debug) and inspect console output for tool selection and function invocation details.

Related MCP Servers

Sponsor this space

Reach thousands of developers