File tree Expand file tree Collapse file tree 7 files changed +7
-9
lines changed
agents/reflection/src/main/java/org/springframework/ai/openai/samples/helloworld
sampling/mcp-weather-webmvc-server
main/java/org/springframework/ai/mcp/sample/server
test/java/org/springframework/ai/mcp/sample/client
weather/starter-webmvc-server
src/test/java/org/springframework/ai/mcp/sample/client Expand file tree Collapse file tree 7 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 11package org .springframework .ai .openai .samples .helloworld ;
22
3- import org .springframework .ai .chat .client .ChatClient ;
3+ import java .util .Scanner ;
4+
45import org .springframework .boot .CommandLineRunner ;
56import org .springframework .boot .SpringApplication ;
67import org .springframework .boot .autoconfigure .SpringBootApplication ;
78import org .springframework .context .annotation .Bean ;
89
9- import java .util .Scanner ;
10-
1110@ SpringBootApplication
1211public class Application {
1312
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ You can connect to the weather server using either STDIO or SSE transport:
140140For servers using SSE transport:
141141
142142``` java
143- var transport = new HttpClientSseClientTransport (" http://localhost:8080" );
143+ var transport = HttpClientSseClientTransport . builder (" http://localhost:8080" ) . build( );
144144var client = McpClient . sync(transport). build();
145145```
146146
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ You can connect to the weather server using either STDIO or SSE transport:
166166For servers using SSE transport:
167167
168168``` java
169- var transport = new HttpClientSseClientTransport (" http://localhost:8080" );
169+ var transport = HttpClientSseClientTransport . builder (" http://localhost:8080" ) . build( );
170170var client = McpClient . sync(transport). build();
171171```
172172
Original file line number Diff line number Diff line change 1818import java .time .LocalDateTime ;
1919import java .util .List ;
2020
21- import io .modelcontextprotocol .server .McpSyncServerExchange ;
2221import io .modelcontextprotocol .spec .McpSchema ;
2322import io .modelcontextprotocol .spec .McpSchema .CreateMessageResult ;
2423import io .modelcontextprotocol .spec .McpSchema .LoggingLevel ;
Original file line number Diff line number Diff line change 2424public class ClientSse {
2525
2626 public static void main (String [] args ) {
27- var transport = new HttpClientSseClientTransport ("http://localhost:8080" );
27+ var transport = HttpClientSseClientTransport . builder ("http://localhost:8080" ). build ( );
2828 new SampleClient (transport ).run ();
2929 }
3030
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ You can connect to the weather server using either STDIO or SSE transport:
140140For servers using SSE transport:
141141
142142``` java
143- var transport = new HttpClientSseClientTransport (" http://localhost:8080" );
143+ var transport = HttpClientSseClientTransport . builder (" http://localhost:8080" ) . build( );
144144var client = McpClient . sync(transport). build();
145145```
146146
Original file line number Diff line number Diff line change 2424public class ClientSse {
2525
2626 public static void main (String [] args ) {
27- var transport = new HttpClientSseClientTransport ("http://localhost:8080" );
27+ var transport = HttpClientSseClientTransport . builder ("http://localhost:8080" ). build ( );
2828 new SampleClient (transport ).run ();
2929 }
3030
You can’t perform that action at this time.
0 commit comments