1 package fr.tiogars.chat.domains.mcp.models;
2
3 import io.swagger.v3.oas.annotations.media.Schema;
4 import jakarta.validation.constraints.NotBlank;
5
6 import java.util.Map;
7
8
9
10
11 @Schema(description = "MCP service configuration")
12 public record McpServiceConfig(
13 @NotBlank
14 @Schema(description = "Unique identifier for the MCP service", example = "filesystem")
15 String id,
16
17 @NotBlank
18 @Schema(description = "Display name for the MCP service", example = "File System Access")
19 String name,
20
21 @Schema(description = "Description of what the service provides")
22 String description,
23
24 @Schema(description = "Command to start the MCP service", example = "npx @modelcontextprotocol/server-filesystem")
25 String command,
26
27 @Schema(description = "Environment variables for the service")
28 Map<String, String> env,
29
30 @Schema(description = "Whether the service is enabled", defaultValue = "true")
31 boolean enabled,
32
33 @Schema(description = "Timeout in seconds", defaultValue = "30")
34 int timeoutSeconds
35 ) {
36 public McpServiceConfig {
37 if (timeoutSeconds <= 0) {
38 timeoutSeconds = 30;
39 }
40 }
41 }