-
Notifications
You must be signed in to change notification settings - Fork 432
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
maui windows app create mcp client not work.
work error in code
await using var mcpClient = await McpClientFactory.CreateAsync(clientTransport, options);
full code
var clientTransport = new StdioClientTransport(new()
{
Name = "tavily-mcp",
Command = "npx",
Arguments = ["-y", "[email protected]"],
EnvironmentVariables = new Dictionary<string, string>{
{ "TAVILY_API_KEY", "tvly-XXXXXXX" }
}
});
var options = new McpClientOptions
{
ClientInfo = new() { Name = "tavily-client", Version = "1.0.0" }
};
// Create an MCPClient for the GitHub server
await using var mcpClient = await McpClientFactory.CreateAsync(clientTransport, options);
// Retrieve the list of tools available on the GitHub server
var tools = await mcpClient.ListToolsAsync().ConfigureAwait(false);
foreach (var tool in tools)
{
Console.WriteLine($"{tool.Name}: {tool.Description}");
}
trace
System.InvalidOperationException
HResult=0x80131509
Message=The server shut down unexpectedly.
Source=ModelContextProtocol
StackTrace:
在 ModelContextProtocol.Shared.McpSession.<SendRequestAsync>d__28.MoveNext()
在 ModelContextProtocol.McpEndpointExtensions.<SendRequestAsync>d__1`2.MoveNext()
在 ModelContextProtocol.Client.McpClient.<ConnectAsync>d__20.MoveNext()
在 ModelContextProtocol.Client.McpClient.<ConnectAsync>d__20.MoveNext()
在 ModelContextProtocol.Client.McpClientFactory.<CreateAsync>d__0.MoveNext()
在 ModelContextProtocol.Client.McpClientFactory.<CreateAsync>d__0.MoveNext()
在 MarketAssistant.Plugins.McpPlugin.<GetKernelFunctionsAsync>d__0.MoveNext() 在
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working