Update MCP version to 0.5.1
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental</groupId>
|
||||
<artifactId>spring-ai-mcp</artifactId>
|
||||
<version>0.5.0</version>
|
||||
<version>0.5.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental</groupId>
|
||||
<artifactId>spring-ai-mcp</artifactId>
|
||||
<version>0.5.0</version>
|
||||
<version>0.5.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<description>Sample application demonstrating MCP Servlet server usage</description>
|
||||
|
||||
<properties>
|
||||
<spring-ai-mcp.version>0.5.0</spring-ai-mcp.version>
|
||||
<spring-ai-mcp.version>0.5.1</spring-ai-mcp.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -58,6 +58,9 @@ public class McpServerConfig implements WebMvcConfigurer {
|
||||
return new StdioServerTransport();
|
||||
}
|
||||
|
||||
public static record ToUpperCaseInput(String input) {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public McpAsyncServer mcpServer(ServerMcpTransport transport, OpenLibrary openLibrary) { // @formatter:off
|
||||
|
||||
@@ -84,14 +87,14 @@ public class McpServerConfig implements WebMvcConfigurer {
|
||||
.build()),
|
||||
ToolHelper.toToolRegistration(
|
||||
FunctionCallback.builder()
|
||||
.function("toUpperCase", new Function<String, String>() {
|
||||
.function("toUpperCase", new Function<ToUpperCaseInput, String>() {
|
||||
@Override
|
||||
public String apply(String s) {
|
||||
return s.toUpperCase();
|
||||
public String apply(ToUpperCaseInput s) {
|
||||
return s.input().toUpperCase();
|
||||
}
|
||||
})
|
||||
.description("To upper case")
|
||||
.inputType(String.class)
|
||||
.inputType(ToUpperCaseInput.class)
|
||||
.build()))
|
||||
.tools(openLibraryToolRegistrations(openLibrary))
|
||||
.async();
|
||||
@@ -203,10 +206,6 @@ public class McpServerConfig implements WebMvcConfigurer {
|
||||
return "The status for " + transactionId + ", by " + accountName + " is PENDING";
|
||||
}
|
||||
|
||||
public Function<String, String> toUpperCase() {
|
||||
return String::toUpperCase;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public OpenLibrary openLibrary() {
|
||||
return new OpenLibrary(RestClient.builder());
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<description>Sample Spring Boot application demonstrating MCP server usage</description>
|
||||
|
||||
<properties>
|
||||
<spring-ai-mcp.version>0.5.0</spring-ai-mcp.version>
|
||||
<spring-ai-mcp.version>0.5.1</spring-ai-mcp.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -58,6 +58,9 @@ public class McpServerConfig {
|
||||
return transport.getRouterFunction();
|
||||
}
|
||||
|
||||
public static record ToUpperCaseInput(String input) {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public McpAsyncServer mcpServer(ServerMcpTransport transport, OpenLibrary openLibrary) { // @formatter:off
|
||||
|
||||
@@ -84,15 +87,16 @@ public class McpServerConfig {
|
||||
.build()),
|
||||
ToolHelper.toToolRegistration(
|
||||
FunctionCallback.builder()
|
||||
.function("toUpperCase", new Function<String, String>() {
|
||||
@Override
|
||||
public String apply(String s) {
|
||||
return s.toUpperCase();
|
||||
}
|
||||
})
|
||||
.description("To upper case")
|
||||
.inputType(String.class)
|
||||
.build()))
|
||||
.function("toUpperCase", new Function<ToUpperCaseInput, String>() {
|
||||
@Override
|
||||
public String apply(ToUpperCaseInput s) {
|
||||
return s.input().toUpperCase();
|
||||
}
|
||||
})
|
||||
.description("To upper case")
|
||||
.inputType(ToUpperCaseInput.class)
|
||||
.build())
|
||||
)
|
||||
.tools(openLibraryToolRegistrations(openLibrary))
|
||||
.async();
|
||||
|
||||
@@ -223,8 +227,8 @@ public class McpServerConfig {
|
||||
}
|
||||
"""), arguments -> {
|
||||
String operation = (String) arguments.get("operation");
|
||||
double a = (Double) arguments.get("a");
|
||||
double b = (Double) arguments.get("b");
|
||||
double a = (Integer) arguments.get("a");
|
||||
double b = (Integer) arguments.get("b");
|
||||
|
||||
double result;
|
||||
switch (operation) {
|
||||
@@ -259,10 +263,6 @@ public class McpServerConfig {
|
||||
return "The status for " + transactionId + ", by " + accountName + " is PENDING";
|
||||
}
|
||||
|
||||
public Function<String, String> toUpperCase() {
|
||||
return String::toUpperCase;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public OpenLibrary openLibrary() {
|
||||
return new OpenLibrary(RestClient.builder());
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<description>Sample Spring Boot application demonstrating MCP WebMvc server usage</description>
|
||||
|
||||
<properties>
|
||||
<spring-ai-mcp.version>0.5.0</spring-ai-mcp.version>
|
||||
<spring-ai-mcp.version>0.5.1</spring-ai-mcp.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -59,6 +59,9 @@ public class McpServerConfig implements WebMvcConfigurer {
|
||||
return new StdioServerTransport();
|
||||
}
|
||||
|
||||
public static record ToUpperCaseInput(String input) {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public McpAsyncServer mcpServer(ServerMcpTransport transport, OpenLibrary openLibrary) { // @formatter:off
|
||||
|
||||
@@ -85,14 +88,14 @@ public class McpServerConfig implements WebMvcConfigurer {
|
||||
.build()),
|
||||
ToolHelper.toToolRegistration(
|
||||
FunctionCallback.builder()
|
||||
.function("toUpperCase", new Function<String, String>() {
|
||||
.function("toUpperCase", new Function<ToUpperCaseInput, String>() {
|
||||
@Override
|
||||
public String apply(String s) {
|
||||
return s.toUpperCase();
|
||||
public String apply(ToUpperCaseInput s) {
|
||||
return s.input().toUpperCase();
|
||||
}
|
||||
})
|
||||
.description("To upper case")
|
||||
.inputType(String.class)
|
||||
.inputType(ToUpperCaseInput.class)
|
||||
.build()))
|
||||
.tools(openLibraryToolRegistrations(openLibrary))
|
||||
.async();
|
||||
@@ -224,8 +227,8 @@ public class McpServerConfig implements WebMvcConfigurer {
|
||||
}
|
||||
"""), arguments -> {
|
||||
String operation = (String) arguments.get("operation");
|
||||
double a = (Double) arguments.get("a");
|
||||
double b = (Double) arguments.get("b");
|
||||
double a = (Integer) arguments.get("a");
|
||||
double b = (Integer) arguments.get("b");
|
||||
|
||||
double result;
|
||||
switch (operation) {
|
||||
@@ -260,10 +263,6 @@ public class McpServerConfig implements WebMvcConfigurer {
|
||||
return "The status for " + transactionId + ", by " + accountName + " is PENDING";
|
||||
}
|
||||
|
||||
public Function<String, String> toUpperCase() {
|
||||
return String::toUpperCase;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public OpenLibrary openLibrary() {
|
||||
return new OpenLibrary(RestClient.builder());
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental</groupId>
|
||||
<artifactId>spring-ai-mcp</artifactId>
|
||||
<version>0.5.0</version>
|
||||
<version>0.5.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental</groupId>
|
||||
<artifactId>spring-ai-mcp</artifactId>
|
||||
<version>0.5.0</version>
|
||||
<version>0.5.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
Reference in New Issue
Block a user