You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
791 B
26 lines
791 B
package xyz.wbsite.mcp.server.config;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProvider;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.web.reactive.function.server.RouterFunction;
|
|
|
|
/**
|
|
* MCP服务配置
|
|
*
|
|
* @author wangbing
|
|
* @since 1.0
|
|
*/
|
|
@Configuration
|
|
class McpServerConfig {
|
|
@Bean
|
|
WebFluxSseServerTransportProvider webFluxSseServerTransportProvider() {
|
|
return new WebFluxSseServerTransportProvider(new ObjectMapper(), "/mcp/post");
|
|
}
|
|
|
|
@Bean
|
|
RouterFunction<?> mcpRouterFunction(WebFluxSseServerTransportProvider provider) {
|
|
return provider.getRouterFunction();
|
|
}
|
|
} |