@@ -37,8 +37,8 @@ dotnet add package ModelContextProtocol --prerelease
3737
3838## Getting Started (Client)
3939
40- To get started writing a client, the ` McpClientFactory .CreateAsync` method is used to instantiate and connect an ` IMcpClient `
41- to a server. Once you have an ` IMcpClient ` , you can interact with it, such as to enumerate all available tools and invoke tools.
40+ To get started writing a client, the ` McpClient .CreateAsync` method is used to instantiate and connect an ` McpClient `
41+ to a server. Once you have an ` McpClient ` , you can interact with it, such as to enumerate all available tools and invoke tools.
4242
4343``` csharp
4444var clientTransport = new StdioClientTransport (new StdioClientTransportOptions
@@ -48,7 +48,7 @@ var clientTransport = new StdioClientTransport(new StdioClientTransportOptions
4848 Arguments = [" -y" , " @modelcontextprotocol/server-everything" ],
4949});
5050
51- var client = await McpClientFactory .CreateAsync (clientTransport );
51+ var client = await McpClient .CreateAsync (clientTransport );
5252
5353// Print the list of tools available from the server.
5454foreach (var tool in await client .ListToolsAsync ())
@@ -88,7 +88,7 @@ var response = await chatClient.GetResponseAsync(
8888Here is an example of how to create an MCP server and register all tools from the current application .
8989It includes a simple echo tool as an example (this is included in the same file here for easy of copy and paste , but it needn 't be in the same file ...
9090the employed overload of `WithTools ` examines the current assembly for classes with the `McpServerToolType ` attribute , and registers all methods with the
91- `McpTool ` attribute as tools .)
91+ `McpServerTool ` attribute as tools .)
9292
9393```
9494dotnet add package ModelContextProtocol --prerelease
@@ -122,14 +122,14 @@ public static class EchoTool
122122}
123123```
124124
125- Tools can have the `IMcpServer ` representing the server injected via a parameter to the method , and can use that for interaction with
125+ Tools can have the `McpServer ` representing the server injected via a parameter to the method , and can use that for interaction with
126126the connected client. Similarly, arguments may be injected via dependency injection. For example, this tool will use the supplied
127- `IMcpServer ` to make sampling requests back to the client in order to summarize content it downloads from the specified url via
127+ `McpServer ` to make sampling requests back to the client in order to summarize content it downloads from the specified url via
128128an `HttpClient` injected via dependency injection.
129129```csharp
130130[McpServerTool(Name = "SummarizeContentFromUrl"), Description("Summarizes content downloaded from a specific URI")]
131131public static async Task<string> SummarizeDownloadedContent(
132- IMcpServer thisServer,
132+ McpServer thisServer,
133133 HttpClient httpClient,
134134 [Description("The url from which to download the content to summarize")] string url,
135135 CancellationToken cancellationToken)
@@ -224,7 +224,7 @@ McpServerOptions options = new()
224224 },
225225};
226226
227- await using IMcpServer server = McpServerFactory .Create (new StdioServerTransport (" MyServer" ), options );
227+ await using McpServer server = McpServer .Create (new StdioServerTransport (" MyServer" ), options );
228228await server .RunAsync ();
229229```
230230
0 commit comments