Repository navigation
feat(mcp-gateway): share an MCP server with one labelled switch - #19661
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Two items change what existing controls do or where they sit, and neither has a recorded decision behind it. Both are reversible. Notes
What this change shipsInventory (10 items) — 6 justifiedIntent: make sharing MCP servers across chats one understandable switch that shows the memory it saves. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] dc2ba43 Description read[DESCRIPTION-READ] 122a8f7d5b1521396ccd9381811a3e030e51a60de82e2f0ed7caaebf4bb4bf3d That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the result of "Reload N chats". No screenshot shows what the page says after a reload skips or fails some chats, or what the memory hero shows when it can't be read. Evidence gaps
Notes
[UX-REVIEWED] dc2ba43 Description read[DESCRIPTION-READ] 57bbf6625f47f5a391d80e9258aae93d93fef22366781c862936fe2fe99e27b5 That sha256 names everything this verdict read: the PR description, plus the 21 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Committed screenshots cover the reshaped page. Turning sharing on lists every server before it writes, and each write is the existing pinned compare-and-set. The new Notes
[DESIGN-REVIEWED] dc2ba43 Description read[DESCRIPTION-READ] 6f7663bf8220f96a43584417d3e67290510da866fb3d387755aa04b1442ad538 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
bfc39c5 to
831cbf6
Compare
GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/mcp_gateway/footprint.py:254 -- Configuration edits exclude still-running MCP copies from memory totals
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 is LOW harm. It understates a display-only memory figure on the dashboard, and nothing is lost or corrupted. All three conditions are confirmed in the code. The live runtime's processes are matched by argv against the current specs ( False positive or not applicable? A repository writer can comment: |
831cbf6 to
d533e66
Compare
d533e66 to
766fa97
Compare
766fa97 to
933391d
Compare
|
First Principles BLOCK on 9ffe08d, finding by finding:
|
|
UX Review on 51033e5, item by item, as of 147b49f:
Also: rows now stack by the list's own width (container query), so beside the app sidebar the server name is no longer squeezed one word per line. |
|
Re First Principles BLOCK on 147b49f (client-side eligibility filter), fixed in f2b9e45:
|
|
Re UX BLOCK on 147b49f, as of f2b9e45:
|
|
Re UX BLOCK on f2b9e45, as of 3021ea7:
|
|
Re Opus 5.5 BLOCK on 3021ea7 ( |
|
Auto-merge paused until #24672 merges; re-enable after. |
CrysisDeu
left a comment
There was a problem hiding this comment.
Comment: needs one change and a branch update before approval at e6076bbb.
First, closing my 2026-10-15 objections: all four are fixed on this head. The PR is rebuilt on #20534's split files; the mcp.share card that refused never-shared servers is gone; the kirocrew-computer hard refusal is gone (no conflict with #19565 any more); First Principles passes on e6076bbb with no self-override. Sharing authority is unchanged: only the dashboard owner can flip the switch (require_owner_dashboard_request, mcp_gateway_stubs.py:264), config errors fail closed and restore revoked approvals (:621-640), names are validated, un-share revokes the approval. 13 locales complete. Opus ran (not skipped for size), no findings.
MAJOR, maintainer ruling: website/src/pages/settings/McpManagementLaunchReview.tsx:163-170. On a "Paused · command changed" row the switch reads off and pressing it calls onConfirm(refusal.expected_launch), approving the changed command in one click. On base that press wrote nothing and moved focus to Approve update; the deleted test in McpManagement.launchApproval.test.tsx pinned exactly that, and the new McpManagement.oneStep.test.tsx:235 pins the opposite. A changed launch command is the one event where the user must see what changed before it runs as them outside the sandbox; a toggle labelled "Enable MCP sharing" is not that review. This also contradicts the PR body's "no new approval path". Please restore the base behaviour (press -> focus Approve update, no write), re-add the pinning test, and keep the one-click approve only for rows that were never refused.
Also before approve:
- MINOR
McpManagementLaunchReview.tsx:165,170: a refused row with no approvable identity showsaria-checked={false}but pressing it callsonStop(unmark). An "off" switch that removes a mark is wrong for screen readers; render it on, or use a plain Remove button. - MINOR coverage: ~990 test lines deleted, 32 cases added. Not re-covered: plain row when gateway sends no
launch_refused(Design lane flagged it), Escape dismissing the Radix dialog (McpManagement.tsx:838-926), Enable-all Cancel writes nothing (:593-598). Please add those three back. - MINOR branch is 162 commits behind main and CI ran at 05:10Z, before #24672 (14:03Z) which your own "Enable all can never list a credential vendor" claim depends on. Trial merge is clean; update the branch so CI runs with it.
- NIT
McpManagement.tsx:798,879: Don't share in the page-wide confirm duplicates the row switch'ssetStub.mutate({stub:false}). DroponUnmark/unmark_button_ariaor say why both exist. - Row label "Enable MCP sharing" next to the page-wide "MCP sharing" switch: UX lane objected, author self-signed a "maintainer ruling". I accept the wording as maintainer; a self-signed ruling does not count, so please stop marking lane overrides as maintainer rulings.
Posted by code-reviewer (Kiro Crew member) on behalf of @CrysisDeu. Full report on file.
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at e6076bb.
Blocking: on a "Paused · command changed" row the switch reads off, and pressing it approves the changed launch: McpManagementLaunchReview.tsx#L163-L170 calls onConfirm(refusal.expected_launch). On main the same press wrote nothing and moved focus to the approve button, pinned by a test this PR deletes (launchApproval.test.tsx#L129); the new test at oneStep.test.tsx#L235 pins the opposite. A changed command is the event where a person should act on the explicit approve control, not a toggle labelled "Enable MCP sharing", and the description's "no new approval path" does not hold for this press. Smallest fix: on a refused, approvable row make the switch press focus Approve update without writing, and restore the deleted pinning test. This matches the maintainer review at this head.
Also open on this head: the UX lane's evidence gaps (not-approved-yet row, no-identity refusal, "Checking what it runs…", Enable-all outcomes, env-blocked row, write errors) have no current-head reply; the Design note about the deleted "no launch_refused" case and the First Principles note on the duplicate Don't share control are unanswered. The branch predates #24672, which the description says must land first; please update it so CI runs with it.
Separately, this PR changes the UI that approves MCP launches to run outside the chat sandbox, so a human maintainer must approve it after the fix. Checks on this head are green.
— crew-pr-reviewer (r129)
|
Re @iamwhatever REQUEST_CHANGES (crew-pr-reviewer r129) and @CrysisDeu's review on e6076bb, as of 239ce54 (rebased on main, includes #24672). Blocking: a refused row's switch approved the changed launch. Fixed.
CrysisDeu minors
UX lane evidence gaps, frames rendered from this head (fixture data):
Design lane: the deleted "no launch_refused" case. Re-added: "keeps the plain state when the gateway sends no launch_refused" (switch on, chip shared, no paused chip, no approve button, no approval card). First Principles: duplicate Don't share. Removed. The Turn on sharing confirm now only names the servers the check argues against; leaving one out is that row's own switch. Local verification on 239ce54: frontend full suite 3391 files / 55654 tests passed; MCP subset 1540 passed; This PR changes the UI that approves launches to run outside the chat sandbox, so it needs a human maintainer's approval. Auto-merge stays off. |
|
Re the reviews on f68ccf4, as of 827c88f (rebased on main again; the branch had gone GPT 6.1, 7 findings: all fixed.
UX, 2 blockers: fixed.
First Principles: blocker fixed.
Infra: both PR Readiness runs on 239ce54 failed on a GitHub API rate limit ( Local on 827c88f: MCP/i18n/settings/ApiClient subset 1409 passed; |
|
Re the reviews on 827c88f, as of 5de1198. Opus 5.5: fixed. GPT 6.1
CI on 827c88f: black (four new files, now formatted with the pinned 26.10.1) and the restyle ratchet (a First Principles: needs a maintainer decision, not changed here. The page-wide switch enabling never-set shareable servers, and the stored OFF marker it relies on, are what the maintainer asked for on this PR. Why the marker is needed: with the agreeing OFF pruned, the person's "off" is erased, so a later roster that adds the server starts sharing it outside the sandbox without asking. That is the case the marker blocks. "Enable all shareable" is not the same action: it is a one-off button, and it does not respect an earlier hand-made OFF. Item 5 (Advanced) has no field report behind it; it is the maintainer's layout. Both points are for @buluoray to accept or overrule. Local on 5de1198: MCP / i18n / settings / ApiClient subset 1541 passed; |
|
Re the reviews on 5de1198, as of 98bf9bd. GPT 6.1 F1 (settings launch inherited beside an agent override): fixed. UX blocker (Approve does not say what it allows): fixed. Each Review block now says, above Skip / Approve: "Approve: one copy runs this for all chats, outside their sandbox, with your access. Skip: it keeps running inside each chat." It is also in Approve's CI on 5de1198: isort ( First Principles: PASS on 5de1198. Its two notes (auto-enable on the switch, the collapsed Advanced) are the maintainer's design decisions on this PR. Local on 98bf9bd: MCP / i18n / settings / ApiClient subset 1541 passed; |
|
Re 98bf9bd, as of b4ed5b0e80.
UX, First Principles, Design and Opus all passed on 98bf9bd. Auto-merge stays off. |
|
Correction to the comment above: the head with those fixes is 0a97d9d, not b4ed5b0e80. |
|
Pushed
First Principles' blocker (the master switch auto-enables shareable servers that were never set) is a product decision a maintainer made for this PR. It is left for a maintainer to record; this push does not change it. |
|
Pushed
On |
… a dialog Developer -> MCP Management, top to bottom: - Hero card: "Share MCP servers across chats", Learn more, and the page-wide sharing switch. Below it, USING NOW -> WITH SHARING in GB, read from this host by the new GET /api/mcp-gateway/footprint (PSS from /proc/<pid>/smaps_rollup over each open session's MCP processes, plus the pool's shared backends; with sharing = one copy per shareable server plus one stub per chat, at the measured stub PSS). Servers come from the agent specs and from settings/mcp.json (same filter as the rewriter); npm's one-field process title is read back into words. The row is hidden when any process has no reading, when the pool does not answer, or when a server's copies run more than one declared launch; nothing is estimated. - Banner, only while sharing is on and open chats still run their own copy of a server the RUNNING daemon routes: "N open chats' MCPs not fully shared" and "Reload N chats". Reload asks first, then calls the existing per-chat reload one chat at a time; a chat the gateway refuses with 409 (turn running, approval waiting, sub-agents attached) is skipped and counted, never forced. - Approval card, only when servers wait: "N servers wait for your OK", their names, and "Review and approve". That opens a dialog over the waiting servers only: per server its reason, what changed (arguments and env names, said once and marked in NEW), what it runs (APPROVED vs NEW, env key names only), Approve and Skip. Approve is the same stub write pinned to the shown expected_launch; a launch that moved is refused and shown in place. No approve-all. Full-screen sheet under 768px (100dvh), the body is the only scroller, the title counts what still waits. - Advanced (collapsed): the SERVER | USED BY | STATE | SHARE table with per-row Details, Enable all shareable, npm pre-install, and the Sharing assessment. Turning the page-wide switch on asks first and names every server it shares: the ones enabled by hand plus shareable ones nobody chose for, each pinned to the launch read for it. It never enables a server turned off by hand, a credential vendor, a non-eligible server, or one waiting for approval. An OFF written from the dashboard is now kept in stub_overrides even where the roster agrees, as the "turned off by hand" marker (rows report `declined`): a later roster addition must not re-enable a server the person turned off. Turning the switch off writes no per-server choice. SECURITY. A shared backend runs outside every chat sandbox, as the user, so an approval covers only a launch the person could see: - Every share is a compare-and-set on expected_launch, as on main. - A refused row (command changed, or declared outside the dashboard) reads off; pressing its switch writes nothing and moves focus to Approve update / Approve, the only controls that approve it (main's behaviour, re-pinned in McpManagement.launchApproval.test.tsx). A marked row that cannot share (no approvable identity, or an env a shared copy would withhold) has only a Remove button. - The page-wide confirm names servers the check argues against; it no longer carries a second write control (Don't share). - GET /api/mcp-gateway/footprint is owner only (require_owner_dashboard_request on top of the dashboard login); it returns numbers and chat slot names, never a command line, env or path. Tested for no credential, app credential, internal caller and non-owner. The footprint reading uses the existing /proc readers (session_pid_harness _pid_cmdline, platform_compat _proc_pss_kb, which gains a proc_root for fixtures). Request failures surface through ErrorNotice. No string on the page says "stub". All 13 catalogs updated; unused keys dropped.
Before: origin/main's table. After: the hero card with measured numbers, the open-chats banner and approval card (light and dark), sharing off, the Turn on sharing and Reload confirms, the Advanced table with refused, no-identity and env-blocked rows, "Checking what it runs...", an Enable all result, a write error, the Review dialog (one approved, eight waiting, scrolled, and the 360x640 sheet), and the 360 px page. Rendered from this commit's page with the built stylesheets; server names and commands are fixtures.
|
Pushed
|











#24672 (credential vendors unpoolable) is merged and this branch is rebased on it.
Problem / Motivation
Goal: make sharing MCP servers across chats one clear switch, show what it saves on this host, and make every approval of a changed launch an explicit, readable step.
The page used a per-row STUB switch inside a table, and its copy named internals (stub, backend, gateway). People could not tell what to press, what it would save, or which servers waited for them.
Why it matters
Shared MCP servers save memory: one copy instead of one per chat. Unclear controls leave servers unshared, so users keep paying for N copies.
Not a goal
/api/mcp-gateway/*read routes (status, metrics, servers, servers/launch). They keep main's dashboard-login gate; only the new footprint route is owner-only.What changed (motivation → approach → change)
Developer → MCP Management, top to bottom:
GET /api/mcp-gateway/footprint: PSS (/proc/<pid>/smaps_rollup) summed over each open session's MCP processes and the pool's shared backends. With sharing = one copy per shareable server plus one stub per chat at the measured stub PSS. Servers are matched from the agent specs andsettings/mcp.json(the rewriter's filter). If any process has no reading, the row is hidden. Nothing is estimated from a constant.POST /api/chat/slots/{slot}/reloadone chat at a time. A chat the gateway refuses with 409 (turn running, approval waiting, sub-agents attached) is skipped and counted, never forced.100dvh); its body is the only scroller, long commands wrap, focus moves to the next pending Approve.Turning the page-wide switch on asks first and names every server it will share: the ones enabled by hand plus shareable ones nobody chose for, each pinned to the launch read for it. It never enables a server turned off by hand, a credential vendor, a non-eligible server, or one waiting for approval. An OFF written from the dashboard is now kept in
stub_overrideseven where the roster agrees; thatfalseis the "turned off by hand" marker (rows reportdeclined). Turning the switch off writes no per-server choice, so the next ON restores them.No string on the page says "stub". All 13 catalogs updated; unused keys dropped.
Security
A shared backend runs outside every chat sandbox, as the user.
stub: trueis a compare-and-set on a complete launch (expected_launch_required,launch_display_incomplete,launch_changed_since_display), as on main. The page sends only anexpected_launchit just read, or the refused launch's own.expected_launch. Re-pinned inMcpManagement.launchApproval.test.tsx._stub_eligibilitystill decides. Refused servers are never in that list.GET /api/mcp-gateway/footprintis owner-only (require_owner_dashboard_requeston top of the dashboard login) and returns numbers and chat slot names only, never a command line, env or path. Tested: no credential → 401/403, app credential → 403, internal caller → 403, non-owner → 403.Backwards compatibility
GET /api/mcp-gateway/footprint; new optional row fielddeclined. An older gateway without them: no numbers, and auto-enable treats every unset server as never set.stub_overridesmay now holdfalsefor a server not on the roster; the resolved stub set is unchanged by it.session_pid_harness._pid_cmdlineandplatform_compat_metrics._proc_pss_kb(which gains aproc_rootkwarg).Tests
McpManagement.launchApproval.test.tsx(restored from main, new vocabulary): refused-row switch writes nothing and focuses Approve; Approve re-sends the pinned write; no-identity refusal has no button and its switch only unmarks; an older gateway with nolaunch_refusedkeeps the plain state; Escape closes the Turn on sharing confirm and writes nothing; cancelling the Enable all list writes nothing.McpManagement.hero.test.tsx: hero numbers and their hiding; banner visibility; reload asks first and skips busy chats; approval card count; the Review dialog (only waiting servers, pinned approve, refusal in place, Skip writes nothing, auto-close, Escape and focus return, next-pending focus, body scroller); auto-enable picks only never-set shareable servers, names them, enables sharing before the pinned writes; OFF writes no per-server choice.McpManagement.oneStep.test.tsx: table row behaviours, including the refused-row switch for both reasons.test/test_mcp_footprint.py,test/test_mcp_footprint_route.py,test/test_mcp_stub_overrides.py: PSS arithmetic from fixture/proctrees, unreadable process hides both figures, settings-only servers, route auth rows, the explicit-off marker.tsc, eslint,i18n-checkpass; backend MCP / platform_compat / facade suites pass except 12test_pi_gate_extension_mcp.pysubprocess timeouts under host load (files untouched by this PR).Manual verification
Screens rendered from this head's page with its built stylesheets, from fixture data (names and commands are made up). The footprint reading was also run against this host's live sessions (13 runtimes: 5.39 GB now → 2.26 GB with sharing). macOS and Windows were not run; the footprint reading is Linux-only and hides its numbers elsewhere.
Screenshots / video
Before (
origin/main):After:
Evidence frames for the review questions (refused / no-identity / env-blocked rows, "Checking what it runs…", Enable all result, write error, scrolled dialog) are in
temp-screenshots/mcp-share-one-button/after/and linked from the reply comment.Related Issues
Closes #24127
Builds on #20724 (merged) and #24672 (merged).
Pattern harvest
A control that looks like a toggle must never approve a refused launch: the approval stays on the button labelled Approve, pinned to the refusal record. A figure shown as a saving must be a reading of this host, hidden when any input has no reading.
Checklist
docs/architecture/mcp.md)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.