Skip to content

feat(ui): MCP connector panel on the Sharing tab (ent#46 PR2) - #1357

Merged
vybe merged 3 commits into
devfrom
feature/ent46-connector-ui
Jun 30, 2026
Merged

vybe merged 3 commits into
devfrom
feature/ent46-connector-ui

Conversation

@dolho

@dolho dolho commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

PR2 — the gated-Vue UI for the per-agent MCP connector (trinity-enterprise#46). Adds an MCP connector row to the Sharing tab's Channels section, shown only when the mcp_connector entitlement is present (enterpriseStore.isEntitled('mcp_connector')). Ships in the public bundle with no IP — the feature backend + gating live in the private trinity-enterprise module (Abilityai/trinity-enterprise#51); the OSS security primitive + MCP tools are #1356.

ConnectorChannelPanel.vue

  • Generate / regenerate / revoke the scoped connector key.
  • On generate, surfaces per-client copy-paste setup (Claude Code, Cursor, Claude Desktop) with the key pre-embedded + per-block copy buttons — shown once with a "key is shown only once" warning, dismissable.
  • Enable/disable toggle + exposed-playbook allow-list editor (checkboxes over the agent's user_invocable playbooks; "expose all" clears the list to all).
  • Calls the entitlement-gated /api/agents/{name}/connector* endpoints; reads the agent's playbooks via the OSS /playbooks endpoint (graceful "start the agent" hint when it's stopped).

Gating / safety

  • Hidden in OSS-only builds (no mcp_connector in enterprise_features). Safe to land independently of the enterprise PR — the row simply doesn't render until the module is mounted + entitled.
  • Invariants: single api client (security: Fix token logging and add HTML reports to gitignore #7); component mirrors the existing VoipChannelPanel channel pattern.

Verification

  • Both SFCs compile (vue/compiler-sfc).
  • Clean npm ci + production vite build — 1775 modules, ✓ built.
  • Browser-level interaction is covered by the frontend-e2e CI gate (not run locally — needs the full stack + an entitled backend).

Related to Abilityai/trinity-enterprise#46

🤖 Generated with Claude Code

The gated-Vue surface for the per-agent MCP connector. Adds a "MCP connector"
channel row to the Sharing tab, shown ONLY when the `mcp_connector` entitlement
is present (enterpriseStore.isEntitled). Ships in the public bundle with no IP —
the feature backend + gating live in the private trinity-enterprise module.

ConnectorChannelPanel.vue:
- Generate / regenerate / revoke the scoped connector key.
- On generate, surfaces the per-client copy-paste setup (Claude Code, Cursor,
  Claude Desktop) with the key pre-embedded + copy buttons, shown once with a
  "key is shown only once" warning.
- Enable/disable toggle + exposed-playbook allow-list editor (checkboxes over
  the agent's user_invocable playbooks; "expose all" clears the list).
- Calls the entitlement-gated /api/agents/{name}/connector* endpoints; reads the
  agent's playbooks via the OSS /playbooks endpoint.

Verified: both SFCs compile (vue/compiler-sfc); clean `npm ci` + production vite
build green (1775 modules).

Related to Abilityai/trinity-enterprise#46

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dolho

dolho commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Review — connector Sharing-tab UI (self-review)

Gating, the once-only secret handling, and the build are sound. Only low-severity items.

🟡 Low — stale allow-list names linger

syncAllowListState seeds selected from status.exposed_playbooks; if a stored name is no longer in the agent's live user_invocable playbooks it won't render a checkbox, but it stays in selected and is re-sent on the next saveAllowList (harmless — the backend intersects with the live set, so it's inert — but the stored list slowly accumulates dead names). Consider pruning selected to availablePlaybooks on load.

🟡 Low — saveAllowList fires per checkbox toggle

Every @change does a PUT. Fine functionally, but rapid edits = a burst of requests and the last-write-wins race is benign only because each PUT sends the full set. A debounce or an explicit "Save" would be gentler. Not blocking.

🟡 Note — secret is rendered into the DOM

freshSnippets puts the raw key in a <pre> (standard for a "shown once" secret + copy button). It's in-memory only and dismissable — acceptable, matching how MCP keys are surfaced elsewhere. Worth a mental note that a screen-share during setup exposes it (inherent to copy-paste onboarding).

✅ Verified good

  • Hidden unless enterpriseStore.isEntitled('mcp_connector'); endpoints are also gated server-side (defense in depth).
  • exposeAll ↔ checkbox state derived correctly from exposed_playbooks == null; checkboxes disabled while "expose all".
  • Stopped-agent playbook fetch degrades to a "start the agent" hint (503), not a hard error.
  • Clean npm ci + production vite build green (1775 modules); single api client (Invariant security: Fix token logging and add HTML reports to gitignore #7); mirrors the existing VoipChannelPanel pattern.

Cross-PR

The blocking issues are upstream of the UI (key cleanup on trinity#1356, config-row orphan on trinity-enterprise#51). The UI's "generate key if !has_key" flow actually masks the orphan-config case gracefully (stale config shows but with no key until regenerated), so no UI change is needed for those.

…#46 review)

- Prune: after loading the agent's live playbooks, drop any selected allow-list
  name that's no longer a user_invocable playbook, so dead names don't linger
  and get re-sent on every save.
- Debounce: coalesce a burst of per-playbook checkbox toggles into one PUT
  (400ms); each send is the full set so last-write-wins is safe. The "expose
  all" toggle still saves immediately.

SFC compiles clean. Related to Abilityai/trinity-enterprise#46
@dolho

dolho commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

✅ Both UI findings fixed in f9e5b25.

  • Stale allow-list names: after the live playbooks load, selected is pruned to current user_invocable names — dead entries no longer linger or get re-sent.
  • Per-toggle PUTs: per-playbook checkbox changes are now debounced (400ms, full-set last-write-wins); the "expose all" toggle still saves immediately.
  • Secret-in-DOM: left as-is (documented once-only display + copy button, in-memory).

SFC compiles clean.

@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

…ld fix)

The design-token check rejects status-error-* (no such palette); the danger
palette is the correct destructive/error token. Fixes the failing build job.

Related to Abilityai/trinity-enterprise#46

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/validate-pr: APPROVE. Entitlement-gated MCP-connector Sharing-tab UI (ent#46 PR2); hidden in OSS-only builds. Self-review findings already fixed (f9e5b25); prod vite build green; single api client (#7). Security clean, mergeable, all checks green. Stale nightly 'merge conflict' comment is outdated — live status MERGEABLE.

@vybe
vybe merged commit 1087e1a into dev Jun 30, 2026
18 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