A single incompressible, inviscid, irrotational fluid medium bounded by a free surface and varying bottom is considered. The Hamiltonian of the system is expressed in terms of the so-called Dirichlet-Neumann operators. The equations for the surface waves are presented in Hamiltonian form. Specific scaling of the variables is selected which leads to approximations of Boussinesq and KdV types taking into account the effect of the slowly varying bottom. The arising KdV equation with variable coefficients is studied numerically when the initial condition is in the form of the one soliton solution for the initial depth.