Skip to content

Commit 60f5631

Browse files
committed
React to snake_case default tool naming and simplify samples
1 parent 43eb8dc commit 60f5631

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

samples/ProtectedMCPClient/Program.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
Name = "Secure Weather Client",
3232
OAuth = new()
3333
{
34-
ClientId = "demo-client",
35-
ClientSecret = "demo-secret",
34+
ClientName = "ProtectedMcpClient",
3635
RedirectUri = new Uri("http://localhost:1179/callback"),
3736
AuthorizationRedirectDelegate = HandleAuthorizationUrlAsync,
3837
}
@@ -50,12 +49,12 @@
5049
Console.WriteLine($"Found {tools.Count} tools on the server.");
5150
Console.WriteLine();
5251

53-
if (tools.Any(t => t.Name == "GetAlerts"))
52+
if (tools.Any(t => t.Name == "get_alerts"))
5453
{
55-
Console.WriteLine("Calling GetAlerts tool...");
54+
Console.WriteLine("Calling get_alerts tool...");
5655

5756
var result = await client.CallToolAsync(
58-
"GetAlerts",
57+
"get_alerts",
5958
new Dictionary<string, object?> { { "state", "WA" } }
6059
);
6160

samples/ProtectedMCPServer/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Microsoft.AspNetCore.Authentication.JwtBearer;
22
using Microsoft.IdentityModel.Tokens;
33
using ModelContextProtocol.AspNetCore.Authentication;
4-
using ModelContextProtocol.Authentication;
54
using ProtectedMCPServer.Tools;
65
using System.Net.Http.Headers;
76
using System.Security.Claims;
@@ -10,7 +9,6 @@
109

1110
var serverUrl = "http://localhost:7071/";
1211
var inMemoryOAuthServerUrl = "https://localhost:7029";
13-
var demoClientId = "demo-client";
1412

1513
builder.Services.AddAuthentication(options =>
1614
{
@@ -90,7 +88,6 @@
9088
Console.WriteLine($"Starting MCP server with authorization at {serverUrl}");
9189
Console.WriteLine($"Using in-memory OAuth server at {inMemoryOAuthServerUrl}");
9290
Console.WriteLine($"Protected Resource Metadata URL: {serverUrl}.well-known/oauth-protected-resource");
93-
Console.WriteLine($"Demo Client ID: {demoClientId}");
9491
Console.WriteLine("Press Ctrl+C to stop the server");
9592

9693
app.Run(serverUrl);

0 commit comments

Comments
 (0)