Can't access MCP server integrated with Vaadin project

  1. follow the steps in the post to create a Vaadin project integrating a MCP server.
  2. launch the project, it works well.
  3. run command npx @modelcontextprotocol/inspector as a MCP client,
  4. it reports the server cannot be connected.

Does anyone know the solution?

Hard to make a guess. Any error logs on the server or on the tool?

Perhaps you should allow also /mcp/message path in your security configuration-

Thank you Marco, you are right!

After add @bean as the document described, the integrated MCP server can be connected and accessed successfully:

@EnableWebSecurity
@Configuration
@Import({ VaadinAwareSecurityContextHolderStrategyConfiguration.class })
@ConditionalOnMissingBean(ControlCenterSecurityConfig.class)
class DevSecurityConfig {
...
    @Bean
    public WebSecurityCustomizer webSecurityCustomizer() {
        return (web) -> {
            web.ignoring().requestMatchers("/sse", "/mcp/**");
        };
    }
...
}