watt-lee
(Watt Lee)
1
- follow the steps in the post to create a Vaadin project integrating a MCP server.
- launch the project, it works well.
- run command npx @modelcontextprotocol/inspector as a MCP client,
- it reports the server cannot be connected.
Does anyone know the solution?
marcoc_753
(Marco Collovati)
2
Hard to make a guess. Any error logs on the server or on the tool?
marcoc_753
(Marco Collovati)
3
Perhaps you should allow also /mcp/message
path in your security configuration-
watt-lee
(Watt Lee)
4
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/**");
};
}
...
}