mpu6050 not detected through i2c

According to the error message, this command is not understand by your software:

i2c.writeto(0x51, bytearray([107, 0]))

Check the documentation for proper construction.