File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ using Microsoft.Extensions.Logging;
95
95
using ModelContextProtocol .Server ;
96
96
using System .ComponentModel ;
97
97
98
- var builder = Host .CreateEmptyApplicationBuilder ( settings : null );
98
+ var builder = Host .CreateApplicationBuilder ( args );
99
99
builder .Logging .AddConsole (consoleLogOptions =>
100
100
{
101
101
// Configure all logs to go to stderr
Original file line number Diff line number Diff line change 5
5
using ModelContextProtocol . Client ;
6
6
using ModelContextProtocol . Protocol . Transport ;
7
7
8
- var builder = Host . CreateEmptyApplicationBuilder ( settings : null ) ;
8
+ var builder = Host . CreateApplicationBuilder ( args ) ;
9
9
10
10
builder . Configuration
11
11
. AddEnvironmentVariables ( )
Original file line number Diff line number Diff line change 1
1
using Microsoft . Extensions . DependencyInjection ;
2
2
using Microsoft . Extensions . Hosting ;
3
+ using Microsoft . Extensions . Logging ;
3
4
using System . Net . Http . Headers ;
4
5
5
- var builder = Host . CreateEmptyApplicationBuilder ( settings : null ) ;
6
+ var builder = Host . CreateApplicationBuilder ( args ) ;
6
7
7
8
builder . Services . AddMcpServer ( )
8
9
. WithStdioServerTransport ( )
9
10
. WithToolsFromAssembly ( ) ;
10
11
12
+ builder . Logging . AddConsole ( options =>
13
+ {
14
+ options . LogToStandardErrorThreshold = LogLevel . Trace ;
15
+ } ) ;
16
+
11
17
builder . Services . AddSingleton ( _ =>
12
18
{
13
19
var client = new HttpClient ( ) { BaseAddress = new Uri ( "https://api.weather.gov" ) } ;
You can’t perform that action at this time.
0 commit comments