A Model Context Protocol server for Revit integration, enabling seamless communication between Claude AI and Autodesk Revit.
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
- π‘ 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
-
π 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
- Node.js (v14 or higher)
- npm
- Autodesk Revit (2023 or later)
- Revit WebSocket Plugin (companion plugin)
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchThe server can be configured using environment variables:
REVIT_HOST=127.0.0.1 # Revit plugin WebSocket host
REVIT_PORT=8080 # Revit plugin WebSocket port
Add the server configuration to Claude Desktop:
Windows:
%APPDATA%/Claude/claude_desktop_config.jsonConfiguration format:
{
"mcpServers": {
"revit-mcp-server": {
"command": "D:/path/to/revit-mcp-server/build/index.js"
}
}
}For debugging the MCP communication:
- Use the built-in MCP Inspector:
npm run inspector- Monitor WebSocket communication with Revit plugin
- Check server logs for connection and operation status
The server implements robust error handling:
- Automatic fallback to mock data when Revit connection fails
- Detailed error logging
- Graceful connection recovery
MIT License
Contributions are welcome! Please feel free to submit pull requests.
If you have any questions or suggestions, feel free to reach out:
- π§ Email:
353554036@qq.com - π¬ WeChat Account: modian4500