Endoscopy has become an established procedure for the diagnosis and therapy of various gastrointestinal (GI) ailments, and has also emerged as a commonly-used technique for minimally-invasive surgery. Most existing endoscopes are monocular, with stereo-endoscopy facing practical difficulties, preventing the physicians/surgeons from having a desired, realistic 3D view. Traditional monocular 3D reconstruction approaches (e.g., structure from motion) face extraordinary challenges for this application due to issues including noisy data, lack of textures supporting robust feature matching, nonrigidity of the objects, and glare artifacts from the imaging process, etc. In this paper, we propose a method to automatically reconstruct 3D structure from a monocular endoscopic video. Our approach attempts to address the above challenges by incorporating a Circular Generalized Cylinder (CGC) model in 3D reconstruction. The CGC model is decomposed as a series of 3D circles. To reconstruct this model, we formulate the problem as one of Maximum a posteriori estimation within a Markov Random Field framework, so as to ensure the smoothness constraints of the CGC model and to support robust search for the optimal solution, which is achieved by a two-stage heuristic search scheme. Both simulated and real data experiments demonstrate the effectiveness of the proposed approach.