fix(web): correct the OAuth header hint, keep utils off components (#1915)

Round-4 review follow-ups on #2038.

The Custom Headers hint claimed a custom `Authorization` value is "ignored"
once OAuth is configured. Verified against the installed
@modelcontextprotocol/client: both SSE and streamable-HTTP `_commonHeaders()`
set the bearer first and then spread `requestInit.headers`, so a custom
value *overrides* the OAuth token. The hint told users the opposite of what
would happen, and could have them silently break their own auth. Corrected in
both places — the modal's new hint and the pre-existing one in
ServerSettingsForm, which carried the same wrong claim.

`utils/serverSettingsPatch.ts` imported both its shared types from
components, reversing the one-way `components -> utils` direction AGENTS.md
sets. `KeyValuePair` moves to `utils/keyValuePairs.ts` (KeyValueRows
re-exports it), and the mode is spelled as a literal union — still checked,
since `ServerConfigModalMode` must stay assignable to it at the call site.

Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-08-16 22:14:40 -04:00
commit 51d35d864b

View file

@ -611,9 +611,11 @@ export function ServerSettingsForm({
<Stack gap="md">
<Group justify="space-between">
<HintText>
Headers sent with every HTTP request to this server. If OAuth is
configured below, the `Authorization` header is owned by the
OAuth flow and any value set here is ignored.
Headers sent with every HTTP request to this server. A custom
`Authorization` header takes precedence over an OAuth access
token — the SDK transports apply these headers last — so remove
it once OAuth is configured, or the flow's token never gets
sent.
</HintText>
<AddButton onClick={onAddHeader}>+ Add Header</AddButton>
</Group>