Skip to content

Prepare Autodesk Marketplace inventory and secure local pairing - #68

Merged
jmcouffin merged 4 commits into
masterfrom
feat/autodesk-marketplace-publication
Oct 14, 2026
Merged

jmcouffin merged 4 commits into
masterfrom
feat/autodesk-marketplace-publication

Conversation

@jmcouffin

@jmcouffin jmcouffin commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

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 master as its default branch and has no linked Jira issue for this publication request.

What changed

  • Preserve all 20 registered tools and share plain-language public descriptions with the generated Autodesk manifest. Correct the README's implemented-tool inventory. The pinned MCP SDK reports protocol 2025-11-25.
  • Require Windows-user pairing for every registered tool and every Revit bridge route. Add Connect, Disconnect and Privacy ribbon commands. Protect the random bearer secret with DPAPI CurrentUser; rotation and revocation apply to the same user's Revit instances.
  • Display model-modification and Python requests for review in Revit before execution. Python remains unrestricted and explicitly disclosed; the review gate is not a sandbox.
  • Reject remote HTTP bridge hosts, environment HTTP proxies, browser Origin headers and pyRevit callback URLs. Authenticate optional SSE, streamable HTTP and combined transports. Existing VM/LAN REVIT_HOST configurations are deliberately rejected by this local candidate.
  • Schedule status/model-info access through pyRevit's Revit API context; support the current IronPython StringIO import. Use a fresh temporary image-export directory per request and attempt cleanup on success and failure.
  • Upgrade the compatible 1.x MCP SDK and vulnerable transitive dependencies; regenerate the lockfile/requirements. Add Windows CI for Python 3.11 and 3.13, manifest checks and source review-package tooling. Update integration fixtures for pairing and manual Revit review.
  • Add privacy/security documents, a declaration draft, listing/quick-start text and explicit remaining publication gates.

Tested

On Windows with CPython 3.13.2:

  • python -m pytest tests/unit -q: 105 passed (74 existing tests plus 31 new cases).
  • Windows GitHub Actions on Python 3.11 and 3.13: both test/manifest jobs pass.
  • Actual stdio subprocess: initialized with protocol 2025-11-25; all 20 tool names/descriptions match the manifest; resources/prompts are empty; an unpaired local-discovery call is refused.
  • Real SDK HTTP apps: all three optional transports reject unpaired calls; streamable HTTP and combined mode initialize successfully with the paired header. Browser-origin rejection is also tested.
  • Windows DPAPI encryption, corrupted-secret rejection, rotation/revocation, all 18 route denial paths, request review decline/accept, callback rejection, authenticated proxy-free bridge calls, and isolated image-export cleanup on success/failure pass.
  • Manifest exporter --check, Python compilation and git diff --check pass. 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.

@jmcouffin
jmcouffin requested a balanced review from Copilot October 14, 2026 10:39
@jmcouffin jmcouffin self-assigned this Oct 14, 2026
@jmcouffin jmcouffin added the enhancement New feature or request label Oct 14, 2026
@jmcouffin
jmcouffin marked this pull request as ready for review October 14, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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‑only REVIT_HOST, trust_env=False, auth headers, unified build_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>
@jmcouffin
jmcouffin merged commit 14208da into master Oct 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants