Skip to content

app: let bundled MCP servers load their own frameworks - #3423

Merged
ashhart merged 3 commits into
ashhart:mainfrom
AIflow-Labs:aiflow/fix-3267-mcp-app-bundle
Nov 18, 2026
Merged

ashhart merged 3 commits into
ashhart:mainfrom
AIflow-Labs:aiflow/fix-3267-mcp-app-bundle

Conversation

@AIFlowML

@AIFlowML AIFlowML commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

MCP servers shipped inside macOS apps can abort before the MCP handshake: the sandbox permits Contents/MacOS, while dyld needs the app's sibling Contents/Frameworks directory. This lets the selected executable read its own app's Contents, including bundled frameworks and resources. The bundle stays read-only, and unrelated app bundles remain inaccessible.

The regression builds a tiny native app bundle with an @rpath dylib and launches it through the real MCP sandbox. Before the fix, dyld reports file system sandbox blocked open(); after it, the library loads and arguments containing spaces stay intact. Negative controls require an actual permission-denied result, so a timeout or launch error cannot produce a false pass. Passing an app path as an ordinary argument does not grant access to its bundle.

Checks on this head

Verified 16 November 2026, 16:25 Asia/Bangkok. Base for this PR: e7e24243d63e232b05d4892df4fa01c9a2d6c70b. The published head is unchanged. Its prior full-suite/platform receipts below remain valid; focused tests, types, formatting and preflight were repeated for review. Our 14 contribution branches also pass 36/36 focused test files in a cumulative composition. This is a focused compatibility run, not a full combined-suite result.

  • Head commit: 3f7f70f24ddaa8873f16dbba7e6c3f92020832bd.
  • Lean checker on base/head: 341/341 inherited findings; zero new findings. python3 tools/pr_check.py --base e7e24243d63e232b05d4892df4fa01c9a2d6c70b: zero errors, 0 warnings.
  • Tests run:
    • node node_modules/jiti/lib/jiti-cli.mjs electron/agent/mcp-app-bundle.test.ts: passes on Apple M5 Max / 128 GB, macOS 27.2, Xcode 27.2, Node 22.23.3. The native C fixture is reached by the standard app runner and loads a sibling dylib through @rpath inside sandbox-exec. Arguments and paths with spaces remain intact; resource reads pass; bundle writes and unrelated bundle reads fail as expected.
    • Before the fix, the same regression failed with Library not loaded: @rpath/libfixture.dylib and file system sandbox blocked open(). After the fix it exits zero and prints loaded 42.
    • node node_modules/jiti/lib/jiti-cli.mjs electron/agent/mcp-client.test.ts: passes.
    • node node_modules/jiti/lib/jiti-cli.mjs src/lib/plugin-library.test.ts: passes.
    • npm test, npm 10.9.8: 855/856 test files pass; one failure in electron/agent/sandbox-git-control.test.ts at git commit still works. That same failure was reproduced on an untouched detached checkout of base 3a56d4eb922467685ca73f7487bb5cacd35b63a3 with the same dependencies and runtime. The new test ran without skipping. This full run preceded the rebase and final negative-control test hardening; upstream's intervening commits did not change any app file, and the final hardening changes no production behavior.
    • On the final head, reran the app-bundle regression, MCP client, framing, pagination, launch-race and IPC security tests: all pass. Desktop typecheck and production build pass again after the final review.
    • npm run typecheck, npm run build, npm run verify:mobile: pass. Mobile verification includes lock validation, security dependency tests, TypeScript and lint.
    • python3 tools/pr_check.py --base upstream/main: zero errors, zero warnings; git diff --check HEAD^ passes. Publication-tree and outgoing author/committer inspection pass.
  • CI: App and mobile checks: success; Zig format: success; No GPU: success. All 12 applicable upstream checks passed on this head. The two scheduled nightly jobs were skipped.
  • Not run, and why: Original PrimeTask/Humla applications are not installed, so their complete MCP sessions are not claimed as qualified. Linux/Windows runtime qualification was not run locally; the new live test skips without macOS sandboxing or the Xcode compiler/SDK. Native Zig, device/model and kernel suites were not rerun because this change affects only the desktop MCP process sandbox and does not reach inference. No inference performance or exactness claim is made.

Receipt

n/a: desktop MCP process launch permissions do not change native inference, model arithmetic, sampling or GPU kernels.

  • Main against branch: n/a, no inference path is changed.
  • Boxes it reaches: macOS desktop, direct sandboxed MCP launches from an .app/Contents/MacOS executable.
  • New switch? Default, accepted values, profile row: n/a, no new setting.
  • Environment: base/head and local macOS toolchain are recorded under Checks on this head; no model/checkpoint is required.
  • Paths and platforms: exercised the direct macOS sandbox launch with a compiled app-bundle fixture; other platforms and Docker launch behavior are unchanged and were not device-qualified.
  • Exactness: n/a, no model inference is involved.
  • Main against this branch before asking for a maintainer run: the native loader regression fails on the old implementation and passes with the fix; no maintainer run requested.
  • Decode speed: n/a, no decode code changes.
  • Prompt speed: n/a, no prompt-processing code changes.
  • Licence of any new weights or drafter: n/a, no weights or drafter added.

Checklist

  • The title and description match the head commit, including the receipt and scope.
  • The new test fails before the change, passes after it, and skips cleanly without its dependencies.
  • New comments are single lines; no measurements or history were added to production source.
  • No personal data, machine names, internal hosts or local user paths in the diff or outgoing commit. No AI attribution lines.

Igor Lessio - AIFLOW LABS

@ashhart

ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Thanks @AIFlowML. Only a command that is exactly an app's Contents/MacOS executable gets that app's Contents as a read root; an app path passed as an argument grants nothing, and nothing becomes writable. The new test covers both sides of that boundary, and CI is green.

Nothing more is needed from you. It's in our landing queue.

  • Synthena

@ashhart
ashhart force-pushed the aiflow/fix-3267-mcp-app-bundle branch from 3f7f70f to 53af98c Compare November 18, 2026 17:01
@ashhart
ashhart merged commit 5fa1fae into ashhart:main Nov 18, 2026
3 of 15 checks passed
@ashhart

ashhart commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Thank you @AIFlowML. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

joshuaswarren pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 19, 2026
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.

2 participants