Revit MCP Server
MCP server for Autodesk Revit 2024/2025/2026/2027 via pyRevit — 48 tools for building design, editing, analysis, clash detection, MEP, interop, documentation, and model persistence.
README
Revit MCP Server
MCP server for Autodesk Revit 2024/2025/2026/2027 via pyRevit — 48 tools for building design, editing, analysis, clash detection, MEP, interop, documentation, and model persistence.
Works with any MCP client: Claude Desktop, Claude Code, Cursor, Windsurf, Copilot, or any other MCP-compatible application.
Canon Runtime
As of 2026-07-17, the canonical local MCP runtime is:
uv run main_pipe.py
main_pipe.py= stdio MCP bridge over Windows Named Pipe\\.\pipe\revit-mcpmain.py= legacy HTTP fallback bridge to pyRevit Routes on:48884
Use main.py only when pipe diagnostics or compatibility require it.
How It Works
AI Client ──stdio/SSE/HTTP──> MCP Server (Python/FastMCP) ──Named Pipe/HTTP──> pyRevit Runtime ──> Revit API
The MCP server runs on your machine and communicates with Revit through pyRevit's Routes API. Any MCP-compatible AI client can connect to it.
Prerequisites
| Requirement | Details |
|---|---|
| Windows 10/11 | Revit is Windows-only |
| Autodesk Revit | 2024, 2025, 2026, or 2027 |
| pyRevit | Installed and loaded in Revit |
| uv | Python package manager (install) |
| A project open in Revit | Tools require an active document |
Install pyRevit (if not already installed)
pyRevit is a free add-in that lets scripts run inside Revit. This MCP server needs it to communicate with Revit.
- Go to https://github.com/pyrevitlabs/pyRevit/releases
- Download the latest .exe installer (e.g.
pyRevit_CLI_x.x.x.x_admin_signed.exe) - Run the installer — accept all defaults, click Next through each screen
- Open (or restart) Revit — you should see a pyRevit tab in the ribbon at the top
- In the pyRevit tab, click Settings (gear icon)
- In the Settings window, go to the Routes section on the left
- Check the box to Enable Routes Server
- Click Save Settings and let pyRevit reload
To verify: open a browser and go to http://localhost:48884/ — you should see a response (not a "connection refused" error).
Quick Start
Step 1: Clone and install
git clone https://github.com/Demolinator/revit-mcp-server.git
cd revit-mcp-server
uv sync
Step 2: Install the pyRevit extension
The revit_mcp/ folder and startup.py need to run inside Revit via pyRevit.
Option A — Install from pyRevit (recommended):
- In Revit, go to pyRevit tab > Extensions
- Find "MCP Server for Revit Python" > Install
- Wait for pyRevit to reload
Option B — Manual install:
- Copy the entire repo folder to
%APPDATA%\pyRevit\Extensions\ - Rename the folder to
mcp-server-for-revit-python.extension - In Revit, go to pyRevit tab > Settings > Custom Extensions
- Add the path to the
.extensionfolder - Reload pyRevit (or restart Revit)
Step 3: Activate pyRevit Routes
- In Revit, go to pyRevit tab > Settings
- Navigate to Routes > activate Routes Server
- pyRevit will start listening on
http://localhost:48884/
Step 4: Verify connection
Open a browser and go to:
http://localhost:48884/revit_mcp/status/
You should see:
{
"status": "active",
"health": "healthy",
"revit_available": true,
"document_title": "your_project_name",
"api_name": "revit_mcp"
}
Step 5: Start the MCP server
uv run main_pipe.py
That's it. Your AI client can now connect.
Legacy fallback
uv run main.py
Use only if the pipe path is unavailable and HTTP :48884 is intentionally being used as fallback.
Connecting Your AI Client
Claude Desktop / Claude Code
Add to your MCP config:
{
"mcpServers": {
"revit": {
"command": "uv",
"args": ["run", "main_pipe.py"],
"cwd": "/path/to/revit-mcp-server"
}
}
}
Cursor / Windsurf / Other MCP Clients
Use HTTP transport:
uv run main_pipe.py --streamable-http
Then configure your client to connect to http://localhost:8000/mcp.
Transport Modes
| Flag | Transport | Endpoints | Use Case |
|---|---|---|---|
| (none) | stdio | stdin/stdout | Claude Desktop / Claude Code |
--sse |
SSE | /sse, /messages/ |
Legacy clients |
--streamable-http |
HTTP | /mcp |
HTTP-based clients |
--combined |
Both | All above | Maximum compatibility |
Testing with MCP Inspector
mcp dev main_pipe.py
Then open http://127.0.0.1:6274 in your browser.
Supported Tools (48)
Create (15)
| Tool | Description |
|---|---|
create_level |
Create new levels with elevations |
create_line_based_element |
Create walls, beams, and other line-based elements |
create_surface_based_element |
Create floors, roofs, and surface elements |
place_family |
Place a family instance at specified location |
create_grid |
Create column grid lines |
create_structural_framing |
Create structural beams and framing |
create_sheet |
Create new drawing sheets |
create_schedule |
Create schedules with custom fields |
create_room |
Create rooms at specified levels |
create_room_separation |
Create room separation boundary lines |
create_duct |
Create ducts between two points (MEP) |
create_pipe |
Create pipes between two points (MEP) |
create_mep_system |
Create mechanical or piping systems |
create_detail_line |
Create view-specific detail lines |
create_view |
Create floor plans, sections, elevations, 3D views |
Query (12)
| Tool | Description |
|---|---|
get_revit_status |
Check if the API is active and responding |
get_revit_model_info |
Get model information |
list_levels |
Get all levels with elevations |
list_families |
Get available family types |
list_family_categories |
Get all family categories |
get_revit_view |
Export a view as an image |
list_revit_views |
List all exportable views |
get_current_view_info |
Get active view details |
get_current_view_elements |
Get elements in current view |
get_selected_elements |
Get currently selected elements |
list_category_parameters |
List parameters for a category |
get_element_properties |
Get all parameters and properties of an element |
Modify (8)
| Tool | Description |
|---|---|
delete_elements |
Delete elements from the model |
modify_element |
Modify element parameter values |
color_splash |
Color elements by parameter values |
clear_colors |
Reset element colors |
tag_walls |
Tag all walls in current view |
set_parameter |
Set a single parameter value on an element |
tag_elements |
Tag specific elements with annotation symbols |
transform_elements |
Move, copy, rotate, or mirror elements |
set_active_view |
Switch the active view in Revit |
Analyze (5)
| Tool | Description |
|---|---|
ai_element_filter |
Filter elements by category and parameters |
export_room_data |
Export room areas, volumes, boundaries |
get_material_quantities |
Material takeoff data |
check_clashes |
Detect hard clashes (interferences) between disciplines, e.g. structure vs MEP |
analyze_model_statistics |
Element counts and model stats |
Document (3)
| Tool | Description |
|---|---|
create_dimensions |
Create dimension annotations |
export_document |
Export views to PDF or image |
Interop & Persistence (4)
| Tool | Description |
|---|---|
export_ifc |
Export model to IFC format (IFC2x3/IFC4) |
link_file |
Link or import DWG, DXF, DGN, SAT, SKP, 3DM, or RVT files |
load_family |
Load a Revit family (.rfa) from disk so its types can be placed |
save_document |
Save / Save-As the model to disk (persistence across sessions) |
Advanced (1)
| Tool | Description |
|---|---|
execute_revit_code |
Execute IronPython code in Revit context |
Architecture
Two runtimes communicate over HTTP:
| Component | Runtime | Location | Purpose |
|---|---|---|---|
main_pipe.py + tools/ |
Python 3.11+ (CPython) | Your machine | Canon MCP protocol bridge over Named Pipe |
main.py + tools/ |
Python 3.11+ (CPython) | Your machine | Legacy HTTP fallback bridge |
startup.py + revit_mcp/ |
IronPython 2.7 (inside Revit) | Revit process | pyRevit route handlers, Revit API |
Multi-Version Revit Support
This server supports Revit 2024, 2025, 2026, and 2027 through centralized helper functions that handle the ElementId API differences across versions:
get_element_id_value()— Extracts integer IDs using.Value(2024+) with.IntegerValuefallbackmake_element_id()— Creates ElementIds usingSystem.Int64(2024+) withintfallback
No configuration needed — version detection is automatic via try/except at runtime.
Revit 2027 note: Revit 2027 runs on .NET 10 (vs .NET 8 in 2025/2026). This MCP server is pyRevit-based, so .NET compatibility is handled by pyRevit itself — ensure you run a pyRevit build with Revit 2027 support. None of the 48 tools use APIs removed in 2027 (AXM/FormIt import,
Mechanical.Zonemembers, legacy rebar creation, or the droppedEnergyDataSettingsproperties).
Unit Handling
All tools accept millimeters (mm). The server converts to Revit's internal feet.
| From | To mm |
|---|---|
| meters | x 1000 |
| feet | x 304.8 |
| inches | x 25.4 |
Creating Your Own Tools
Adding a new tool requires 2 files + 2 registration lines:
- Route handler in
revit_mcp/new_module.py(IronPython 2.7) - Tool definition in
tools/new_tools.py(Python 3.11+) - Register routes in
startup.py - Register tools in
tools/__init__.py
See LLM.txt for full context that helps AI assistants understand the codebase.
Development Workflow: Editing & Reloading Routes
The MCP server has two layers:
- FastMCP (
tools/,main_pipe.py) — runs in your AI client process. Changes apply on next client restart. - pyRevit Routes (
revit_mcp/,startup.py) — runs inside Revit via pyRevit. Changes require a sync + reload.
Typical Edit → Test Cycle
-
Edit code in repo (e.g.,
revit_mcp/view_management.pyortools/view_management_tools.py) -
Sync to pyRevit (Windows PowerShell):
D:\GitHub\revit-mcp-server\sync_to_pyrevit.ps1→ Copies
revit_mcp/andtools/to your active pyRevit extension folder. -
Reload pyRevit (via MCP tool
execute_revit_code):from pyrevit.loader import sessionmgr sessionmgr.reload_pyrevit()→ Takes ~90s. May return "Error: " vacío — that's normal (reloads kill active requests).
-
Verify your changes:
- Endpoint routes (
POST /refresh_view/, etc.): test immediately post-reload viacurlorInvoke-RestMethod - MCP tools (new
refresh_view(), etc.): visible in next MCP client session (stdio restarts after Revit reload)
- Endpoint routes (
Example: Adding refresh_view (2026-07-03)
1. Added refresh_view_handler route to revit_mcp/view_management.py
2. Added refresh_view tool to tools/view_management_tools.py
3. Ran sync_to_pyrevit.ps1 → copied both files to %APPDATA%\pyRevit\Extensions\
4. Called reload_pyrevit() via execute_revit_code
5. POST http://localhost:48884/revit_mcp/refresh_view/ → {"status":"refreshed",...}
6. Next MCP session → tool refresh_view() available in Claude/Cursor/etc.
Contributing
Contributions are welcome! Feel free to submit pull requests or open issues.
Author
Talal Ahmed
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。