revit-tunnel-mcp
revit-tunnel MCP(独立セグメント V2)
これは既存の汎用 Revit MCP とは独立した専用 MCP です。Node.js stdio MCP、ローカルのみの pyRevit Routes インターフェース、および Revit 2025 API を通じて、Agent がシールドトンネルをプレビュー、作成、検証できるようにします。旧バージョンの「1 リングにつき 1 つの一体型ファミリ」は完全に維持されています。V2 では「1 セグメントにつき 1 つの独立ファミリコンポーネント」が新たに追加されています。
独立セグメントの機能
デフォルトレイアウトは
9A1K:各リングに A が 9 個(各 37.5°)と K が 1 個(22.5°)。デフォルトの 10 リングで、個別に選択、集計、フィルタリング、集計表化できる
Generic Modelsファミリインスタンスが 100 個作成されます。1〜50 リングに対応しますが、1 回の作成で最大 500 個の独立セグメントまでです。
外径、厚さ、リング幅、3D 始点、直線縦断勾配、および隣接リング間の正負交互千鳥配置に対応。
各リングには
RTM_SEG_HOST_*という名前の作業基準面が 1 つだけ作成され、同じリングのすべてのセグメントがそれを共有します。各セグメントには
batch-R0001-A01、batch-R0001-K01のような安定したマーキングがあります。バッチ作成は 1 つの Revit トランザクショングループでラップされます。ファミリまたはコンポーネントが失敗した場合、インスタンス、基準面、および今回新たにロードされたファミリは一緒にロールバックされます。
Related MCP server: Revit MCP Server
アップグレード可能なファミリコンテンツ
ファミリ名は、コンポーネントの役割、寸法、角度、コンテンツ構成、およびコンテンツバージョンによって決まります:
RTM_Segment_{role}_OD{outer}_T{thickness}_W{width}_S{spanMilliDeg}_{profile}_V{version}現在のコンテンツプロバイダーは basic バージョン 1 で、各ジオメトリに対して単純なリングセクターファミリを生成します。ファミリタイプの Type Comments には RTM_CONTENT:<hash> が保存されます。同名のファミリは、コンテンツハッシュが完全に一致する場合にのみ再利用されます。ハッシュがない場合やハッシュが異なる場合は競合が報告され、静かに上書きされることはありません。
したがって、将来セグメントに注入孔、ボルト孔、手孔、溝、または鉄筋表現を追加する場合、新しいコンテンツバージョンを公開できます。古いバッチは元のファミリバージョンに凍結されたままです。レイアウト、コンポーネント番号、Agent の呼び出しフローを書き換える必要はありません。
コンポーネント ID パラメータ
すべての独立セグメントファミリは、12 個の固定 GUID を持つインスタンス共有パラメータを使用します:
RTM_BatchId、RTM_UniqueIdRTM_RingIndex、RTM_SegmentIndexRTM_SegmentSlot、RTM_SegmentRoleRTM_LayoutIdRTM_ContentProfile、RTM_ContentVersionRTM_StartAngle、RTM_EndAngle、RTM_CenterAngle
固定 GUID により、将来の A、B、K ファミリや異なる精度バージョンでも、同じ集計表、フィルタ、タグを使用できます。
8 つの MCP ツール
独立セグメント V2:
list_tunnel_segment_catalog:レイアウトとコンテンツバージョンを一覧表示します。preview_tunnel_segments:読み取り専用で検証し、完全なセグメントごとの計画とプレビュートークンを返します。create_tunnel_segments:同じパラメータ、preview_token、およびconfirm=trueを要求して作成します。inspect_tunnel_segment_batch:読み取り専用で各コンポーネントの ID、ファミリバージョン、位置、向き、体積、およびホスト基準面を逆引きします。
維持されている一体型リング V1:
preview_tunnel_ringscreate_tunnel_ringsinspect_tunnel_batchget_tunnel_backend_status(V1/V2 共通)
推奨される呼び出し順序は次のとおりです:バックエンドの確認 → カタログの一覧表示 → プレビュー → ユーザー確認 → 作成 → バッチの検査。
将来の 6A+2B+1K への切り替え
レイアウトとファミリコンテンツはすでに階層化されています。今後 6A2B1K を追加する場合、バージョン管理されたカタログに 9 つのスロットと A/B/K の角度ルールを追加するだけで済みます。プレーサー、ID パラメータ、MCP ツール、検査インターフェースは変更されません。B のジオメトリが A と異なる場合、システムはその役割と角度に基づいて新しいファミリ仕様を自動的に解決します。
安全境界
Routes は
127.0.0.1:48884のみをリッスンし、LAN には公開されません。Node プレビューと pyRevit バックエンドはそれぞれ完全な計画を検証します。V2 はレイアウトサマリー、リングごとの位置、セグメントごとの角度、マーキング、ファミリ名、コンテンツハッシュも再計算します。
一体型リングと独立セグメントはグローバルな
batch_id名前空間を共有し、どちらかの側に既に存在する場合は重複作成を拒否します。現在、既存のバッチを削除、上書き、またはアップグレードするツールはありません。
既存の汎用 Revit MCP と
ShieldTunnel.extensionは変更されていません。
インストール
ソースコード:このリポジトリをクローンした後のプロジェクトディレクトリ
pyRevit 拡張機能:
%USERPROFILE%\Documents\pyRevit Extensions\RevitTunnelMcp.extensionCodex 設定:
%USERPROFILE%\.codex\config.tomlの[mcp_servers.revit_tunnel]
最初に Node.js 22 とプロジェクトの依存関係をインストールします:
npm install拡張機能を再インストールします:
& '.\scripts\install.ps1' -RoutesPort 48884インストールまたは変更後は、pyRevit を再ロード(または Revit を再起動)する必要があります。
検証とスモークテスト呼び出し
npm test
python -m pytest -q '.\pyrevit\tests'
node '.\scripts\smoke-test.mjs' --segments --inspect --batch-id=<批次>2 リングの独立セグメントテストバッチを作成します:
node '.\scripts\smoke-test.mjs' --segments --create --ring-count=2 --batch-id=segment-e2e-01一体型リングの旧バージョンの呼び出しには --segments を付けません。--create は現在の Revit プロジェクトを実際に変更するため、テストコピーまたは確認済みのプロジェクトでのみ使用してください。
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 surfaces, alignments, corridors and pipes in Civil 3D 2020–2027 on your PC. Needs Civil 3D MCP.
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.
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