Skip to content

feat: add organization picker to MCP server settings pages - #28150

Merged
ibetitsmike merged 51 commits into
mainfrom
mike/codagt-714-mcp-org-picker
Aug 19, 2026
Merged

feat: add organization picker to MCP server settings pages#28150
ibetitsmike merged 51 commits into
mainfrom
mike/codagt-714-mcp-org-picker

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Adds an organization picker to the MCP server settings pages so multi-org deployments can manage every organization's MCP servers through the UI, not just the default organization's. Closes CODAGT-714 (scoped to MCP servers only; model configs stay deployment-wide until CODAGT-709 lands).

Stack Context

Top of the CODAGT-711/717/712/806 stack: MCP server configs are org-scoped with RBAC, audit logging, per-config ACLs, and owner-scoped user tokens. This layer makes the admin UI org-aware, resolving the "default org only" limitation documented in the bottom PR.

Summary

  • The MCP servers list and add pages resolve the working organization from an org search param (falling back to the default org), and render an organization picker built on the existing OrganizationAutocomplete. The picker only appears when more than one organization is visible, so single-org deployments see no change.
  • Selecting an organization rewrites the search param, refetches the list for that org, and threads through to the add page so creation posts to the selected organization.
  • The update page now loads the server by ID (new organization-scoped GET /api/experimental/organizations/{organization}/mcp-servers/{id} frontend binding) instead of listing the default org and searching client-side, so servers from any organization can be edited. Post-save navigation returns to the owning organization's list via the server's organization_id.
  • Removes the now-unused getDefaultOrganizationId helper.
  • Review hardening: organization display labels are disambiguated with the unique org name when effective display names collide (picker options, trigger text, and accessible name). Access is no longer restricted to deployment admins: the pages, sidebar item, and nav entry accept org-scoped mcp_server_config permissions, the picker lists only organizations the user can view, content and affordances (add, edit, delete) are gated on the selected organization's permissions, and deployment admins keep full access everywhere.

Testing

Storybook interaction stories cover: picker hidden with one org, switching orgs refetches and swaps list contents, add posting to the URL-selected org, add posting after an in-form org switch (asserting typed form state survives the switch), and update loading by ID. Red-green verified by breaking the search-param resolution and observing the new stories fail.

Mux acted on Mike's behalf for this PR.

@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

CODAGT-714

@ibetitsmike
ibetitsmike marked this pull request as ready for review August 13, 2026 19:38
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c22bcf1ec

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ec9ca4540

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 58a7461b24

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 743da29b38

ℹ️ 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".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-714-mcp-org-picker branch from 743da29 to b9719f5 Compare August 13, 2026 22:00
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@coderagents

coderagents Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/agents/platform-controls/mcp-servers.md - Documented in 028183d7d4: the page now explains that multi-organization deployments use the organization picker to choose which organization's MCP servers to manage, and that the picker only appears when the deployment has more than one organization.

Automated review via Coder Agents

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: b9719f595d

ℹ️ 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".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-714-mcp-org-picker branch from b9719f5 to 5f5235e Compare August 13, 2026 22:31
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 5f5235efe8

ℹ️ 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".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-714-mcp-org-picker branch from 5f5235e to 57fc9dd Compare August 14, 2026 00:06
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 57fc9dda6b

ℹ️ 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".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-714-mcp-org-picker branch from 57fc9dd to 7a52e7f Compare August 14, 2026 00:42
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a52e7fd8c

ℹ️ 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".

Create-only MCP administrators could not reach the add form through
navigation, and its back link and cancel button led to the list page
that rejects them. Gate navigation on create as well as view, redirect
create-only admins to the add page, and omit exit controls when the
list is unreachable.
The backend rejects any update touching a user_oidc server unless the
caller holds deployment update permission, so org-level update grants
saw an Update button and enabled toggle that always failed with 403.
Disable both for user_oidc servers without that permission while
keeping the delete action available.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants