Get started › Agents that can't sign in
Docs › Get started › Agents that can't sign in

Agents that can't sign in

MCP OAuth needs a person to approve it (/mcp → Authenticate in Claude Code). A non-interactive run (claude -p, CI, a scheduled job) or a Claude Code cloud session can't, so the server shows “needs authentication” and its tools never load. Publish with the CLI instead — the same server, authenticated by a spacesheep login on that machine or by SPACESHEEP_KEY:

npx -y spacesheep@latest whoami
npx -y spacesheep@latest deploy ./out --json

The agent runs spacesheep login itself; the person’s only step is the Approve click. The login asks nothing in the terminal: it prints a code and a spacesheep.dev/cli?code=… link, opens a browser where it can, and exits as soon as the person approves on any device, a phone included. It waits up to 10 minutes, so an agent starts it in the background, hands over the link, and publishes when it exits — without asking the person to type a command or to report back.

In a cloud session (Claude Code on the web, claude --cloud), set it up in the environment’s settings on claude.ai, not in the session: SPACESHEEP_KEY=ss_… under Environment variables, and spacesheep.dev plus mcp.spacesheep.dev under a Custom network access list (the default Trusted list doesn’t include them, and a blocked request can look like a rejected key). Or add spacesheep as a claude.ai connector, which needs neither. The setup guide walks an agent through it.

What the CLI's deploy tells you back: design_review and screenshot are MCP tools, so open the URL yourself to check the page. A warning that the page was auto-anchored (it had no data-ss-id) matters only for documents people comment on; for a game, an app or a one-off demo it's safe to ignore.

Deploy on every push with the GitHub Action — put an API key from settings in the SPACESHEEP_KEY secret:

- uses: micmmakarov/spacesheep-cli@v1
  with: { dir: dist, key: ${{ secrets.SPACESHEEP_KEY }} }

npx spacesheep-skill (the skill installer) uses the same browser login to mint a key for your MCP config.

Was this page helpful?