revit-tunnel-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@revit-tunnel-mcp preview 10 rings of 9A1K tunnel segments"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
revit-tunnel MCP (Independent Segments V2)
This is a dedicated MCP independent of the existing general-purpose Revit MCP. It lets an Agent preview, create, and verify shield tunnels through a Node.js stdio MCP, a local-only pyRevit Routes interface, and the Revit 2025 API. The legacy "one family per ring" approach is fully preserved; V2 adds "one independent family instance per segment."
Independent Segment Capabilities
Default layout is
9A1K: 9 A segments (37.5° each) and 1 K segment (22.5°) per ring.The default 10 rings create 100
Generic Modelsfamily instances that can be individually selected, scheduled, filtered, and tabulated.Supports 1–50 rings, but any single creation is capped at 500 independent segments.
Supports outer diameter, thickness, ring width, 3D start point, straight-line longitudinal slope, and alternating positive/negative staggered joints between adjacent rings.
Each ring creates only one named work plane,
RTM_SEG_HOST_*, shared by all segments in that ring.Every segment has a stable marker, e.g.
batch-R0001-A01,batch-R0001-K01.Batch creation is wrapped in a single Revit transaction group; if any family or element fails, the instances, work planes, and newly loaded families in this batch are rolled back together.
Related MCP server: Revit MCP Server
Upgradable Family Content
The family name is determined by the segment role, dimensions, angles, content profile, and content version:
RTM_Segment_{role}_OD{outer}_T{thickness}_W{width}_S{spanMilliDeg}_{profile}_V{version}The current content provider is basic version 1, which generates one simple annular sector family per geometry. The family type's Type Comments stores RTM_CONTENT:<hash>. Families with the same name are reused only when the content hash matches exactly; a missing or mismatched hash reports a conflict and is never silently overwritten.
Therefore, when adding grout holes, bolt holes, hand holes, grooves, or rebar representation to segments in the future, a new content version can be published. Old batches remain frozen on their original family version; the layout, element numbering, and Agent invocation flow do not need to change.
Element Identity Parameters
All independent segment families use 12 instance shared parameters with fixed GUIDs:
RTM_BatchId,RTM_UniqueIdRTM_RingIndex,RTM_SegmentIndexRTM_SegmentSlot,RTM_SegmentRoleRTM_LayoutIdRTM_ContentProfile,RTM_ContentVersionRTM_StartAngle,RTM_EndAngle,RTM_CenterAngle
The fixed GUIDs mean future A, B, and K families, as well as different precision versions, can still use the same schedules, filters, and tags.
Eight MCP Tools
Independent segments V2:
list_tunnel_segment_catalog: lists layouts and content versions.preview_tunnel_segments: read-only validation that returns the full per-segment plan and a preview token.create_tunnel_segments: requires the same parameters,preview_token, andconfirm=truebefore creating.inspect_tunnel_segment_batch: read-only reverse lookup of each element's identity, family version, position, orientation, volume, and hosting work plane.
Preserved whole-ring V1:
preview_tunnel_ringscreate_tunnel_ringsinspect_tunnel_batchget_tunnel_backend_status(shared by V1/V2)
The recommended call order is: check backend → list catalog → preview → user confirmation → create → inspect batch.
Future Switch to 6A+2B+1K
The layout and family content are already layered. When 6A2B1K is added later, only 9 slots and the A/B/K angle rules need to be added to the versioned catalog; the placer, identity parameters, MCP tools, and inspection interface remain unchanged. If B's geometry differs from A's, the system automatically resolves the new family spec by role and angle.
Safety Boundaries
Routes listens only on
127.0.0.1:48884and is not exposed to the LAN.The Node preview and the pyRevit backend each validate the full plan independently; V2 also recomputes the layout summary, per-ring positions, per-segment angles, markers, family names, and content hashes.
Whole rings and independent segments share the global
batch_idnamespace; duplicate creation is rejected if either side already exists.There are currently no tools to delete, overwrite, or upgrade existing batches.
The existing general-purpose Revit MCP and
ShieldTunnel.extensionare both unmodified.
Installation
Source: the project directory after cloning this repository
pyRevit extension:
%USERPROFILE%\Documents\pyRevit Extensions\RevitTunnelMcp.extensionCodex config:
[mcp_servers.revit_tunnel]in%USERPROFILE%\.codex\config.toml
First install Node.js 22 and the project dependencies:
npm installReinstall the extension:
& '.\scripts\install.ps1' -RoutesPort 48884After installing or modifying, reload pyRevit (or restart Revit).
Verification and Smoke Calls
npm test
python -m pytest -q '.\pyrevit\tests'
node '.\scripts\smoke-test.mjs' --segments --inspect --batch-id=<批次>Create a two-ring independent segment test batch:
node '.\scripts\smoke-test.mjs' --segments --create --ring-count=2 --batch-id=segment-e2e-01The legacy whole-ring calls do not use --segments. --create actually modifies the current Revit project and should only be used on a test copy or a confirmed project.
Available Tools
8 toolscreate_tunnel_rings创建盾构隧道整体管片环AIdempotent
使用预览令牌在当前 Revit 项目中创建整体族管片环;不删除或覆盖已有元素。
Inputs: confirm (required), preview_token (required), batch_id, ring_count, +8 more.
create_tunnel_segments创建盾构隧道独立管片AIdempotent
使用预览令牌在当前 Revit 项目中为每块管片创建独立族构件;不删除或覆盖已有元素。
Inputs: confirm (required), preview_token (required), batch_id, layout_id, +11 more.
get_tunnel_backend_status检查 Revit 隧道后端ARead-onlyIdempotent
检查 pyRevit 隧道接口、Revit 版本和当前活动项目。
Inputs: no named parameters.
inspect_tunnel_batch核验 Revit 隧道批次BRead-onlyIdempotent
按批次标识反查整体环、族、标记、包围盒、体积和定向基准;不会修改 Revit。
Inputs: batch_id (required).
inspect_tunnel_segment_batch核验 Revit 独立管片批次ARead-onlyIdempotent
按批次标识反查每块独立管片的身份、族版本、位置、定向、包围盒和体积;不会修改 Revit。
Inputs: batch_id (required).
list_tunnel_segment_catalog列出盾构隧道管片目录ARead-onlyIdempotent
列出可用管片布局、角色、角度以及族内容配置和版本;不会修改 Revit。
Inputs: no named parameters.
preview_tunnel_rings预览盾构隧道整体管片环ARead-onlyIdempotent
校验整体环参数并返回每环位置和预览令牌;此工具不会修改 Revit。
Inputs: batch_id, ring_count, start_x_mm, start_y_mm, +6 more.
preview_tunnel_segments预览盾构隧道独立管片ARead-onlyIdempotent
校验布局、族版本、线形与尺寸,返回每块独立管片的完整计划和预览令牌;不会修改 Revit。
Inputs: batch_id, layout_id, ring_count, start_x_mm, +9 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct resource (catalog, backend status, segments, rings) and action (list, get, preview, inspect, create). Preview vs. inspect are clearly differentiated: preview validates and returns tokens, while inspect returns detailed properties by batch ID.
All tool names follow a consistent verb-noun snake_case pattern, using verbs like list, get, preview, inspect, and create paired with clear nouns (tunnel_segment_catalog, tunnel_segments, tunnel_rings). Minor variations like segment_batch vs batch still follow the same style.
8 tools is well within the ideal range and each tool earns its place, covering catalog, status, preview, inspect, and create for two related domain objects (segments and rings). No redundant or missing tools at the surface level.
The server covers the full preview->create->inspect lifecycle for both tunnel segments and rings, plus backend status and catalog listing. Missing update/delete operations are not critical for a creation-focused server, but could be a minor gap if modifications are needed.
Maintenance
Related MCP Connectors
AI for Revit: 450+ tools, 1 undo step. Windows, Revit 2024–2027 (2021–2023 included). Free account.
Read and edit the Revit 2024–2027 model on your PC. Needs the free Revit MCP add-in.
AI clash detection in Navisworks Manage 2025–2027 on your PC. Needs the free plug-in.
Build, check and report on MIDAS CIVIL NX bridge models and design tendons, with MIDAS IT plugins.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Autodesk Revit to query project data, manage elements, and execute generated code via the Model Context Protocol. It provides full compatibility with GitHub Copilot and Claude to automate BIM modeling workflows.13MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to interact with Autodesk Revit for building design, editing, analysis, clash detection, MEP, interop, documentation, and model persistence via 48 tools.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to connect to Revit 2024 via MCP, inspect documents and selections, query and modify elements, and validate, preview, or commit plans with audit logging and rollback.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with CAD software through semantic spatial topology and architectural ontology, supporting drawing, block/layer/entity management, and safe preview-apply transaction workflows for AutoCAD, ZWCAD, GstarCAD, and BricsCAD.1Apache 2.0