401 Unauthorized
A 401 Unauthorized response means the request reached the server, but @mcp-tools/shared couldn’t resolve the bearer token to an org.
Common causes
1. Missing Authorization header
Every paid tool requires the header. The exceptions are get_api_key (boots a new account) and ping (no auth required).
2. Wrong header format
The format is Bearer <key>, with one space. Token <key> and bare <key> both fail.
3. Stale or revoked key
If you provisioned multiple keys, only the most recent verified one is guaranteed to work; older keys may have been revoked. Run get_token_balance with the key you’re using to confirm it resolves:
If that returns 401, provision a new key with get_api_key.
4. MCP client sent no headers
Some MCP clients drop custom headers when configured incorrectly. For Claude Desktop, the headers field must live inside the server entry:
A common mistake is putting headers at the top level — it’s silently ignored.
5. Hitting an env without the key
Self-hosted instances may have WORKOS_API_KEY unset (dev mode). In production, every request without a valid bearer token returns 401. Confirm you’re hitting the right URL.
Verifying it works
200 OK with a small JSON body confirms the auth chain. Anything else points to a different layer of the problem.
Still stuck
Open an issue on GitHub with the request URL, the -i output (redact your key), and the rough timestamp.