https://github.com/samllpigyandong/revit_mcp
Revit MCP. A Model Context Protocol server for Revit integration, enabling seamless communication between Claude AI and Autodesk Revit.
https://github.com/samllpigyandong/revit_mcp
Last synced: 3 months ago
JSON representation
Revit MCP. A Model Context Protocol server for Revit integration, enabling seamless communication between Claude AI and Autodesk Revit.
- Host: GitHub
- URL: https://github.com/samllpigyandong/revit_mcp
- Owner: SamllPigYanDong
- License: mit
- Created: 2025-04-07T08:12:17.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-15T03:20:35.000Z (7 months ago)
- Last Synced: 2025-06-17T13:11:33.551Z (4 months ago)
- Language: TypeScript
- Homepage: https://samllpigyandong.github.io/revit_mcp/
- Size: 27.3 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ποΈ Revit MCP Server
A Model Context Protocol server for Revit integration, enabling seamless communication between Claude AI and Autodesk Revit.
[English](./README.md) | [δΈζ](./README.zh-CN.md)
## π― Overview
This TypeScript-based MCP server provides a bridge between Claude AI and Revit, allowing direct interaction with Revit models through a WebSocket connection. It implements the Model Context Protocol to enable:
- β‘ Real-time access to Revit model information
- π Element querying and filtering
- π View and level management
- π‘οΈ Robust error handling with fallback mock data
## β¨ Features
### π Revit Integration
- π‘ WebSocket-based communication with Revit plugin
- π Real-time model data access
- π Graceful fallback to mock data when connection fails
- βοΈ Configurable connection settings via environment variables
### π Core Functionalities
- **π Model Information**
- Access basic model metadata (name, path, version)
- Get element counts and last modification date
- Real-time model state synchronization
- **ποΈ Element Management**
- Query elements with flexible filtering
- Access element properties and geometry
- Batch element operations
- **πͺ View & Level Control**
- List all available views
- Access level information
- Navigate through model hierarchy
## π» Development
### π Prerequisites
- Node.js (v14 or higher)
- npm
- Autodesk Revit (2023 or later)
- Revit WebSocket Plugin (companion plugin)
### π§ Installation
Install dependencies:
```bash
npm install
```
Build the server:
```bash
npm run build
```
For development with auto-rebuild:
```bash
npm run watch
```
### βοΈ Configuration
The server can be configured using environment variables:
```plaintext
REVIT_HOST=127.0.0.1 # Revit plugin WebSocket host
REVIT_PORT=8080 # Revit plugin WebSocket port
```
## π Integration with Claude Desktop
Add the server configuration to Claude Desktop:
Windows:
```bash
%APPDATA%/Claude/claude_desktop_config.json
```
Configuration format:
```json
{
"mcpServers": {
"revit-mcp-server": {
"command": "D:/path/to/revit-mcp-server/build/index.js"
}
}
}
```
### π Debugging
For debugging the MCP communication:
1. Use the built-in MCP Inspector:
```bash
npm run inspector
```
2. Monitor WebSocket communication with Revit plugin
3. Check server logs for connection and operation status
## β οΈ Error Handling
The server implements robust error handling:
- Automatic fallback to mock data when Revit connection fails
- Detailed error logging
- Graceful connection recovery
## π License
MIT License
## π€ Contributing
Contributions are welcome! Please feel free to submit pull requests.
## π¬ Contact
If you have any questions or suggestions, feel free to reach out:
- π§ Email: 353554036@qq.com
- π¬ WeChat Account: modian4500