Skip to content

feat(mcp): make per-agent MCP connector OSS-core (trinity-enterprise#118 Part A)#1555

Merged
vybe merged 2 commits into
devfrom
feature/118-mcp-connector-oss
Jul 9, 2026
Merged

feat(mcp): make per-agent MCP connector OSS-core (trinity-enterprise#118 Part A)#1555
vybe merged 2 commits into
devfrom
feature/118-mcp-connector-oss

Conversation

@dolho

@dolho dolho commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Relocates the per-agent MCP connector (ent#46/#55/#51, shipped v0.8.0 entitlement-gated as mcp_connector) from the private enterprise submodule into OSS core, un-gated. Per Eugene's decision (2026-07-09) this is a platform-adoption surface, not a paid module. Part A of trinity-enterprise#118; the paired enterprise removal is trinity-enterprise PR (linked below). Part B (email-auth onboarding, #848) is deferred pending design sign-off.

What moved (mostly relocation + un-gate)

  • Backend (router → service → db, Invariants Fix: Add missing Docker labels to system agent container #1/Feature/gemini runtime support #2/Add internal health route, without which main didn't start #14): routers/connector.py (mounted unconditionally, no requires_entitlement), services/connector_service.py, db/connector.py (ConnectorOperations + facade delegators), 5 models in models.py.
  • Schema: enterprise_connectors re-homed onto OSS dual-track — db/tables.py, db/schema.py, db/migrations.py:enterprise_connectors_table + Alembic 0015_enterprise_connectors. Name kept so existing enterprise installs adopt their data with zero migration (CREATE TABLE IF NOT EXISTS, no duplicate-table drift). Delete/rename cascade via an enterprise_connectors AGENT_REF.
  • Frontend: ConnectorChannelPanel un-gated in SharingPanel.vue (dropped isEntitled('mcp_connector') + now-unused enterprise-store wiring).
  • Already-OSS, unchanged: connector.ts proxy tools, the connector-scope auth fence in dependencies.py, ExposedToolsPanel.vue.

Acceptance criteria (Part A)

  • Full connector works in an OSS-only build (mint/regenerate/revoke, snippets, enable toggle, allow-list).
  • Backend relocated to OSS core; table re-homed to OSS dual-track with zero-migration adoption.
  • ConnectorChannelPanel.vue un-gated.
  • mcp_connector removed from the entitlement registry (paired enterprise PR deletes register_module).
  • Public docs: requirements mcp.md §7.5 + feature-flows/mcp-connector.md + architecture/index.

Testing

tests/unit/test_118_mcp_connector_oss.py — 11 passed (service helpers, config CRUD, key mint/regenerate/revoke, scope='connector' validate contract). Guards green: schema-parity, alembic-parity, revision-id-length, models-centralized. SharingPanel.vue compiles.

Coordination notes

  • Merge with the enterprise PR (removes the private module + mcp_connector registration) so the router isn't double-mounted at runtime.
  • Alembic: this adds 0015_enterprise_connectors (down_revision 0014). The voice PR test(ci): auto-trigger frontend-e2e (nightly + frontend paths), keep ui opt-in (#1526) #1551... (correction) — the voice-replies branch also uses 0015/0016; whichever merges second must rebase its revision's down_revision. Flagging for the merge order.

Related to trinity-enterprise#118

🤖 Generated with Claude Code

…118 Part A)

Relocate the per-agent MCP connector (ent#46/#55/#51, shipped v0.8.0 entitlement-
gated as `mcp_connector`) from the private enterprise submodule into OSS core, and
drop the entitlement gate front and back. Decision (Eugene, 2026-07-09): sharing
agents via individual MCP connectors is a platform-adoption surface, not a paid
module.

Backend (router → service → db, Invariants #1/#2/#14):
- routers/connector.py — /api/agents/{name}/connector* (config, mint/regenerate/
  revoke key, playbooks), mounted unconditionally in main.py; no requires_entitlement.
- services/connector_service.py — snippet builder + playbook resolution.
- db/connector.py (ConnectorOperations) — config CRUD + scoped-key mint/revoke
  into mcp_api_keys (scope='connector'); facade delegators on database.py.
- models.py — ConnectorConfigUpdate/Status/KeySecret/Playbook/ClientSnippet.

Schema: enterprise_connectors table re-homed onto OSS dual-track (db/tables.py,
db/schema.py, db/migrations.py:enterprise_connectors_table + Alembic
0015_enterprise_connectors). Name kept so existing enterprise installs adopt their
data with zero migration (CREATE TABLE IF NOT EXISTS, no duplicate-table drift).
Delete/rename cascade via an enterprise_connectors AGENT_REF.

Frontend: ConnectorChannelPanel un-gated in SharingPanel.vue (dropped the
isEntitled('mcp_connector') v-if + the now-unused enterprise store wiring).

The MCP proxy tools (connector.ts), the connector-scope auth fence
(dependencies.py), and ExposedToolsPanel.vue were already OSS and edition-agnostic.
`mcp_connector` is removed from the entitlement registry by the paired enterprise
PR (deletes register_module).

Docs: requirements mcp.md §7.5 + feature-flows/mcp-connector.md + architecture/index.
Tests: tests/unit/test_118_mcp_connector_oss.py (11) — service helpers, config CRUD,
key mint/regenerate/revoke, scope='connector' validate contract.

Part B (email-auth onboarding, #848) deferred pending design sign-off.

Related to trinity-enterprise#118

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dolho
dolho requested a review from vybe July 9, 2026 13:25
… double-mounted (#118)

#1555 makes the per-agent MCP connector OSS-core. The enterprise submodule was
pinned at 630cca9e, which still ships backend/mcp_connector/ and registers it via
register_enterprise() — so an enterprise build would double-mount the connector
router alongside the new OSS-core one. Bump the pin to f5d69be6 (enterprise main
post trinity-enterprise#121), where the private module is removed.

This forward-integrates two already-on-enterprise-main commits into the pin:
  - trinity-enterprise#121 — removes backend/mcp_connector/ (the intended pair)
  - trinity-enterprise#120 — ENTERPRISE_LOCAL_DEV docs (docs only)
  - trinity-enterprise#106 — client-portal umbrella (already on enterprise main)

OSS-only CI is unaffected (submodule is update=none / "boots without enterprise").

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@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.

Validated via /validate-pr. Makes the per-agent MCP connector OSS-core (trinity-enterprise#118 Part A); paired with trinity-enterprise#121 (merged) which removes the private module. I pushed commit 2b592b8 bumping the enterprise submodule pin 630cca9e → f5d69be6 (post-#121) so an enterprise build won't double-mount the connector router. Required checks green; OSS-only CI unaffected (submodule is update=none). Security scan clean. Approving to complete the pair.

@vybe
vybe merged commit 8a025bb into dev Jul 9, 2026
24 checks passed
obasilakis added a commit that referenced this pull request Jul 12, 2026
…nto 0015_enterprise_connectors (#1081)

Resolves the PR #1550 review blockers.

Conflicts (all additive-vs-additive, both sides kept):
- db/migrations.py — dev's enterprise_connectors_table (#118) + this branch's two
  pull migrations; MIGRATIONS list ordered to match the new Alembic chain.
- canary/snapshot.py — dev's E-04/G-04 queued_meta collection (#1077) alongside
  this branch's lease_expires_at collection (#1081 Phase 3). Both columns are
  PRAGMA-guarded independently.
- tests/test_canary_invariants.py — _add_execution helper takes both parameter
  sets (duration_ms/queued_at/backlog_metadata + lease_expires_at).
- learnings.md — both sides' entries retained.

Alembic re-chain (two heads after #1555 landed 0015_enterprise_connectors off
0014, which this branch also chained off):
- 0015_schedule_executions_pull_claim_lease -> 0016, down_revision now
  0015_enterprise_connectors.
- 0016_schedule_executions_redelivery_count -> 0017.
- Chain is linear again: 0014 -> 0015_enterprise_connectors -> 0016 -> 0017
  (single head, verified via ScriptDirectory.get_heads()).
- Rollback runbook downgrade target corrected: 0015_enterprise_connectors, NOT
  0014 — the latter would also drop dev's enterprise_connectors table.

SQLite track reconciled: enterprise_connectors_table + the two pull migrations
all present in MIGRATIONS, in Alembic order.
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