I think you can forward declare BufBuilder, BSONObjBuilder, BSONArrayBuilder here, which should mean you don't need bsonobj.h

I don't see that message.h is needed at all, nor write_concern, nor namespace_string

Try to remove as many headers from here as you can by using forward decls.