Skip to content

Sync MCP configs without a shell wrapper - #237

Merged
wallstop merged 2 commits into
docs-qualify-performance-baselinefrom
port-mcp-sync-wrapper
Oct 14, 2026
Merged

wallstop merged 2 commits into
docs-qualify-performance-baselinefrom
port-mcp-sync-wrapper

Conversation

@wallstop

@wallstop wallstop commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

DISCLOSURE: LLM-GENERATED TEXT

Why: Lifecycle MCP sync still launches a standalone Bash wrapper during script migration.

What:

  • Port the sync wrapper to typed Python.
  • Run lifecycle sync with the current Python interpreter.
  • Preserve workspace selection, flags, environment, and child exit status.
  • Cover wrapper edge cases alongside existing frontend configuration contracts.

Refs #171.


Note

Low Risk
Devcontainer hook wiring and a thin Python wrapper around unchanged configure.mjs; behavior is contract-tested with no auth or data-path changes.

Overview
Replaces the Bash MCP sync wrapper with a typed Python entrypoint (sync_mcp.py) that still runs the existing configure.mjs Node configurator, keeping the same contract: optional workspace path, leading-dash args forwarded as flags, DATAVIZ_MCP_WORKSPACE set, and the child exit code propagated.

Devcontainer lifecycle hooks (on_create, post_start, update_content) now invoke sync_mcp.py via sys.executable instead of bash sync-mcp.sh; sync-mcp.sh is removed and the MCP README documents the Python path for container hooks.

Tests point at sync_mcp.py, drive sync with Python only (no Bash/jq in the harness), and add wrapper-focused cases (flag/workspace forwarding, symlink workspace spelling, missing node, missing workspace) alongside the existing frontend sync contracts.

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

The script migration still leaves lifecycle MCP sync in Bash. The
wrapper is executed, not sourced, so the earlier sourced-shell exception
does not apply to it.

Port the wrapper to typed, stdlib-only Python and call it through each
lifecycle entry point's current interpreter. Keep the adjacent Node
configurator and npm's direct Node entry unchanged. Preserve workspace
selection, leading-dash flag forwarding, child cwd and environment,
missing-node diagnostics, and child exit status.

All five original sync integration cases and assertions are unchanged.
Add wrapper checks for default roots from another cwd, relative paths
with spaces, multiword flags, an empty first argument, exit propagation,
missing Node, and a missing workspace. The sync suite no longer skips
merely because Bash is absent. Update lifecycle stub expectations.

Validation: all 38 self-test files pass; scoped fast check and all ten
applicable gate steps pass. Strict pyright reports zero errors on the
wrapper, three lifecycle files, and three affected test files. No old
sync-mcp.sh references remain in tracked tooling. No Unity behavior or
packaged asset changes; Unity suites and npm pack do not apply.

Refs #171.
@wallstop
wallstop force-pushed the port-mcp-sync-wrapper branch from 4ce2ff2 to 9129544 Compare October 14, 2026 18:56
@wallstop
wallstop changed the base branch from main to docs-qualify-performance-baseline October 14, 2026 18:56
@wallstop
wallstop added this pull request to stack #238 October 14, 2026 18:56

@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 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.

Reviewed by Cursor Bugbot for commit 9129544. Configure here.

Comment thread .llm/mcp/sync_mcp.py
Agent trust and approval entries use the workspace path as a key. The
Python wrapper resolved symlinks before exporting that path, unlike the
old shell wrapper, so opening an alias could lose its trust identity.

Use lexical absolute paths for both explicit workspaces and the default
script-relative workspace. Extend the existing wrapper table to cover
both alias paths on POSIX. Compare the exported path verbatim instead
of resolving both sides, which hid this regression in the old assertion.
Windows retains its existing path/argument coverage and explicitly skips
the POSIX symlink fixture.

Validation: the added alias case fails against the old wrapper and passes
with this change. Strict pyright and check:fast pass. The combined stack
gate passes all ten applicable steps, including the full 38-file suite.
No Unity or packaged payload changes.

Resolve the finding in PR #237 discussion_r4275057123. Refs #171.
@wallstop
wallstop merged commit f9d1cf9 into main Oct 14, 2026
3 checks passed
@wallstop
wallstop deleted the port-mcp-sync-wrapper branch October 14, 2026 19:13
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