-
Notifications
You must be signed in to change notification settings - Fork 546
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
each transport implementation should define its own options object if necessary
That sounds reasonable.
Originally posted by @stephentoub in #181
Spinning off this conversation into a new issue. What I have in mind roughly is change the McpClientFactory signature to be the following:
public static class McpClientFactory
{
public static async Task<IMcpClient> CreateAsync(
IClientTransport transport,
McpClientOptions? clientOptions = null,
ILoggerFactory? loggerFactory = null,
CancellationToken cancellationToken = default);
}Then exposing bespoke configuration options for individual transports
public record StdioClientTransportOptions
{
public string Executable { get; init; }
public IReadOnlyList<string> Arguments { get; init; }
/* etc etc */
}
public class StdioClientTransport : IClientTransport
{
public StdioClientTransport(StdioClientTransportOptions options, ....); // No McpServerConfig argument anymore
}This seems perfectly doable, the only blocker in my view is that ITransport instances are currently stateful. For this to work best we need to be able to offload all their state in session objects created by the client factory. cc @halter73
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request