Skip to content

feat(credential-groups): add personal MCP OAuth connections - #7353

Merged
TheodoreSpeaks merged 12 commits into
stagingfrom
feat/api-key-cred-group
Sep 2, 2026
Merged

feat(credential-groups): add personal MCP OAuth connections#7353
TheodoreSpeaks merged 12 commits into
stagingfrom
feat/api-key-cred-group

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • let Credential Groups offer OAuth MCP servers to invited people
  • keep each invitee MCP grant separate and enforce group workflow policies during execution
  • revoke managed connections and release MCP assignments when servers, people, or groups are removed
  • replace the API-key enrollment implementation

Type of Change

  • Feature

Testing

  • bun run lint
  • bun run check:audits
  • bun run check:migrations origin/staging
  • 175 focused Credential Group and MCP tests
  • tested a generic OAuth MCP connection locally

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 2, 2026 1:49am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds invitee-specific OAuth connections for MCP servers in Credential Groups and integrates those managed connections into workflow authoring and execution.

  • Adds public enrollment OAuth initiation and callback handling for managed MCP servers.
  • Adds workspace-scoped managed MCP catalogs and workflow-tool selection.
  • Enforces Credential Group access policies during managed tool execution.
  • Adds connection retirement, assignment cleanup, schema constraints, and lifecycle tests.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the eligible follow-up-review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/api/mcp/oauth/callback/route.ts Adds a sessionless, rate-limited callback path for Credential Group managed MCP OAuth attempts.
apps/sim/lib/mcp/application/execute-managed-tool.ts Executes managed MCP tools through the authorized Credential Group policy boundary and versioned token persistence.
apps/sim/lib/credential-groups/application/public-enrollment.ts Coordinates public enrollment reads and the start and completion of invitee MCP OAuth.
apps/sim/lib/mcp/orchestration/server-lifecycle.ts Extends MCP server lifecycle handling to retire managed connections and release Credential Group assignments.
packages/db/migrations/0315_credential_group_managed_mcp.sql Introduces the persistent relationships needed for Credential Group managed MCP connections.
packages/db/migrations/0316_credential_group_managed_mcp_constraints.sql Adds relational constraints for managed MCP assignments and credential lifecycle.
packages/db/migrations/0317_managed_mcp_external_identity.sql Adds external identity metadata for managed MCP connections.
packages/db/schema.ts Aligns the Drizzle schema with managed MCP assignment, ownership, and external identity records.

Sequence Diagram

sequenceDiagram
  participant Admin as Workspace admin
  participant Invitee
  participant Enrollment as Enrollment API
  participant Provider as MCP OAuth provider
  participant DB as Managed connection store
  participant Runtime as Workflow runtime
  Admin->>Enrollment: Assign OAuth MCP server to Credential Group
  Invitee->>Enrollment: Start OAuth from invitation
  Enrollment->>Provider: Redirect with scoped authorization state
  Provider->>Enrollment: OAuth callback
  Enrollment->>DB: Store invitee-specific managed connection
  Runtime->>DB: Resolve connection under group workflow policy
  Runtime->>Provider: Execute MCP tool
  Provider-->>Runtime: Tool result
Loading

Reviews (3): Last reviewed commit: "fix(credential-groups): harden managed M..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 75 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Re-trigger cubic

Comment thread packages/db/migrations/0316_credential_group_managed_mcp_constraints.sql Outdated
Comment thread apps/sim/lib/credentials/managed-mcp.ts Outdated
Comment thread apps/sim/lib/mcp/service.ts Outdated
Comment thread apps/sim/lib/mcp/service.ts Outdated
Comment thread apps/sim/ee/credential-groups/components/credential-group-detail.tsx Outdated
Comment thread apps/sim/lib/api/contracts/credential-groups.ts Outdated
Comment thread apps/sim/app/api/mcp/oauth/callback/route.ts
Comment thread apps/sim/app/api/mcp/oauth/callback/route.ts
Comment thread apps/sim/hooks/queries/mcp.ts Outdated
Comment thread apps/sim/lib/mcp/utils.test.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

…group

# Conflicts:
#	apps/sim/lib/credential-groups/application/public-enrollment.test.ts
…group

# Conflicts:
#	packages/db/migrations/meta/0317_snapshot.json
#	packages/db/migrations/meta/_journal.json
@TheodoreSpeaks
TheodoreSpeaks merged commit 65a58a8 into staging Sep 2, 2026
27 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the feat/api-key-cred-group branch September 2, 2026 05:27
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.

1 participant