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
|
|
@ -16,20 +16,16 @@ namespace ModelContextProtocol.Tests;
|
|||
|
||||
public class SseIntegrationTests(ITestOutputHelper outputHelper) : KestrelInMemoryTest(outputHelper)
|
||||
{
|
||||
private McpServerConfig DefaultServerConfig = new()
|
||||
private SseClientTransportOptions DefaultTransportOptions = new()
|
||||
{
|
||||
Id = "test_server",
|
||||
Endpoint = new Uri("http://localhost/sse"),
|
||||
Name = "In-memory Test Server",
|
||||
TransportType = TransportTypes.Sse,
|
||||
TransportOptions = [],
|
||||
Location = $"http://localhost/sse"
|
||||
};
|
||||
|
||||
private Task<IMcpClient> ConnectMcpClient(HttpClient httpClient, McpClientOptions? clientOptions = null)
|
||||
=> McpClientFactory.CreateAsync(
|
||||
DefaultServerConfig,
|
||||
new SseClientTransport(DefaultTransportOptions, httpClient, LoggerFactory),
|
||||
clientOptions,
|
||||
(_, _) => new SseClientTransport(new(), DefaultServerConfig, httpClient, LoggerFactory),
|
||||
LoggerFactory,
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue