Remove McpServerConfig and have McpClientFactory accept IClientTransport instances directly. (#230)
* Remove McpServerConfig and have McpClientFactory accept IClientTransport instances directly. * Address feedback and use lists when representing stdio arguments. * Use "Name" for transport descriptors and "EndpointName" for MCP clients and servers. * Update code samples. * Fix source file naming
This commit is contained in:
parent
8bd9ee81c0
commit
3e21f3594a
1 changed files with 315 additions and 527 deletions
|
|
@ -6,16 +6,12 @@ using OpenAI;
|
|||
// Connect to an MCP server
|
||||
Console.WriteLine("Connecting client to MCP 'everything' server");
|
||||
var mcpClient = await McpClientFactory.CreateAsync(
|
||||
new()
|
||||
new StdioClientTransport(new()
|
||||
{
|
||||
Id = "everything",
|
||||
Command = "npx",
|
||||
Arguments = ["-y", "--verbose", "@modelcontextprotocol/server-everything"],
|
||||
Name = "Everything",
|
||||
TransportType = TransportTypes.StdIo,
|
||||
TransportOptions = new()
|
||||
{
|
||||
["command"] = "npx", ["arguments"] = "-y @modelcontextprotocol/server-everything",
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
// Get all available tools
|
||||
Console.WriteLine("Tools available:");
|
||||
|
|
|
|||
Loading…
Reference in a new issue