Restructure IMcpEndpoint, IMcpClient, and IMcpServer (#723)
* Remove `McpEndpoint` & `IMcpClient` * Revise naming, add abstract classes * Fix missing renames * Move extension methods to instance methods * Add back old API, but obsoleted * Add back obsoleted factory classes * Move deprecation attributes * `SseClientTransport` -> `HttpClientTransport` * Update src/ModelContextProtocol.Core/Server/AugmentedServiceProvider.cs Co-authored-by: Stephen Halter <halter73@gmail.com> * PR feedback * PR feedback * Add back dispose lock * Fix docs projects * PR feedback * Undo `docs/*.md` changes --------- Co-authored-by: Stephen Halter <halter73@gmail.com>
This commit is contained in:
parent
fe2ce2bc60
commit
38b4a26998
1 changed files with 5169 additions and 3786 deletions
|
|
@ -36,15 +36,15 @@ public class DockerEverythingServerTests(ITestOutputHelper testOutputHelper) : L
|
|||
ClientInfo = new() { Name = "IntegrationTestClient", Version = "1.0.0" }
|
||||
};
|
||||
|
||||
var defaultConfig = new SseClientTransportOptions
|
||||
var defaultConfig = new HttpClientTransportOptions
|
||||
{
|
||||
Endpoint = new Uri($"http://localhost:{port}/sse"),
|
||||
Name = "Everything",
|
||||
};
|
||||
|
||||
// Create client and run tests
|
||||
await using var client = await McpClientFactory.CreateAsync(
|
||||
new SseClientTransport(defaultConfig),
|
||||
await using var client = await McpClient.CreateAsync(
|
||||
new HttpClientTransport(defaultConfig),
|
||||
defaultOptions,
|
||||
loggerFactory: LoggerFactory,
|
||||
cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
|
@ -63,7 +63,7 @@ public class DockerEverythingServerTests(ITestOutputHelper testOutputHelper) : L
|
|||
await using var fixture = new EverythingSseServerFixture(port);
|
||||
await fixture.StartAsync();
|
||||
|
||||
var defaultConfig = new SseClientTransportOptions
|
||||
var defaultConfig = new HttpClientTransportOptions
|
||||
{
|
||||
Endpoint = new Uri($"http://localhost:{port}/sse"),
|
||||
Name = "Everything",
|
||||
|
|
@ -90,8 +90,8 @@ public class DockerEverythingServerTests(ITestOutputHelper testOutputHelper) : L
|
|||
},
|
||||
};
|
||||
|
||||
await using var client = await McpClientFactory.CreateAsync(
|
||||
new SseClientTransport(defaultConfig),
|
||||
await using var client = await McpClient.CreateAsync(
|
||||
new HttpClientTransport(defaultConfig),
|
||||
defaultOptions,
|
||||
loggerFactory: LoggerFactory,
|
||||
cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
|
|
|||
Loading…
Reference in a new issue