feat: add built-in MCP service support

This commit is contained in:
AndyYang
2026-03-05 20:31:29 +08:00
committed by lyingbug
parent ead6712955
commit 6dde1330c2
14 changed files with 257 additions and 9 deletions
+16 -2
View File
@@ -81,8 +81,12 @@ func (s *mcpServiceService) ListMCPServices(ctx context.Context, tenantID uint64
}
// Mask sensitive data for list view
for _, service := range services {
service.MaskSensitiveData()
for i, service := range services {
if service.IsBuiltin {
services[i] = service.HideSensitiveInfo()
} else {
service.MaskSensitiveData()
}
}
return services, nil
@@ -118,6 +122,11 @@ func (s *mcpServiceService) UpdateMCPService(ctx context.Context, service *types
return fmt.Errorf("MCP service not found")
}
// Builtin MCP services cannot be updated
if existing.IsBuiltin {
return fmt.Errorf("builtin MCP services cannot be updated")
}
// Determine the final transport type after merge
finalTransportType := existing.TransportType
if service.TransportType != "" {
@@ -232,6 +241,11 @@ func (s *mcpServiceService) DeleteMCPService(ctx context.Context, tenantID uint6
return fmt.Errorf("MCP service not found")
}
// Builtin MCP services cannot be deleted
if existing.IsBuiltin {
return fmt.Errorf("builtin MCP services cannot be deleted")
}
// Close client connection
s.mcpManager.CloseClient(id)