Skip to content

Commit d674787

Browse files
Bump Azure.Identity and ModelContextProtocol (#46514)
* Bump Azure.Identity and ModelContextProtocol Bumps Azure.Identity from 1.13.2 to 1.14.0 Bumps ModelContextProtocol from 0.1.0-preview.11 to 0.1.0-preview.14 --- updated-dependencies: - dependency-name: Azure.Identity dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: ModelContextProtocol dependency-version: 0.1.0-preview.14 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * remove using directive --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Genevieve Warren <[email protected]>
1 parent 129a5aa commit d674787

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -9,10 +9,10 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Azure.AI.OpenAI" Version="2.2.0-beta.4" />
12-
<PackageReference Include="Azure.Identity" Version="1.13.2" />
12+
<PackageReference Include="Azure.Identity" Version="1.14.0" />
1313
<PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
1414
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.4.3-preview.1.25230.7" />
15-
<PackageReference Include="ModelContextProtocol" Version="0.1.0-preview.11" />
15+
<PackageReference Include="ModelContextProtocol" Version="0.1.0-preview.14" />
1616
</ItemGroup>
1717

1818
</Project>

docs/ai/quickstarts/snippets/mcp-client/Program.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Azure.Identity;
33
using Microsoft.Extensions.AI;
44
using ModelContextProtocol.Client;
5-
using ModelContextProtocol.Protocol.Transport;
65

76
// Create an IChatClient using Azure OpenAI.
87
IChatClient client =
@@ -15,7 +14,7 @@
1514

1615
// Create the MCP client
1716
// Configure it to start and connect to your MCP server.
18-
var mcpClient = await McpClientFactory.CreateAsync(
17+
IMcpClient mcpClient = await McpClientFactory.CreateAsync(
1918
new StdioClientTransport(new()
2019
{
2120
Command = "dotnet run",
@@ -25,8 +24,8 @@
2524

2625
// List all available tools from the MCP server.
2726
Console.WriteLine("Available tools:");
28-
var tools = await mcpClient.ListToolsAsync();
29-
foreach (var tool in tools)
27+
IList<McpClientTool> tools = await mcpClient.ListToolsAsync();
28+
foreach (McpClientTool tool in tools)
3029
{
3130
Console.WriteLine($"{tool}");
3231
}
@@ -40,7 +39,7 @@
4039
messages.Add(new(ChatRole.User, Console.ReadLine()));
4140

4241
List<ChatResponseUpdate> updates = [];
43-
await foreach (var update in client
42+
await foreach (ChatResponseUpdate update in client
4443
.GetStreamingResponseAsync(messages, new() { Tools = [.. tools] }))
4544
{
4645
Console.Write(update);
@@ -49,4 +48,4 @@
4948
Console.WriteLine();
5049

5150
messages.AddMessages(updates);
52-
}
51+
}

0 commit comments

Comments
 (0)