⏱️ 5 minutes · Output: credentials.json + token.json in ~/.config/mcp-credentials/
1Install uv
uv runs Python packages in throwaway environments, like npx for Python.
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.zshrc
uv --version
which uvx # note this path, usually ~/.local/bin/uvx
If uv: command not found:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
2Store credentials in ~/.config, not Desktop
⚠️ Do not keep credentials on ~/Desktop or ~/Documents. macOS privacy protection blocks SSH sessions from reading those folders. Everything works on the Mac, then fails from your iPhone with Connection closed. ~/.config is not protected.
mkdir -p ~/.config/mcp-credentials
mv ~/Downloads/client_secret_*.json ~/.config/mcp-credentials/credentials.json
chmod 700 ~/.config/mcp-credentials
chmod 600 ~/.config/mcp-credentials/credentials.json
ls -la ~/.config/mcp-credentials/
✅ You see credentials.json, owned by you, mode -rw-------.
3First OAuth login
Use Chrome or Firefox as your default browser for this step. Safari's HTTPS-Only mode blocks the http://localhost callback. (System Settings → Desktop & Dock → Default web browser.)
Run as one command:
CREDENTIALS_PATH=$HOME/.config/mcp-credentials/credentials.json \
TOKEN_PATH=$HOME/.config/mcp-credentials/token.json \
$HOME/.local/bin/uvx --with 'mcp<2' mcp-google-sheets
Why --with 'mcp<2'? mcp-google-sheets was written for the mcp 1.x library. The 2.x release renamed FastMCP, which crashes the server with ModuleNotFoundError. Pinning below 2 fixes it.
What happens:
- The browser opens. Sign in with the account from Guide 1.
- "Google hasn't verified this app" is expected: you are the developer. Click Advanced → Go to Sheets MCP (unsafe) → Allow.
- Browser: "The authentication flow has completed."
- Terminal:
Successfully authenticated using OAuth flow, then it waits. That's correct (it's waiting for an MCP client). - Press Ctrl+C.
Verify:
ls -la ~/.config/mcp-credentials/
chmod 600 ~/.config/mcp-credentials/token.json
✅ Both credentials.json and token.json exist.
Common mistakes in this step
| Mistake | Symptom | Fix |
|---|---|---|
Split env vars over separate lines without \ |
No such file or directory: 'credentials.json' |
Run as one command, or export the vars first |
| Safari as default browser | "Safari Can't Open the Page" at localhost:xxxxx |
Switch default to Chrome, rm token.json, rerun |
Missing --with 'mcp<2' |
No module named 'mcp.server.fastmcp' |
Add the pin |
| Stray character after the package name | Server exits instantly | Retype; check with cat -v (see Troubleshooting) |
➡️ Next: 3. Claude Code setup
Questions or corrections: [email protected]