Grate the cucumber on the large holes of a box grater. Allow to drain in a layer of cheesecloth in a mesh strainer fitted over a bowl. Squeeze to remove excess liquid.
Meanwhile, combine the cream cheese and mayonnaise in a large bowl and mix with a rubber spatula until smooth. Add the cucumber and onion and mix until combined. Season with salt and pepper. Cover and refrigerate for 1 hour.