Open-source Revit MCP server: let Claude and other AI assistants read and edit BIM models, with human approval on every change.
Python aecai-agentsautodeskautomationbimclaudeifcmcpmcp-servermodel-context-protocolnavisworksrevitrevit-addinrevit-apirhino
[project]
name = "aec-model-bridge"
version = "1.4.0"
description = "Independent Model Context Protocol integration for Autodesk Revit software"
readme = "README.md"
requires-python = ">=3.11"
license = "GPL-3.0-or-later"
license-files = ["LICENSE", "NOTICE", "LICENSING.md", "LICENSES/*"]
authors = [
{ name = "Sam-AEC" },
]
keywords = ["mcp", "revit", "autodesk", "bim", "ai"]
dependencies = [
"pydantic>=2.5",
"pydantic-settings>=1.3",
"httpx>=0.24",
"python-dotenv>=1.0",
# 1.30 fixes Streamable HTTP session exhaustion (GHSA-84m7-p3x7-pcfv).
# Capped below 2: mcp 2.x (Python 3.12+) removed the low-level
# `Server.list_tools()` decorators this server is built on, so an unpinned
# install crashed at import time.
"mcp>=1.30.0,<2",
"ifcopenshell>=0.7.0",
"networkx>=3.0",
# Speckle 3.x pins gql<4, which requires vulnerable graphql-core<3.2.7.
# The calendar-versioned SDK supports gql 4 and patched GraphQL releases.
"specklepy>=2026.9.1,<2027",
# Fix both GraphQL validation and comment-token denial-of-service issues.
"graphql-core>=3.2.12",
"pyyaml>=6.0",
"openpyxl>=3.1",
# agent_native.py replays response.content (incl. thinking blocks, which
# Claude Opus 5 emits by default) back into history, and marks the tools
# list with cache_control - pinned to the SDK version verified against both.
"anthropic>=0.99",
]
[project.scripts]
aec-model-bridge = "revit_mcp_server.mcp_server:run_mcp_server"
revit-mcp-server = "revit_mcp_server.mcp_server:run_mcp_server"
aec-model-bridge-panel-server = "revit_mcp_server.panel_server:run_panel_server"
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"pytest-timeout>=2.3",
# The wheel-contents test builds the package; CI also uses it for the sdist.
"build>=1.2",
"ruff>=0.0",
"mypy>=1.8",
]
[project.urls]
Homepage = "https://github.com/Sam-AEC/aec-model-bridge"
Repository = "https://github.com/Sam-AEC/aec-model-bridge"
Issues = "https://github.com/Sam-AEC/aec-model-bridge/issues"
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
# Module manifests, QA/QC rules and recipes are data files next to the code. Without
# this they were left out of the wheel, so a pip/uvx install silently lacked the
# ~34 module tools that a source checkout has.
[tool.setuptools.package-data]
revit_mcp_server = [
"modules/*/module.json",
"modules/*/rules/*.yaml",
"modules/*/recipes/*.yaml",
]
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
# -ra: summarise every non-passing outcome; --strict-markers: a typo'd marker
# fails instead of silently selecting nothing. Coverage is opt-in (--cov) so the
# stdio smoke test can also run against an installed wheel without pytest-cov.
addopts = ["-ra", "--strict-markers"]
# A hung subprocess or event loop must fail the test, not stall CI for hours
# (needs pytest-timeout from the dev extra; without it the key is only warned about).
timeout = 120
markers = [
"timeout(seconds): per-test time limit (provided by pytest-timeout; registered so --strict-markers works without it)",
"e2e: marks Revit bridge end-to-end tests (opt in with AEC_MODEL_BRIDGE_E2E=1)",
"perf: marks tests as performance benchmarks (deselect with '-m \"not perf\"')",
]
# Later entries win. Warnings are errors, except: third-party deprecations (not
# ours to fix; they must not break CI), and resource leaks (unclosed files,
# sockets, sqlite handles) that predate this setting and are cleanup work.
# Deprecations raised from our own package stay errors.
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
"error::DeprecationWarning:revit_mcp_server",
"ignore::ResourceWarning",
"ignore::pytest.PytestUnraisableExceptionWarning",
]
[tool.coverage.run]
branch = true
# Measure by directory, not package name: several tests load modules by file path
# (importlib.util.spec_from_file_location), which source_pkgs would report at 0%.
source = ["src/revit_mcp_server"]
relative_files = true
omit = ["*/tests/*", "*/_version.py"]
[tool.coverage.paths]
# An installed (site-packages) copy and the src tree are the same code.
source = [
"src/revit_mcp_server",
"*/site-packages/revit_mcp_server",
]
[tool.coverage.report]
# Measured at 59% (line + branch) when this gate was introduced; the floor sits a
# few points below so noise does not break CI but a real drop does.
fail_under = 55
skip_covered = true
exclude_also = [
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"raise NotImplementedError",
]
[tool.ruff.lint]
# Pin explicitly to ruff's own classic default rule set (pyflakes + basic
# pycodestyle). Newer ruff releases have changed what "default" means, and
# with the dependency unpinned (ruff>=0.0) that silently pulled in dozens of
# new rule categories (pyupgrade, bugbear, security, perf, ...) that were
# never adopted, breaking CI on every push without any code change.
select = ["E4", "E7", "E9", "F"]