Fall back to well-known URL in client if 401 response is missing resource_metadata parameter (#1054)
This commit is contained in:
parent
d99f882884
commit
970207989e
1 changed files with 497 additions and 134 deletions
|
|
@ -104,17 +104,11 @@ internal sealed partial class McpClientImpl : McpClient
|
|||
McpJsonUtilities.JsonContext.Default.ElicitResult);
|
||||
|
||||
_options.Capabilities ??= new();
|
||||
if (_options.Capabilities.Elicitation is null)
|
||||
_options.Capabilities.Elicitation ??= new();
|
||||
if (_options.Capabilities.Elicitation.Form is null &&
|
||||
_options.Capabilities.Elicitation.Url is null)
|
||||
{
|
||||
// Default to supporting only form mode if not explicitly configured
|
||||
_options.Capabilities.Elicitation = new()
|
||||
{
|
||||
Form = new(),
|
||||
};
|
||||
}
|
||||
else if (_options.Capabilities.Elicitation.Form is null && _options.Capabilities.Elicitation.Url is null)
|
||||
{
|
||||
// If ElicitationCapability is set but both modes are null, default to form mode for backward compatibility
|
||||
// If both modes are null, default to form mode for backward compatibility.
|
||||
_options.Capabilities.Elicitation.Form = new();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue