Skip to content

Complete scoped live-session MCP sharing and reconnect flow - #513

Merged
ralyodio merged 5 commits into
mainfrom
fix/mcp-session-bridge
Sep 13, 2026
Merged

Complete scoped live-session MCP sharing and reconnect flow#513
ralyodio merged 5 commits into
mainfrom
fix/mcp-session-bridge

Conversation

@ralyodio

@ralyodio ralyodio commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Addresses #497. A pit opened before login can now authenticate, register its live session and create a share without restarting; failed registration is retryable, and reconnecting under a different account replaces the old mirror.

Per-session MCP shares default to read-only and expose separate write, approval and cancellation scopes with canonical session_* tools. OAuth code/device/refresh flows enforce ownership and the exact share resource, refresh replay revokes replacement credentials, and share expiry/revocation blocks queued controls. OAuth grant revocation also cancels undelivered input, including on refresh-token replay; atomic queue claims recheck both share and grant state. The server records action metadata without terminal input/output in audit rows. README and server docs explain ChatGPT/Claude setup and the Chovy adapter contract, including the raw-terminal permission boundary.

The canonical moshcode.sh endpoint also requires moshcoder/moshcoding#118; OAuth remains on app.moshcode.sh. No native Chovy connector UI is included.

Validation: combined suite 3,163 passed / four existing skips; real PTY smoke exercised logged-out startup, a failed registration and retry, remote help delivery, account reconnection and both sessions ending, using a mock API and no coding engine. CI and release now install frozen PWA dependencies so server security coverage is mandatory. Version prepared: 0.98.4.

Independent review identified an unlisted keypress-tool invocation and queued input surviving OAuth grant revocation. Both are fixed with canonical/legacy alias rejection, grant provenance, and atomic claim regression coverage. The independent recheck passed all 16 cases, the PWA suite passed739/739, and all six GitHub checks pass. Production verification follows the coordinated deployment.

Comment thread test/mcp-share.test.mjs
});

test("connect re-registers the pit with the newly authenticated operator", async () => {
const creds = { token: "new-account" };
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

6 finding(s) in the 21 file(s) this pull request changes.

MEDIUM: 5 | LOW: 1

Severity Rule Location
MEDIUM sql-template-interpolation apps/pwa/src/routes/mcp.mjs:87
MEDIUM sql-string-concatenation src/cli-schema.mjs:189
MEDIUM sql-string-concatenation src/cli-schema.mjs:561
MEDIUM sql-string-concatenation src/cli-schema.mjs:594
MEDIUM sql-string-concatenation src/cli-schema.mjs:701
LOW secret-generic-credential test/mcp-share.test.mjs:107
88 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 70 | **LOW**: 10

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:86
HIGH sh-remote-script-execution install.sh:90
HIGH sh-remote-script-execution install.sh:258
HIGH sh-remote-script-execution install.sh:269
HIGH sh-remote-script-execution install.sh:275
HIGH tls-verification-disabled src/dns.mjs:766
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:139
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:153
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:179
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:373
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:377
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:422
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:671
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:867
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:869
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:928
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:974
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1044

…and 68 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio marked this pull request as ready for review September 13, 2026 10:12
@ralyodio
ralyodio merged commit a4721cf into main Sep 13, 2026
6 checks passed
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