Add AspNetCoreSseServer sample (#81)
* Add AspNetCoreSseMcpTransport sample * Fix build errors after rebase * React to McpServerFactory changes * Make Utf8JsonWriter non thread static * Fix test errors caused by not rebasing the HttpLister changes on factory overhaul commit
This commit is contained in:
parent
b5a26e4c33
commit
90dfc35fbd
1 changed files with 635 additions and 332 deletions
|
|
@ -57,7 +57,7 @@ public sealed class McpServerHandlers
|
|||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
internal McpServerOptions OverwriteWithSetHandlers(McpServerOptions options)
|
||||
internal void OverwriteWithSetHandlers(McpServerOptions options)
|
||||
{
|
||||
PromptsCapability? promptsCapability = options.Capabilities?.Prompts;
|
||||
if (ListPromptsHandler is not null || GetPromptHandler is not null)
|
||||
|
|
@ -118,22 +118,20 @@ public sealed class McpServerHandlers
|
|||
};
|
||||
}
|
||||
|
||||
return options with
|
||||
{
|
||||
GetCompletionHandler = GetCompletionHandler ?? options.GetCompletionHandler,
|
||||
Capabilities = options.Capabilities is null ?
|
||||
new()
|
||||
{
|
||||
Prompts = promptsCapability,
|
||||
Resources = resourcesCapability,
|
||||
Tools = toolsCapability,
|
||||
} :
|
||||
options.Capabilities with
|
||||
{
|
||||
Prompts = promptsCapability,
|
||||
Resources = resourcesCapability,
|
||||
Tools = toolsCapability,
|
||||
},
|
||||
};
|
||||
options.Capabilities = options.Capabilities is null ?
|
||||
new()
|
||||
{
|
||||
Prompts = promptsCapability,
|
||||
Resources = resourcesCapability,
|
||||
Tools = toolsCapability,
|
||||
} :
|
||||
options.Capabilities with
|
||||
{
|
||||
Prompts = promptsCapability,
|
||||
Resources = resourcesCapability,
|
||||
Tools = toolsCapability,
|
||||
};
|
||||
|
||||
options.GetCompletionHandler = GetCompletionHandler ?? options.GetCompletionHandler;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue