|
15 | 15 | */ |
16 | 16 | package com.contrast.labs.ai.mcp.contrast; |
17 | 17 |
|
| 18 | +import static java.util.List.of; |
| 19 | + |
| 20 | +import java.util.List; |
18 | 21 | import org.slf4j.Logger; |
19 | 22 | import org.slf4j.LoggerFactory; |
20 | 23 | import org.springframework.ai.support.ToolCallbacks; |
21 | 24 | import org.springframework.ai.tool.ToolCallback; |
22 | | -import org.springframework.boot.ApplicationArguments; |
23 | 25 | import org.springframework.boot.ApplicationRunner; |
24 | 26 | import org.springframework.boot.SpringApplication; |
25 | 27 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
26 | 28 | import org.springframework.boot.info.BuildProperties; |
27 | 29 | import org.springframework.context.annotation.Bean; |
28 | 30 |
|
29 | | -import java.util.List; |
30 | | - |
31 | | -import static java.util.List.of; |
32 | | - |
33 | 31 | @SpringBootApplication |
34 | 32 | public class McpContrastApplication { |
35 | 33 |
|
36 | | - private static final Logger logger = LoggerFactory.getLogger(McpContrastApplication.class); |
37 | | - |
38 | | - public static void main(String[] args) { |
39 | | - SpringApplication.run(McpContrastApplication.class, args); |
40 | | - } |
| 34 | + private static final Logger logger = LoggerFactory.getLogger(McpContrastApplication.class); |
41 | 35 |
|
42 | | - @Bean |
43 | | - public ApplicationRunner logVersion(org.springframework.beans.factory.ObjectProvider<BuildProperties> buildPropertiesProvider) { |
44 | | - return args -> { |
45 | | - BuildProperties buildProperties = buildPropertiesProvider.getIfAvailable(); |
46 | | - logger.info("=".repeat(60)); |
47 | | - if (buildProperties != null) { |
48 | | - logger.info("Contrast MCP Server - Version {}", buildProperties.getVersion()); |
49 | | - } else { |
50 | | - logger.info("Contrast MCP Server - Version information not available"); |
51 | | - } |
52 | | - logger.info("=".repeat(60)); |
53 | | - }; |
54 | | - } |
| 36 | + public static void main(String[] args) { |
| 37 | + SpringApplication.run(McpContrastApplication.class, args); |
| 38 | + } |
55 | 39 |
|
56 | | - @Bean |
57 | | - public List<ToolCallback> tools(AssessService assessService, SastService sastService,SCAService scaService,ADRService adrService,RouteCoverageService routeCoverageService) { |
58 | | - return of(ToolCallbacks.from(assessService,sastService,scaService,adrService,routeCoverageService)); |
59 | | - } |
| 40 | + @Bean |
| 41 | + public ApplicationRunner logVersion( |
| 42 | + org.springframework.beans.factory.ObjectProvider<BuildProperties> buildPropertiesProvider) { |
| 43 | + return args -> { |
| 44 | + BuildProperties buildProperties = buildPropertiesProvider.getIfAvailable(); |
| 45 | + logger.info("=".repeat(60)); |
| 46 | + if (buildProperties != null) { |
| 47 | + logger.info("Contrast MCP Server - Version {}", buildProperties.getVersion()); |
| 48 | + } else { |
| 49 | + logger.info("Contrast MCP Server - Version information not available"); |
| 50 | + } |
| 51 | + logger.info("=".repeat(60)); |
| 52 | + }; |
| 53 | + } |
60 | 54 |
|
| 55 | + @Bean |
| 56 | + public List<ToolCallback> tools( |
| 57 | + AssessService assessService, |
| 58 | + SastService sastService, |
| 59 | + SCAService scaService, |
| 60 | + ADRService adrService, |
| 61 | + RouteCoverageService routeCoverageService) { |
| 62 | + return of( |
| 63 | + ToolCallbacks.from( |
| 64 | + assessService, sastService, scaService, adrService, routeCoverageService)); |
| 65 | + } |
61 | 66 | } |
0 commit comments