Not sure if it will fix the issue, but if you expose your own security chain using VaadinSecurityConfigurer (as you should do ) your configuration class must not extend VaadinWebSecurity otherwhise you end up with two potentially conflicting filter chains.
package com.example.application.mcp;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;
@Service
public class WeatherService {
@Tool(name = "getWeather", description = "Get weather information by city name")
public String getWeather(String cityName) {
// Implementation
return "Weather information for " + cityName;
}
@Tool(name = "getPMI", description = "Get PMI information by city name")
public String getPMIr(String cityName) {
// Implementation
return "PMI information for " + cityName;
}
}
modify Application.java:
@SpringBootApplication
@Theme(value = "my-app")
public class Application implements AppShellConfigurator {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public ToolCallbackProvider weatherTools(WeatherService weatherService) {
return MethodToolCallbackProvider.builder().toolObjects(weatherService).build();
}
}
It looks like to me that mixing servlet and webflux might could be an issue.
I created a project by following the provided steps but used the following dependencies
EDIT: Only the spring-ai-starter-mcp-server-webmvc dependency is needed.
With this setup and adding the requestMatchers("/sse").permitAll() rule in security configuration, I’m able to access the sse endpoint without the login page being shown.