You gain a +3 bonus to attack and damage rolls made with this magic weapon.
The first time you attack with the sword on each of your turns, you can transfer some or all of the sword’s bonus to your Armor Class, instead of using the bonus on any attacks that turn. For example, you could reduce the bonus to your attack and damage rolls to +1 and gain a +2 bonus to AC. The adjusted bonuses remain in effect until the start of your next turn, although you must hold the sword to gain a bonus to AC from it.
Proficiency with a Rapier allows you to add your proficiency bonus to the attack roll for any attack you make with it.
This weapon has the following mastery property. To use this property, you must have a feature that lets you use it.
Vex. If you hit a creature with this weapon and deal damage to the creature, you have Advantage on your next attack roll against that creature before the end of your next turn.
Notes: Bonus: Magic, Damage, Combat, Warding, Finesse, Vex
Assuming i was proficient with the rapier, does that mean i could add 9 or even 12 more ac to my character?
No, it's just the +3 Bonus you have to work with. I'd home brew though that you can take the penalty after you attack, so it only nerfs your extra attacks and opportunity attacks.