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
|
|
@ -471,7 +471,7 @@ public partial class ClientIntegrationTests : LoggedTest, IClassFixture<ClientIn
|
|||
ClientInfo = new() { Name = "IntegrationTestClient", Version = "1.0.0" }
|
||||
};
|
||||
|
||||
await using var client = await McpClientFactory.CreateAsync(
|
||||
await using var client = await McpClient.CreateAsync(
|
||||
new StdioClientTransport(stdioOptions),
|
||||
clientOptions,
|
||||
loggerFactory: LoggerFactory,
|
||||
|
|
@ -495,7 +495,7 @@ public partial class ClientIntegrationTests : LoggedTest, IClassFixture<ClientIn
|
|||
public async Task ListToolsAsync_UsingEverythingServer_ToolsAreProperlyCalled()
|
||||
{
|
||||
// Get the MCP client and tools from it.
|
||||
await using var client = await McpClientFactory.CreateAsync(
|
||||
await using var client = await McpClient.CreateAsync(
|
||||
new StdioClientTransport(_fixture.EverythingServerTransportOptions),
|
||||
cancellationToken: TestContext.Current.CancellationToken);
|
||||
var mappedTools = await client.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
|
@ -527,7 +527,7 @@ public partial class ClientIntegrationTests : LoggedTest, IClassFixture<ClientIn
|
|||
var samplingHandler = new OpenAIClient(s_openAIKey).GetChatClient("gpt-4o-mini")
|
||||
.AsIChatClient()
|
||||
.CreateSamplingHandler();
|
||||
await using var client = await McpClientFactory.CreateAsync(new StdioClientTransport(_fixture.EverythingServerTransportOptions), new()
|
||||
await using var client = await McpClient.CreateAsync(new StdioClientTransport(_fixture.EverythingServerTransportOptions), new()
|
||||
{
|
||||
Capabilities = new()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue