Use the beta density.

The answer is a discrete uniform distribution over the set 0,1,2..., n, which makes sense.

The joint distribution is

Next integrate out the y to get the marginal of X and use the fact that

since x and n are integers this reduces to 1/(n+1) which is correct on the set for x=0,1...,n.

Initially I tried the MGF where I conditioned on the Y, but the MGF of the uniform is worthless, so I went the direct route.