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
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:
- Install a .NET SDK supported by the project (example for Windows):
- Visit https://dotnet.microsoft.com/download and install the latest LTS/SDK version.
- Clone the repository:
- git clone <repository-url>
- Build the .NET MCP server:
- cd path/to/NET.Mcp.Server
- dotnet restore
- dotnet build -c Release
- 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.
- 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
mssql
MSSQL Server MCP implementation written in C#
McpDotNet.Extensions.SemanticKernel
Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.
DatabaseMcpServer
MCP server from ttcc666/DatabaseMcpServer
mcp-dataverse
MCP Server for querying Dataverse using SQL
xperience-community
ASP.NET Core MCP server for Xperience by Kentico projects
console-to-http
Example of converting a stdio MCP server to HTTP using ModelContextProtocol.AspNetCore