File tree Expand file tree Collapse file tree 2 files changed +1
-71
lines changed
samples/ProtectedMCPClient
src/ModelContextProtocol/Authentication Expand file tree Collapse file tree 2 files changed +1
-71
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ static async Task Main(string[] args)
2222
2323 var authHandler = new AuthorizationDelegatingHandler ( tokenProvider , "Bearer" )
2424 {
25- // 3. Set the inner handler (the handler that actually sends the request)
2625 InnerHandler = new HttpClientHandler ( )
2726 } ;
2827
@@ -39,7 +38,6 @@ static async Task Main(string[] args)
3938 Name = "Secure Weather Client"
4039 } ;
4140
42- // Use the single, pre-configured HttpClient
4341 var transport = new SseClientTransport ( transportOptions , httpClient ) ;
4442
4543 var client = await McpClientFactory . CreateAsync ( transport ) ;
@@ -57,13 +55,12 @@ static async Task Main(string[] args)
5755 if ( tools . Any ( t => t . Name == "GetAlerts" ) )
5856 {
5957 Console . WriteLine ( "Calling GetAlerts tool..." ) ;
60- // Update the dictionary to match the expected type IReadOnlyDictionary<string, object?>?
58+
6159 var result = await client . CallToolAsync (
6260 "GetAlerts" ,
6361 new Dictionary < string , object ? > { { "state" , "WA" } }
6462 ) ;
6563
66- //var result = await client.CallToolAsync("GetAuthorizationInfo");
6764 Console . WriteLine ( "Result: " + result . Content [ 0 ] . Text ) ;
6865 Console . WriteLine ( ) ;
6966 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments