1 package fr.tiogars.chat.domains.mcp.repositories;
2
3 import java.util.List;
4 import java.util.Optional;
5 import java.util.UUID;
6
7 import org.springframework.data.jpa.repository.JpaRepository;
8
9 import fr.tiogars.chat.domains.mcp.entities.McpServiceEntity;
10
11 /**
12 * Repository for MCP service entities.
13 */
14 public interface McpServiceRepository extends JpaRepository<McpServiceEntity, UUID> {
15
16 /**
17 * Find an MCP service by its service ID.
18 *
19 * @param serviceId the service ID
20 * @return the service entity if found
21 */
22 Optional<McpServiceEntity> findByServiceId(String serviceId);
23
24 /**
25 * Find all enabled MCP services.
26 *
27 * @return list of enabled services
28 */
29 List<McpServiceEntity> findByEnabledTrue();
30
31 /**
32 * Find MCP services by name containing a keyword.
33 *
34 * @param name the name keyword
35 * @return list of matching services
36 */
37 List<McpServiceEntity> findByNameContainingIgnoreCase(String name);
38
39 /**
40 * Delete an MCP service by its service ID.
41 *
42 * @param serviceId the service ID
43 */
44 void deleteByServiceId(String serviceId);
45
46 /**
47 * Check if an MCP service with the given ID exists.
48 *
49 * @param serviceId the service ID
50 * @return true if the service exists
51 */
52 boolean existsByServiceId(String serviceId);
53 }