pyRevit Foundry MCP
MCP server for developing and maintaining pyRevit extensions with static analysis, including scanning layout, import auditing, duplicate detection, and automated bundle.yaml generation, without requiring Revit runtime.
README
pyRevit Foundry MCP
MCP server for developing and maintaining pyRevit extensions. Static analysis only, no Revit runtime required.
License: GPL-3.0 (same as pyRevit). See LICENSE. Contributing: CONTRIBUTING.md.
What it does
- Scan extension layout – Inventory bundles, scripts, bundle.yaml
- Generate bundle.yaml – Infer title/tooltip from
__title__/docstring for missing bundles - Import audit – Unused imports, raw RevitAPI usage, pyRevit wrapper suggestions (with core clone)
- Duplicate detection – Function-level duplicate code across scripts
- Lib structure – Propose
lib/module tree from duplicates (report-only) - Patch engine – Unified diffs, dry-run by default
Quickstart
Install
pip install -e .
# or: uv pip install -e .
Run MCP server (stdio)
pyrevit-foundry
# or: python -m foundry_mcp.server
Cursor MCP config
Add to .cursor/mcp.json:
{
"mcpServers": {
"pyrevit-foundry": {
"command": "pyrevit-foundry",
"args": [],
"cwd": "D:/path/to/your/pyrevit-extension-repo"
}
}
}
Or use uv:
{
"mcpServers": {
"pyrevit-foundry": {
"command": "uv",
"args": ["run", "pyrevit-foundry"],
"cwd": "D:/path/to/your/pyrevit-extension-repo"
}
}
}
Repo layout
foundry_core/– indexers, analyzers, extension creator (no MCP deps)foundry_mcp/– MCP server and toolstests/– pytest.pyrevit-foundry.tomlis gitignored; copy from.pyrevit-foundry.toml.examplefor local core path.
pyRevit core clone (optional)
For wrapper/import suggestions, point to a local pyRevit core clone:
Option 1: .pyrevit-foundry.toml in repo root (copy from .pyrevit-foundry.toml.example):
pyrevit_core_path = "D:/path/to/pyrevit-clone"
Option 2: Pass core_root to import_audit_with_core tool.
Tools
| Tool | Description |
|---|---|
run_health_check |
One-shot overview – scan, bundle.yaml, extensions.json, import audit, duplicates, IronPython |
scan_extension_layout |
Full inventory (summary_only, limit_bundles, limit_py_files) |
list_missing_bundle_yaml |
Bundles without bundle.yaml (optional for pushbuttons; recommended) |
generate_bundle_yaml |
Create bundle.yaml for bundles that lack it (dry_run | write) |
validate_extensions_json |
Validate extensions.json schema |
suggest_extensions_json_dependencies |
Suggest deps from imports |
import_audit_with_core |
Unused imports, raw API, wrapper suggestions |
analyze_duplicates |
Duplicate clusters (limit, summary_only) |
ironpython_audit |
f-strings, type hints, walrus, match (IronPython 2.7 incompat) |
propose_lib_structure |
Lib module proposals |
extract_to_lib |
Extract duplicates to lib/ and patch scripts (dry_run | write) |
apply_patch |
Apply patches (dry_run | write) |
create_extension_config_tool |
Create config template for extension (run first, user fills, then create_extension) |
get_extension_config_template_tool |
Return config template content (no file) |
create_extension |
Create extension from config_path or inline params |
add_button |
Add a single pushbutton to an existing extension |
Resources vs tools
Use resources when the client supports MCP resources and you need:
foundry://repo/tree– Full inventory JSON (for context loading)foundry://repo/py_files– List of scriptsfoundry://repo/file/{path}– Read a file by relative pathfoundry://repo/health– Quick health summary (bundles, missing yaml, ext_json issues)foundry://core/version_info– pyRevit core git shafoundry://core/index– Core module/symbol index
Use tools when you need to:
- Run analyses (health check, import audit, duplicates, IronPython)
- Generate or apply changes (bundle.yaml, extract_to_lib, patches)
- Validate or suggest (extensions.json)
Tip: Start with run_health_check or foundry://repo/health for a quick overview, then drill down with specific tools.
Safety
- Default: dry-run – No file writes unless
mode="write" - Patches are minimal and reversible
- No f-strings in generated patches (IronPython 2.7 compat)
- No network calls
Tests
pytest tests/
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。