In a method for producing of an endoscope, optical fibers are introduced into a lumen in the endoscope and heated, the lumen is narrowed, and the optical fibers are melted together. The narrowing of the lumen and the melting together of the optical fibers take place at least partially at the same time.