Skip to content

feat: move MCP server sign-in to Agents settings and simplify the + menu - #31396

Merged
ibetitsmike merged 28 commits into
mainfrom
mike/mcp-picker-settings
Oct 29, 2026
Merged

ibetitsmike merged 28 commits into
mainfrom
mike/mcp-picker-settings

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Signing in to MCP servers moves out of the chat's + menu to a new Agents > Settings > MCP connections page. The menu becomes an on/off list.

  • + menu: one "MCP servers" row with an "N on" count opens the server list, to the side on desktop and as a drill-in on mobile. Each server the chat can use has one switch. An OAuth2 server that is on for the chat but not connected (on by default, forced on, or its sign-in ended) stays in the list with an orange status dot instead of a switch (hover shows "Not connected", which is also its screen reader label), and a forced-on one still tells screen readers it is always on; other unconnected OAuth2 servers are left out until the user connects. A one-line footer counts the enabled OAuth2 servers the user has not connected ("1 not connected", or "All connected") beside a Manage button that opens the settings page for the chat's organization. On desktop, the settings Back button returns to the chat. On phones, opening the MCP servers drill-in, or the existing Attach workspace drill-in, moves keyboard focus to its Back button, and Back returns focus to the row that opened it.
  • MCPs pill: the composer always shows one MCP pill, "Add MCPs" when none are on, otherwise "1 MCP" or "N MCPs". The per-server pills and their remove buttons are gone. The pill opens the same list. Read-only chats show disabled switches and no Manage button, and hide the pill when no server is on.
  • MCP connections page: two sections. "Added connectors" is a table of the servers a chat can use now: connected OAuth2 servers with Disconnect (the existing confirm dialog), then servers without user sign-in (no auth, an admin-set API key, custom headers, or the user's Coder login) marked "No auth required". Its header shows an "N of M" count and, when any are left, a "View N available" button that scrolls to and focuses the next section. "Available connectors" is a card grid (3, 2 or 1 per row by width) of the OAuth2 servers the user has not signed in to, each with a Connect button (the existing popup flow); it is hidden when none are left. An organization picker shows when the user belongs to more than one organization, preselected when the page opens from a chat. A sign-in that finishes after the user switches organizations still shows its confirmation, and every organization's server list refreshes. The page lists the same member organizations as the Skills settings page, through one shared helper.
  • Removed: the Auth and Disconnect controls in the chat input and the props that only served them. As agreed for this change, connecting a server no longer turns it on in the chat automatically: it shows up in the menu switched off unless its policy turns it on.
  • Docs: a new "Connect to MCP servers" section in Extending agents covers the user steps. It covers the MCP pill, the not-connected dot, and the No auth required rows. The MCP servers admin page points to it, its default_off row notes that OAuth2 servers are listed once the user connects, and the Organization scope table gets an MCP server connections row.

Screenshots

The + menu on desktop with the MCP servers row (3 on) open to the side: Alpha OAuth with an orange not-connected dot, Bravo OAuth on, Charlie OAuth locked on, Delta Open off, Echo Key on, and the footer that reads 1 not connected beside Manage

The 3 MCPs pill open with the same five-server list, the orange dot on Alpha OAuth, and the 1 not connected footer

The MCP servers drill-in on a 390 px wide phone, with Back at the top, the same server list, and the one-line footer

The MCP connections settings page on desktop: an Added connectors table with a 3 of 6 badge and a View 3 available button, listing GitHub with Disconnect and two servers marked No auth required, above an Available connectors grid of three cards, Coder, Granola and Wiz, each with Connect

The same page at 390 px wide, where the table keeps each name and its action and the available connector cards stack in one column

Known limitations

  • In a read-only chat, the not-connected dot and the footer count reflect the viewer's own sign-ins, not the chat owner's, because the servers API reports connection state for the signed-in user.
  • Unchanged by this PR: in a chat that already has a recorded server selection, switch changes that were not sent with a message are lost when you leave the chat, which now includes leaving through Manage. A blocked sign-in popup gives no feedback, and a failed disconnect whose error carries its own message (such as "Network Error") shows that message without the server name. A connection made in another tab shows after a reload, because window-focus refetching is off app-wide.

Review and validation

  • Frontend review (frontend-deep-review, eight roles) on the first commit and on each fix delta, plus the FE1 to FE10 audit; the last round has no open findings. Findings not taken are listed below with the reason. Not split into a stack: the menu, the settings page, and the removal only make sense together.
  • doc-check in author self-check mode (seven personas and per-finding verifiers): the six blocking findings are fixed in 425c1a1978e. A confirmation round on the revised text found ten more (step structure, wording that pointed at screen positions, product terms, the access prerequisite, and read-only chats), fixed in 26580671a23.
  • Codex (@codex review) found no major issues on 425c1a1978e. On 26580671a23 it raised six findings. Two were real defects, each now covered by a test that fails without the fix: the settings page did not confirm a sign-in that finished after the user switched organizations (dac62b6585b), and keyboard focus fell out of the menu when a phone drill-in opened or closed (a39e7a16fd1). Three asked for comment and assertion trims (b48471aa965). One is declined below. Round 3 on c259aac2c60 asked for a JSDoc on the exported connections view (b6a706dfa37). Round 4 on b6a706dfa37 found that a disconnected forced-on server no longer told screen readers it is always on, as main did with hidden text; 593f8115ad8 restores it, with a test that fails without it. Round 5 found no major issues on 446d22e619d.
  • Remote UAT through Coder Agents on an isolated test deployment, seven rounds. Round 1 was blocked by dogfood infrastructure. Rounds 2 and 3 failed (the footer's manage button clipped in the desktop submenu, then the settings table scrolling sideways beside the settings sidebar and at 320 px), and both were fixed. Round 4 passed on 08c8477ef22, and round 5, a smoke test after merging main, passed on 82229eeb806 with the server and frontend rebuilt from that SHA. Round 6 passed on c259aac2c60 (keyboard focus in the phone drill-ins at 390 and 320 px, and a sign-in that finishes after an organization switch). Round 7 passed on 446d22e619d: the footer stays on one line with Manage in all 18 cases checked (0, 1 and 2 servers not connected, on six menus at 1440, 390 and 320 px), and a signed-out always-on server reads as always on to screen readers. The rounds covered the footer at 1440, 390 and 320 px, the table from 320 to 1440 px, member organizations (two, one, and none), Connect and Disconnect against a mock OAuth server, and a real model turn whose tool list followed the switches.
  • Local: tsc, Biome, oxlint, knip, Vitest for the touched files, the Storybook Vitest project for the Agents page components, and make pre-commit-light. CI's test-js caught one test that rendered the create form without a router, which the Manage button's navigation needs; d44a7628fe1 wraps it in MemoryRouter. The pre-commit hook (make pre-commit) ran on every commit.
  • Pixel may show the new one-line footer ("1 not connected" beside Manage) in the MCP menu stories, and focus-ring changes in the phone stories that drive a drill-in (MCPSubmenuMobile, UncheckSelectedWorkspaceFromPicker), because focus now moves to Back on entry. The MCP connections page stories show Connect without the arrow icon, status dots without text, and "No auth required" rows; the OneServerWithoutSignIn story is removed and Empty now has no servers. The composer stories show one MCP pill.
Review findings not taken
  • RO3: each settings page picks the selected, then the default, then the first organization on its own. The Skills page (main's code) runs that chain over wrapper objects, so one helper would need an accessor for two differently shaped call sites.
  • DF6: switch changes that were not sent are lost when you leave the chat. This is the pre-existing chat page state, listed under known limitations.
  • SA6: the table's Description cell hides below its container width. It holds no controls, and the cards keep their two-line descriptions at every width.
  • FE9: the OAuth hook test marks its iframe popup closed with Object.defineProperty, because jsdom does not implement Window.closed. It patches the test's own iframe window, not a shared global.
  • The other Connect buttons stay disabled while one sign-in is in progress, by design: the OAuth flow tracks one popup at a time.
  • The LoadingMobile story spells out its two args like the other stories in the file instead of reusing Loading.args.
  • Codex: the menu row keeps the icon markup that moved unchanged from main's AgentChatInput instead of MCPServerIcon, whose bordered tile or circle would change how the menu looks. A compact variant can follow separately.
  • RP6: the drill-in focus state (lastPlusMenuSubmenu and its two handlers) stays in AgentChatInput component state, because FE3 discourages a new single-use hook when component state can express the logic.
  • RO1: the new tests and stories spread MockMCPServerConfig into per-scenario servers, as the existing AgentChatInput tests do, instead of importing MockGitHubMCPServer from the AI settings page's own fixtures.
  • RO3 (nit): the connections page test and the OAuth hook test each keep their small popup helpers instead of sharing them through testHelpers.
  • TN6: the footer count has no noun ("1 not connected"), as the owner asked.

Xum opened this PR on behalf of @ibetitsmike.

- Shorten the footer count to "N not connected" so Manage connections
  fits the w-72 menu, and let the footer wrap instead of clipping.
- Hide the Status column below sm on MCP connections; the action button
  already shows the state there.
- Docs: a server that is on for a chat but not connected, including a
  default-on one, shows as disconnected.
…able width

Beside the settings sidebar the table is much narrower than the viewport,
so viewport breakpoints still let it scroll sideways and hide the action
buttons. Use container queries on the table wrapper: below 32rem only the
name (which fills and truncates) and the action show, the description
comes back at 32rem and the status at 42rem.
# Conflicts:
#	site/src/pages/AgentsPage/components/AgentChatInput.test.tsx
Add a phone-width story for the MCP connections loading skeleton, hoist
the footer's plural noun out of the JSX, and tighten two comments.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum posted this comment on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T05:36:35.866134Z 9d72d96 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 425c1a1978

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

Xum posted this comment on behalf of @ibetitsmike.

@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: 26580671a2

ℹ️ 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 MCP connections page looked up the signed-in server in the list of
the organization shown when the popup reported success. If the user had
switched organizations while signing in, the lookup missed and no
confirmation toast appeared, and only the shown organization's list was
refreshed.

useMCPOAuthFlow now takes the server to connect and hands the same
server back on success, so the page confirms the sign-in without a
lookup. A completion refreshes every organization's MCP server list
through the existing invalidateMCPServerConfigQueries helper, now
exported.
…us menu submenus

Below the md breakpoint, the plus menu swaps its main view for the MCP
servers or workspace submenu. The swap unmounted the row a keyboard user
had activated, and focus fell to the page. The submenu's Back button now
takes focus when it mounts, and Back returns focus to the row that
opened the submenu. Reopening the menu still focuses its first item.
… assertion

Drop the JSDoc that restated getStateOrganizationId, shorten the
MCPServersMenuContent JSDoc to its optional-handler contract, and drop
the cancelled-disconnect test's dialog-absence check. The test still
asserts that cancelling never calls the disconnect API.
Follow-up to the frontend review of the previous fixes:

- Both below-md submenus render one PlusMenuBackButton, and a
  plusMenuRowRef helper picks the row that takes focus back. The
  focusOnMount comment names the below-md condition and records why a
  callback ref replaces autoFocus.
- The submenu focus test also walks the workspace submenu after the MCP
  one, so Back has to return focus to the row that opened it.
- The connections page test shares stubSignInPopup and completeSignIn
  helpers, and the hook test uses MockMCPServerConfig instead of a new
  local fixture.
- invalidateMCPServerConfigQueries, now exported, gets a JSDoc.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum posted this comment on behalf of @ibetitsmike.

@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: c259aac2c6

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

Xum posted this comment on behalf of @ibetitsmike.

@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: b6a706dfa3

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

Xum posted this comment on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 446d22e619

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

…ctionsPage): drop arrow icon from Connect button
…ctionsPage): match No auth required to the row text size
…ectionsPage): list no-auth servers after OAuth2 servers
…s with if statements

The MCP connections table shows only the error alert when the first load fails, the plus menu's submenus share one panel component, and a test fixture gets the mock prefix.
…ConnectionsPage): resolve the starting organization once with if statements
…ectionsPage): split added and available connectors
@ibetitsmike
ibetitsmike marked this pull request as ready for review October 29, 2026 05:34
@ibetitsmike
ibetitsmike requested a review from a team as a code owner October 29, 2026 05:34
@pr-queue-manager
pr-queue-manager Bot requested a review from jakehwll October 29, 2026 05:34
@ibetitsmike
ibetitsmike merged commit 036d286 into main Oct 29, 2026
39 checks passed
@linear-code

linear-code Bot commented Nov 5, 2026

Copy link
Copy Markdown

IT-851

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