Looking for a book that was about a guy who gets abducted by an alien space ship and then told to protect Earth from another alien threat by an AI made up of nanobots. The ship won't let him out to fight the enemy until he got himself injected with some of the nanobots because
the Captain's survival is its top priority before fighting the enemy.
I think the main character named the enemy 'the Marcos' but don't quote me on it. Does anyone have an idea on what I'm talking about? I know that it is part of a saga but not much else.