U.S. presidential candidates John McCain and Barack Obama have responded cautiously to North Korea 's declaration of its nuclear activities .