Remove McpServerConfig and have McpClientFactory accept IClientTransport instances directly. (#230)
* Remove McpServerConfig and have McpClientFactory accept IClientTransport instances directly. * Address feedback and use lists when representing stdio arguments. * Use "Name" for transport descriptors and "EndpointName" for MCP clients and servers. * Update code samples. * Fix source file naming
This commit is contained in:
parent
8bd9ee81c0
commit
3e21f3594a
1 changed files with 315 additions and 527 deletions
|
|
@ -5,6 +5,36 @@
|
|||
/// </summary>
|
||||
public record SseClientTransportOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// The base address of the server for SSE connections.
|
||||
/// </summary>
|
||||
public required Uri Endpoint
|
||||
{
|
||||
get;
|
||||
init
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(value), "Endpoint cannot be null.");
|
||||
}
|
||||
if (!value.IsAbsoluteUri)
|
||||
{
|
||||
throw new ArgumentException("Endpoint must be an absolute URI.", nameof(value));
|
||||
}
|
||||
if (value.Scheme != Uri.UriSchemeHttp && value.Scheme != Uri.UriSchemeHttps)
|
||||
{
|
||||
throw new ArgumentException("Endpoint must use HTTP or HTTPS scheme.", nameof(value));
|
||||
}
|
||||
|
||||
field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a transport identifier used for logging purposes.
|
||||
/// </summary>
|
||||
public string? Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Timeout for initial connection and endpoint event.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue