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
|
|
@ -19,7 +19,7 @@ var (command, arguments) = GetCommandAndArguments(args);
|
|||
if (command == "http")
|
||||
{
|
||||
// make sure AspNetCoreMcpServer is running
|
||||
clientTransport = new SseClientTransport(new()
|
||||
clientTransport = new HttpClientTransport(new()
|
||||
{
|
||||
Endpoint = new Uri("http://localhost:3001")
|
||||
});
|
||||
|
|
@ -33,7 +33,7 @@ else
|
|||
Arguments = arguments,
|
||||
});
|
||||
}
|
||||
await using var mcpClient = await McpClientFactory.CreateAsync(clientTransport!);
|
||||
await using var mcpClient = await McpClient.CreateAsync(clientTransport!);
|
||||
|
||||
var tools = await mcpClient.ListToolsAsync();
|
||||
foreach (var tool in tools)
|
||||
|
|
@ -62,7 +62,7 @@ var messages = new List<ChatMessage>();
|
|||
var sb = new StringBuilder();
|
||||
|
||||
PromptForInput();
|
||||
while(Console.ReadLine() is string query && !"exit".Equals(query, StringComparison.OrdinalIgnoreCase))
|
||||
while (Console.ReadLine() is string query && !"exit".Equals(query, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(query))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue