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
|
|
@ -18,7 +18,7 @@ public class SseServerIntegrationTestFixture : IAsyncDisposable
|
|||
// multiple tests, so this dispatches the output to the current test.
|
||||
private readonly DelegatingTestOutputHelper _delegatingTestOutputHelper = new();
|
||||
|
||||
private SseClientTransportOptions DefaultTransportOptions { get; set; } = new()
|
||||
private HttpClientTransportOptions DefaultTransportOptions { get; set; } = new()
|
||||
{
|
||||
Endpoint = new("http://localhost:5000/"),
|
||||
};
|
||||
|
|
@ -44,16 +44,16 @@ public class SseServerIntegrationTestFixture : IAsyncDisposable
|
|||
|
||||
public HttpClient HttpClient { get; }
|
||||
|
||||
public Task<IMcpClient> ConnectMcpClientAsync(McpClientOptions? options, ILoggerFactory loggerFactory)
|
||||
public Task<McpClient> ConnectMcpClientAsync(McpClientOptions? options, ILoggerFactory loggerFactory)
|
||||
{
|
||||
return McpClientFactory.CreateAsync(
|
||||
new SseClientTransport(DefaultTransportOptions, HttpClient, loggerFactory),
|
||||
return McpClient.CreateAsync(
|
||||
new HttpClientTransport(DefaultTransportOptions, HttpClient, loggerFactory),
|
||||
options,
|
||||
loggerFactory,
|
||||
TestContext.Current.CancellationToken);
|
||||
}
|
||||
|
||||
public void Initialize(ITestOutputHelper output, SseClientTransportOptions clientTransportOptions)
|
||||
public void Initialize(ITestOutputHelper output, HttpClientTransportOptions clientTransportOptions)
|
||||
{
|
||||
_delegatingTestOutputHelper.CurrentTestOutputHelper = output;
|
||||
DefaultTransportOptions = clientTransportOptions;
|
||||
|
|
|
|||
Loading…
Reference in a new issue