Couple of ways of doing this, both need to know the size of the mesh.
So you need to first generate a bounding box or a bounding sphere. (there are lots of online resources to help you with this)
Then you can either ...
1) Move the camera forward until the mesh fills the screen.
To work out the distance to place the camera you calculate distance = bounding_sphere.radius / tan(field_of_view)
2) You change the field of view in your projection matrix
To work out the field of view required you calculate fov = atan(bounding_sphere.radius/camera_distance)
Both might need a little adjustment , but it's a good starting point.
Personally, I like changing the distance of the camera approach. Messing with the FOV too much also messes with perspective. And sometimes that's just plain funny looking.