MCP Integration in Claude Code
Last reviewed
Correct answer: B. The credential has to exist before the run starts, because a non-interactive session cannot sign in.
Explanation
The principle — Sign-in is an act by a person. Automation can use a credential that already exists; it cannot create one.
Why the key is correct — In non-interactive mode there is no MCP panel, so Claude Code cannot run the sign-in flow for you. The credential has to be established from an interactive session beforehand, and the scheduled run then reuses what is already stored. Planning that step is the difference between a job that works and one that silently loses a server.
Why the others are wrong — No browser is opened on your behalf in a scripted run, and a build machine often has none. No flag substitutes for a person authorising at the identity provider. And the run does not pause waiting for someone, because it has no way to ask.
Remember this — Authenticate the machine before you schedule the job, not during it.
Sources — Anthropic's Claude Code MCP reference.
Sources
“In non-interactive mode there's no /mcp panel, so Claude Code can't run the OAuth flow for you.”
Practise 10 questions on this topic
Take MCP Integration in Claude Code — Timed Test 1 (10 questions) — scored instantly, explanation for every question, no login.