Skip to content

Allow MCP bridge to validate registered plugin nodes - #1225

Open
pegit-h wants to merge 3 commits into
pascalorg:mainfrom
pegit-h:fix/registry-aware-mcp-plugin-nodes-20261106
Open

pegit-h wants to merge 3 commits into
pascalorg:mainfrom
pegit-h:fix/registry-aware-mcp-plugin-nodes-20261106

Conversation

@pegit-h

@pegit-h pegit-h commented Nov 6, 2026 •

Copy link
Copy Markdown

What does this PR do?

SceneBridge currently parses create patches and validateScene() against the built-in node union only. A node kind registered through the plugin registry can therefore work in core/plugin flows but still be rejected at the MCP bridge boundary.

This change keeps the built-in parser as the first path, then falls back to the registered schema for the node's type when the built-in parse fails. The same helper is used for create patches and scene validation.

A focused regression test registers a minimal plugin kind, creates it through applyPatch, and verifies that the resulting scene validates cleanly.

Built-in and unregistered node behavior is unchanged.

How to test

Validated against current main:

  • bun x biome check packages/mcp/src/bridge/scene-bridge.ts packages/mcp/src/bridge/scene-bridge.test.ts
  • bun test packages/mcp/src/bridge/scene-bridge.test.ts → 56 passed, 0 failed
  • bunx turbo run test --filter=@pascal-app/mcp → 1,516 passed, 0 failed
  • bun test packages/core/src/registry/plugin-v1-conformance.test.ts → 12 passed, 0 failed
  • bun --cwd packages/mcp run build → passed
  • bun run check → exit 0

Screenshots

Not applicable. This is a headless MCP bridge change.

Checklist

  • I tested locally with bun dev (not applicable to this headless bridge change)
  • My code follows the project's style (bun check)
  • I updated relevant docs (no user-facing behavior or API documentation change)
  • This PR targets the main branch

Note

Low Risk
Localized parsing/validation change in the headless MCP bridge with regression tests; built-in node behavior is unchanged.

Overview
The MCP SceneBridge no longer validates nodes only against the built-in AnyNode union. It now uses a shared parseRegisteredNode helper that keeps parseNode as the first path and, on failure, validates against the plugin nodeRegistry schema for the node's type.

That helper is wired into applyPatch create validation and validateScene, so plugin kinds can be created through patches and pass scene checks when they match their registered schema; invalid plugin payloads still fail with schema errors.

A regression test registers a minimal plugin kind, creates it via applyPatch, and asserts valid/invalid value handling in both patch apply and validateScene.

Reviewed by Cursor Bugbot for commit 96e3f3d. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3e77190. Configure here.

Comment thread packages/mcp/src/bridge/scene-bridge.ts Resolved
kvnloo added a commit to kvnloo/editor that referenced this pull request Nov 7, 2026
Cover registry-aware create, render install gate, durable scene JSON,
and the get_scene MCP wire listing under explicit uninstallation and
missing-plugin reload. Keep upstream pascalorg#1225 intact.

PE39-1225-SCENE-INSTALL-SEMANTICS
kvnloo added a commit to kvnloo/editor that referenced this pull request Nov 7, 2026
…ssion branch

Restore the six unrelated viewer files to fork main and remove the two
GLB batching files added by ancestor 0602f9e. Preserve all MCP bridge
production changes and exported-package regression tests unchanged.

PE44-1225-ANCESTRY-DIFF-HYGIENE
Retain registered-plugin parsing and schema-specific error paths while incorporating upstream hierarchy-cycle parity checks. Resolve the sole test import conflict by preserving both imports. Integrated source passed uncached MCP build and1532 tests,12 plugin conformance tests, formatting and exact-source independent review. No upstream merge or release is performed by this source commit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant