Add masterport to agent config