Skip to content

MCP: allow send_link to navigate inside an existing window (MCP-114) - #406

Open
marcoslor wants to merge 1 commit into
mainfrom
t3/mcp-114-send-link-window
Open

marcoslor wants to merge 1 commit into
mainfrom
t3/mcp-114-send-link-window

Conversation

@marcoslor

Copy link
Copy Markdown
Owner

Outcome

Allows MCP send_link to accept an optional window id (MCP-114) so agents can navigate deep links directly inside an existing app window instead of creating a new virtual display and encoder on every URL.

  • Wire (docs/PROTOCOL.md, protocol/schema.json, protocol/vectors/control.json): adds {"t":"link.navigate","stream":N,"seq":S,"url":"..."} replying {"t":"link.navigate","stream":N,"seq":S,"ok":true} or {"ok":false,"code":"bad_url"|"no_window"|"launch_failed"|"failed","message":"..."}. Both sides validate via LinkPolicy (SHARE-7), and URLs never enter logs (R-PRIV-1).
  • Phone (android/core + android/app): validates URL and live stream display (no_window if gone), launches ACTION_VIEW + CATEGORY_BROWSABLE on that stream's existing displayId without creating a virtual display or restarting the encoder.
  • Mac (ContiguaCore + Contigua): send_link takes optional window (mutually exclusive with shape: both → -32602). Navigates through WindowActQueue (MCP-84) and MCPActMachine (Navigating + Draining transitions), settles and observes per wait/observe, and returns send_link's opened-window envelope with opened: "navigated".
  • Fakephone, MCP eval & docs: updates tools/fakephone/fakephone.py, deckctl.py, test_selfcheck.sh, tools/mcp-eval, macos/scripts/mcp/suite_open.py, docs/specs/mcp.md (MCP-114), docs/design/mcp.md, and docs/MAP.md.

Fixes #390

Checks

  • Tier 0:
    • scripts/check-rules.sh --base $(git merge-base HEAD main): PASS (30 files checked)
    • scripts/check-ratchets.sh --base $(git merge-base HEAD main): PASS
    • scripts/check-format.sh --base $(git merge-base HEAD main): PASS (12 Swift files, 5 Kotlin files)
  • Android K1 (OpenJDK 17):
    • ./gradlew -q :core:test --tests "*Link*" :app:assembleDebug :app:testDebugUnitTest --tests "*Launcher*": PASS
    • ./gradlew -q :core:test --tests "app.contigua.proto.ProtocolVectorsTest": PASS
  • Mac K2:
    • swift test --filter "ContiguaCoreTests|MCPCoreTests|MCPToolHostTests|WindowActQueueTests": ContiguaCoreTests 433/433 + MCPCoreTests, MCPToolHostTests, WindowActQueueTests passed, 0 failures
    • swift test --filter "MCPActMachineTests": 74/74 passed, 0 failures
    • (Unfiltered swift test hits pre-existing teardown stall #161.)
  • Fakephone & MCP eval:
    • bash tools/fakephone/test_selfcheck.sh: SELFCHECK PASS (navigate stream=1 ok no_window bad_url opened=1 configs=1)
    • python3 -m unittest discover -s tools/mcp-eval -p 'test_*.py': Ran 35 tests in 1.276s — OK

Surfaces

  • Wire protocol (docs/PROTOCOL.md, protocol/schema.json, protocol/vectors/control.json): updated and verified.
  • Android (:core, :app): updated and verified.
  • Mac (ContiguaCore, Contigua): updated and verified.
  • Fake phone (tools/fakephone) & MCP eval (tools/mcp-eval): updated and verified.
  • Extensions / UI: n/a.

@marcoslor marcoslor added android Phone app feature New capability mac Mac app and extensions protocol Wire protocol, `docs/PROTOCOL.md` labels Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android Phone app feature New capability mac Mac app and extensions protocol Wire protocol, `docs/PROTOCOL.md`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: allow send_link to navigate inside an existing window (MCP-114)

1 participant