@@ -79,6 +79,7 @@ type OAuthTokens = OAuthCompletionPayload;
7979type ProbeResult = {
8080 connected : boolean ;
8181 requiresOAuth : boolean ;
82+ supportsDynamicRegistration : boolean ;
8283 name : string ;
8384 namespace : string ;
8485 toolCount : number | null ;
@@ -315,7 +316,7 @@ export default function AddMcpSource(props: {
315316 const isAdding = state . step === "adding" ;
316317 const isOAuthBusy =
317318 state . step === "oauth-starting" || state . step === "oauth-waiting" || oauth . busy ;
318- const canUseNone = probe ?. requiresOAuth !== true ;
319+ const canUseNone = probe ?. requiresOAuth !== true || probe . supportsDynamicRegistration === false ;
319320 const remoteHeadersComplete = remoteHeaders . every (
320321 ( header ) => header . name . trim ( ) && header . value . trim ( ) ,
321322 ) ;
@@ -622,7 +623,7 @@ export default function AddMcpSource(props: {
622623 < FieldLabel > Authentication</ FieldLabel >
623624 < FilterTabs < RemoteAuthMode >
624625 tabs = {
625- probe . requiresOAuth
626+ probe . requiresOAuth && probe . supportsDynamicRegistration
626627 ? [ { value : "oauth2" , label : "OAuth" } ]
627628 : [
628629 { value : "none" , label : "None" } ,
@@ -649,16 +650,24 @@ export default function AddMcpSource(props: {
649650 label = "Connect via OAuth"
650651 help = "Start the provider OAuth flow."
651652 >
652- { ! tokens && state . step === "probed" && (
653- < Button
654- type = "button"
655- onClick = { handleOAuth }
656- variant = "outline"
657- className = "w-full"
658- >
659- Sign in
660- </ Button >
661- ) }
653+ { ! tokens &&
654+ state . step === "probed" &&
655+ ( probe . supportsDynamicRegistration ? (
656+ < Button
657+ type = "button"
658+ onClick = { handleOAuth }
659+ variant = "outline"
660+ className = "w-full"
661+ >
662+ Sign in
663+ </ Button >
664+ ) : (
665+ < div className = "rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground" >
666+ This server requires OAuth, but its authorization server does not support
667+ dynamic client registration. Use request headers with a bearer token, or
668+ save the source and connect a supported OAuth connection later.
669+ </ div >
670+ ) ) }
662671
663672 { ! tokens && state . step === "oauth-starting" && (
664673 < div className = "flex min-h-9 items-center gap-2 rounded-md border border-border bg-muted/30 px-3 py-2" >
0 commit comments