You are not likely to find an off-the-shelf servo that you can connect a knex gear to directly.
What you will instead need to do is adapt a knex gear to the servo’s shaft, using one of the supplied “servo horns”.
These are plates or small “arms” with a hub that mates with the servo’s splined shaft, and are secured onto the shaft with a small screw. Virtually every new servo will come with a set of these horns. The horns have a variety of holes drilled into them, generally so you can attach pieces of stiff piano wire (bent with hooks on the ends) to transfer the motion. Alternatively, the holes can be attached to a part to move using more small screws. You can also use hot-glues, epoxies, or (in theory) “welding” the part to a compatible piece of plastic using heat.
For a knex gear, the best servo horn to use will be a circular one. You will likely have to modify the gear itself, to - so that there is a flat face to attach the horn to (plus drilling out the holes for the screws). Once you have the gear attached to the servo - then you need to figure out how to attach the servo to the rest of your construction so that the gear will properly engage with other gears…
Servos come in a variety of sizes - the most typical size being called “standard”; these are probably the smallest you’ll be able to use for a knex system. Smaller servos are typically called “mini” or “micro” or “9g” (9 gram); they are fairly small, and likely would be very difficult to adapt to knex usage, but you might find them useful for some lighter weight tasks. Larger servos are also available, but most hobbyists don’t use them (they are mainly for larger scale models, which aren’t as popular mainly due to cost).
Servos also come in a variety of configurations for their internals; cheap servos have plastic gears and plastic bearings (actually, plastic bushings) - while better servos will have metal gears and metal ball-bearings. Great servos have ball bearings on both ends of the output shaft (for better support and less wear under heavy loads). Expect to pay for it, though. However, for many applications these better servos are more than warranted, because by going cheap, you’ll just wear out your servos quickly, and ultimately end up paying the same amount or more in replacement costs as you would have if you had bought the more expensive servo (and generally, when the bearings in these go bad, you can replace them instead of buying a new servo!).
Servos generally only move at most about 270 degrees in rotation; so-called “360 servos” or “continuous-rotation servos”, while made from a servo, no longer have a “servoing” function - instead, they have been modified so that they will continue to run without any end-stops, based on the signal being sent to them. You can buy these pre-made, or you can make them yourself (plenty of info online about how to do this).
A handy reference on servos can be found here:
Lastly, be also aware of servo-signal controlled linear actuators (http://www.firgelli.com/) - while expensive, these can be used to move much larger loads (provided you only need limited linear or rotational motion).
A good all-around supplier for servos (and other robotics parts) - while not the cheapest, the quality is there: https://www.servocity.com/
Finally, for some tasks, look into using DC gear motors, instead of servos or steppers (for instance, driving the wheels of a robot). They tend to be cheaper, although they take a small bit more effort to hook up and control (and, if you need feedback - aka, like a servo - you’ll have some work to do, but once you understand how a servo works, it isn’t that great of an issue).
I hope this helps.