Skip to content

[codex] Add embedded cua-driver MCP SDK#1726

Draft
f-trycua wants to merge 1 commit into
mainfrom
feat/cua-driver-embedded-sdk
Draft

[codex] Add embedded cua-driver MCP SDK#1726
f-trycua wants to merge 1 commit into
mainfrom
feat/cua-driver-embedded-sdk

Conversation

@f-trycua
Copy link
Copy Markdown
Collaborator

Summary

Adds an in-process embedded SDK for the Rust cua-driver so host apps can handle MCP requests without spawning cua-driver mcp, cua-driver serve, or CuaDriver.app for protected AX / screen-capture work.

What Changed

  • Adds a new Rust workspace crate, cua-driver-embedded, with direct Rust calls and JSON-RPC MCP request handling.
  • Exposes a C ABI (cua_driver_embedded_*) for Swift, Objective-C, Electron/native-node, and other non-Rust hosts.
  • Adds a CuaDriverEmbedded Swift Package product and wrapper API around the C ABI.
  • Exposes the core MCP request dispatcher from cua-driver-core::server so embedded transports reuse the stdio server's method handling.
  • Adds a macOS .app smoke harness that links the embedded dylib, launches via LaunchServices, and verifies bundle-attributed permission status without prompting.
  • Adds embedded MCP docs and marks the old Swift integration page as legacy.

Why

The standalone CLI/daemon path gives macOS TCC attribution to CuaDriver.app, the helper process, or the spawning terminal. Embedded hosts need protected calls to happen in their own process so Accessibility and Screen Recording permissions attach to the host app bundle.

Notes

The Swift package wrapper intentionally does not build Rust by itself. Apps using CuaDriverEmbedded still need to link libcua_driver_embedded.a, libcua_driver_embedded.dylib, or a future packaged xcframework.

The docs call out a current caveat: macOS list_apps still goes through osascript / System Events, so that tool can require Automation permission separately until it is replaced with a fully native implementation.

Validation

  • git diff --check
  • DYLD_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx cargo test -p cua-driver-embedded
    • Passes; emits Swift runtime duplicate-class warnings from the current ScreenCaptureKit bridge environment.
  • swift build --target CuaDriverEmbedded
  • crates/cua-driver-embedded/examples/macos-app-smoke/run.sh
  • Temporary downstream Swift package importing CuaDriverEmbedded, linking the Rust release dylib, and calling MCP tools/list

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 26, 2026 9:32pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2197879-9c16-4a2d-b131-94ae0799fc05

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cua-driver-embedded-sdk

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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