--- title: "whoami() fails or Maestro is not connected" description: "A bad key and a missing key produce the identical error. Answer that question first, because the obvious fix makes one of them permanent." canonical: "https://help.sitesmojo.com/kb/troubleshooting/whoami-fails/" --- ## Do not re-run `verify()` to fix this `verify()` **rotates** your API key. The old token stops working the instant the new one is issued — including the copy already sitting in your client config. So if your key was merely mistyped or stale, re-registering converts a five-second fix into a broken setup, and the error you get afterwards looks exactly the same. This is the single most common way a working install gets worse. ## Answer this first: which problem do you have? **A missing key and a rejected key report the identical error.** You cannot tell them apart from the message, so establish it directly: - Did you install a key at all — from the portal's Connect Claude dialog, an `Authorization` header, or `MAESTRO_API_KEY` in `.mcp.json`? - If yes, the key is present and being rejected. Do not rotate. Go to the portal's **Connect Claude** dialog and re-show it, or rotate it there deliberately and update your config in the same sitting. - If no, you have no key. Register and verify normally — nothing to invalidate. ## If a key is installed and still rejected Work down this list: 1. **Restart the client.** Claude Code reads MCP configuration only at session start, so a key added mid-session is not loaded. This is by far the most common cause. 2. **Check the header shape** for a hosted server. It is `Authorization: Bearer ` — the word `Bearer`, one space, then the token with no quotes and no trailing whitespace. 3. **Check for a second install.** A server registered twice, at different scopes or with different keys, resolves to whichever the client found first. 4. **Confirm the URL.** A hosted key authenticates against the hosted server. A key pasted into a local stdio config authenticates nothing if the URL is wrong. ## Where the key lives, per client | Client | Where | |---|---| | Claude Code, hosted | `Authorization: Bearer ` header on the connector | | Claude Desktop, claude.ai | in the connector URL — `…/mcp/k/` | | Local stdio server | `MAESTRO_API_KEY` in the `.mcp.json` env block | A key issued by `verify()` inside a running stdio session is active immediately, with no restart. ## It connects here but not in another folder That is a different problem with a different fix — see [Maestro vanished in another repository](../maestro-not-in-this-repo/).