Suz got me a wonderful Logitech webcam for Christmas. It plays nicely with Linux but it did not have adjustable focus and so was difficult to use in a benchtop setting. I attached the webcam to my swivel lamp so that it can be positioned anywhere on the bench and illuminated simultaneously if desired.
The focus was a problem for closeups, so I cut a pair of dollar-store +3 reading glasses in half and wrapped the earpiece around the back of the webcam. With a little encouragement it clips the lens over the flat part of the webcam's orb where the lens peeks out. Perfect.
As you can see from the photo, the focus fades out before my workshop does, but I can get in much closer to the masterpieces in progress on the bench.