From f9f630829affc38f65db38a0382ac8555ee97ca6 Mon Sep 17 00:00:00 2001
From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Date: Wed, 18 Feb 2026 13:53:44 +0000
Subject: [PATCH] Fix MCP samples: update MCP SDK to 0.8.0-preview.1 and fix
README references (#3959)
- Update ModelContextProtocol NuGet package from 0.4.0-preview.3 to 0.8.0-preview.1
- Update System.Net.ServerSentEvents from 10.0.1 to 10.0.3
- Fix OAuth config to use DynamicClientRegistration in Agent_MCP_Server_Auth
- Fix incorrect sample name references in README files
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
dotnet/Directory.Packages.props | 4 ++--
.../ModelContextProtocol/Agent_MCP_Server/README.md | 2 +-
.../ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs | 5 ++++-
.../ModelContextProtocol/Agent_MCP_Server_Auth/README.md | 2 +-
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props
index 72a563068d..5c9f2e06d9 100644
--- a/dotnet/Directory.Packages.props
+++ b/dotnet/Directory.Packages.props
@@ -42,7 +42,7 @@
-
+
@@ -102,7 +102,7 @@
-
+
diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/README.md b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/README.md
index f0996dc1fd..426bb67a97 100644
--- a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/README.md
+++ b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/README.md
@@ -24,7 +24,7 @@ $env:AZURE_OPENAI_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-
## Setup and Running
-Run the ModelContextProtocolPluginAuth sample
+Run the Agent_MCP_Server sample
```bash
dotnet run
diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs
index 564ede4477..d741d60701 100644
--- a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs
+++ b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/Program.cs
@@ -34,7 +34,10 @@ var transport = new HttpClientTransport(new()
Name = "Secure Weather Client",
OAuth = new()
{
- ClientId = "ProtectedMcpClient",
+ DynamicClientRegistration = new()
+ {
+ ClientName = "ProtectedMcpClient",
+ },
RedirectUri = new Uri("http://localhost:1179/callback"),
AuthorizationRedirectDelegate = HandleAuthorizationUrlAsync,
}
diff --git a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/README.md b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/README.md
index a6505d6524..7c646ec915 100644
--- a/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/README.md
+++ b/dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/README.md
@@ -54,7 +54,7 @@ dotnet run
The protected server will start at `http://localhost:7071`
-### Step 3: Run the ModelContextProtocolPluginAuth sample
+### Step 3: Run the Agent_MCP_Server_Auth sample
Finally, run this client: