From 28f3c49ac6a821f217c8cf04a03f847f84502a6b Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Wed, 19 Nov 2025 13:16:45 -0800 Subject: [PATCH] Fix a couple issues in the client sample readme --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3099dfcd3..6a51e143c 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,9 @@ To get started writing a client, the `McpClient.CreateAsync` method is used to i to a server. Once you have an `McpClient`, you can interact with it, such as to enumerate all available tools and invoke tools. ```csharp +using ModelContextProtocol.Client; +using ModelContextProtocol.Protocol; + var clientTransport = new StdioClientTransport(new StdioClientTransportOptions { Name = "Everything", @@ -63,7 +66,7 @@ var result = await client.CallToolAsync( cancellationToken:CancellationToken.None); // echo always returns one and only one text content object -Console.WriteLine(result.Content.First(c => c.Type == "text").Text); +Console.WriteLine(result.Content.OfType().First().Text); ``` You can find samples demonstrating how to use ModelContextProtocol with an LLM SDK in the [samples](samples) directory, and also refer to the [tests](tests/ModelContextProtocol.Tests) project for more examples. Additional examples and documentation will be added as in the near future.