Add organization MCP integrations#2339
Conversation
|
Added the missing OAuth Applications half of the organization integrations work. Update includes:
Verification after this update:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 341c5afcc1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <div class="space-y-6"> | ||
| <div class="space-y-1"> | ||
| <Muted> | ||
| Connect AI tools and OAuth-based integrations for {organizationQuery.data?.name ?? 'this organization'}. |
There was a problem hiding this comment.
Avoid implying the OAuth grant is organization-scoped
When a member of multiple organizations opens this tab for organization A, this copy says the AI/OAuth integration is for A, but the same commit documents that OAuth tokens store only user/client/resource/scopes and grant access across all accessible organizations (docs/organization-integrations-plan.md:7-8). Since AiToolsSetup starts the normal MCP OAuth flow without passing an organization, authorizing from this page can expose other organizations despite the org-scoped UI; either keep the setup user-scoped or add an explicit warning until organization-scoped grants exist.
Useful? React with 👍 / 👎.
| } | ||
| ]); | ||
| const organizationId = organization.current; | ||
| const href = organizationId ? resolve('/(app)/organization/[organizationId]/integrations', { organizationId }) : resolve('/(app)/organization/list'); |
There was a problem hiding this comment.
Wait for selected organization before redirecting old links
When this compatibility route is hit before organization.current has been restored (for example a logged-out user follows an old /account/ai-tools link, logs in, and localStorage was cleared by logout), the effect immediately chooses /organization/list and replaces the URL, so the page unmounts before the app layout can populate the first valid organization. Valid users with organizations therefore do not get redirected to the new Integrations page; wait for organization initialization or query the user's organizations before falling back to the list.
Useful? React with 👍 / 👎.
|
Updated the PR to address the MCP/OAuth follow-up:
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 555e0afe77
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </Tabs.Content> | ||
|
|
||
| <Tabs.Content value="oauth-applications" class="mt-6"> | ||
| <OAuthApplicationsManager |
There was a problem hiding this comment.
Gate the admin-only OAuth manager
For non-global organization members, this organization page now mounts the same OAuth application manager used by the System page, but that manager calls /admin/oauth-applications and the controller is protected by GlobalAdminPolicy; the System page wraps it in GlobalUser, while this tab does not. As a result, normal organization users see an OAuth Applications tab/New OAuth App flow that can only fail with access denied. Gate this tab/manager to global admins or replace it with an organization-scoped integrations API when available.
Useful? React with 👍 / 👎.
|
Follow-up update:
Docs checked:
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b92ffcc04
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - The organization settings area now has an Integrations tab with URL-addressable MCP and OAuth Applications sub-tabs. | ||
| - The MCP setup dropdown focuses on VS Code MCP, Cursor MCP, and GitHub Copilot CLI, with direct setup commands or install links where the client supports them. | ||
| - The Integrations page also has an OAuth Applications tab that reuses the same list, create, edit, disable, and delete management flow as the System OAuth Apps page. | ||
| - The legacy account-level AI Tools redirect has been removed so integrations remain organization-scoped. |
There was a problem hiding this comment.
Keep a compatibility route for AI Tools links
When users or bookmarks still hit the existing /account/ai-tools URL, SvelteKit now has no route to handle it, so they get a 404 instead of reaching the new organization Integrations page. Fresh evidence: this line states the legacy redirect was removed, and rg -n "ai-tools" finds no current route in the tree. Keeping a small redirect route that resolves the selected or first organization would preserve old links while still landing on the organization-scoped page.
Useful? React with 👍 / 👎.
Summary
Backend Notes
Verification
Notes
Breaking Changes