Repository navigation
Prepare Autodesk Marketplace inventory and secure local pairing - #68
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It is a large, security-critical change (pairing/DPAPI, transport auth, per-route gating) whose key runtime behaviors are unproven without a live Revit 2027/Windows validation, as the PR itself states.
1 open finding
What changed in this PR
This PR prepares the pyRevit-based Revit MCP server as a candidate for Autodesk Marketplace review. It layers a mandatory per‑Windows‑user pairing/consent model on top of the existing bridge, authenticates every registered MCP tool and every Revit Routes endpoint, generates a runtime‑verified tool manifest, hardens the HTTP transports to loopback‑only, and adds extensive publication documentation. It is explicitly positioned as a review candidate, not a certified release.
Changes:
- Introduces DPAPI‑protected bearer pairing (
revit_mcp/pairing.py) enforced by a tool-registration wrapper (tools/registration.py), an ASGI auth middleware (tools/http_security.py), and an in‑Revit request‑review gate (revit_mcp/security.py); adds Connect/Disconnect/Privacy ribbon buttons. - Hardens
main.py(loopback‑onlyREVIT_HOST,trust_env=False, auth headers, unifiedbuild_http_app/run_http_async) and adds per‑request temp‑dir isolation + cleanup for view export. - Adds a generated
mcp-tool-manifest.json+ exporter, catalog of public tool descriptions, publication/privacy/security docs, upgraded pinned dependencies, new tests, and a Windows CI matrix.
| File | Description |
|---|---|
| tools/registration.py | Wraps tool registration to require pairing and attach catalog descriptions/annotations |
| tools/http_security.py | ASGI middleware returning 401 for unpaired/browser HTTP/WS requests |
| tools/catalog.py | Central public tool descriptions shared with the manifest |
| tools/__init__.py | Routes all tool registration through the pairing wrapper |
| revit_mcp/pairing.py | Per-user DPAPI bearer secret create/rotate/revoke/validate |
| revit_mcp/security.py | authorize_request: callback stripping, auth check, in‑Revit review |
| revit_mcp/{status,model_info,views,placement,colors,document,code_execution}.py | Add request/doc injection and authorize_request guards; temp-dir isolation; IronPython StringIO shim |
| main.py | Loopback-only validation, authenticated proxy-free client, unified HTTP app builder with middleware |
| scripts/export_mcp_manifest.py, build_review_package.py | Manifest generation/check and source review ZIP tooling |
| mcp-tool-manifest.json | Generated 20-tool inventory for Autodesk review |
| requirements.txt, pyproject.toml, uv.lock | Dependency pin/upgrade and regenerated lockfile |
| MCP.tab/Bridge.panel/*/script.py | Connect/Disconnect/Privacy ribbon commands |
| tests/unit/*, tests/integration/conftest.py | New security/publication tests and paired integration fixtures |
| docs/*, PRIVACY.md, SECURITY.md, README.md | Publication, privacy, security and listing documentation |
| .github/workflows/publication.yml, .gitignore | Windows CI (py 3.11/3.13) with manifest check; ignore pytest cache |
I verified the key integration points: all 20 registered tool function names match TOOL_DESCRIPTIONS/manifest keys (no KeyError), every revit_mcp route now calls authorize_request, the @wraps-based wrapper preserves signatures so FastMCP schemas remain correct, and the HTTP middleware is now applied to all HTTP transports (previously only "combined" was custom). I found no confirmed blocking logic bug, but note that several critical behaviors (pyRevit doc injection for status/model_info, IronPython io.StringIO, Revit review prompts, DPAPI on Windows) are only exercisable on a live Revit/Windows environment and were not executed here.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Refactor privacy file reading to handle IOError. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Summary
Prepare this repository's complete local MCP server for Autodesk Marketplace review by adding a runtime-verified tool manifest, explicit pairing/consent controls, and publication documentation. This is a review candidate, not a certified release or finished Marketplace installer.
The repository uses
masteras its default branch and has no linked Jira issue for this publication request.What changed
2025-11-25.REVIT_HOSTconfigurations are deliberately rejected by this local candidate.Tested
On Windows with CPython 3.13.2:
python -m pytest tests/unit -q: 105 passed (74 existing tests plus 31 new cases).2025-11-25; all 20 tool names/descriptions match the manifest; resources/prompts are empty; an unpaired local-discovery call is refused.--check, Python compilation andgit diff --checkpass. The 15 Revit integration tests collect successfully; they were not executed against Revit.pip-audit -r requirements.txt --no-deps --disable-pip: no known vulnerabilities found after dependency updates, as checked on 14 October 2026. This is a dependency-database result, not Autodesk certification or a full code security audit.Required before publication
Validate this PR and the full workflow on a clean Revit 2027/pyRevit installation, including the ribbon prompts, writes, document lifecycle and uninstall. Live Revit behavior is not yet proven for this candidate.
Get Autodesk's decision on unrestricted Python execution, arbitrary destinations/data accessible to supplied code, the local HTTP loopback bridge, AI-client/provider disclosure and pyRevit-dependent packaging. The manifest's empty external-endpoint list describes built-in fixed connections only; it does not certify that supplied Python cannot contact external services. Do not sign conflicting declaration attestations.
Agree a ready-after-install package with Autodesk, confirm the GPL-3.0 pyRevit dependency's license compatibility, include the required end-user agreement, validate the exact release package, and submit both the security declaration and Publisher Corner listing. Do not merge or publish this draft automatically.