How you obtain a Nanotech Mainframe depends on your faction. If you're playing as the Empire of the Rising Sun, build a power plant first, then an ore refinery, and the Nanotech Mainframe will become available to construct.
If you're playing as any other faction, you can instead build an Engineer and use him to capture one from your opponent.
One thing to keep in mind: the Nanotech Mainframe consumes a large amount of power to maintain, so make sure your energy supply can handle it.