can1357/oh-my-pi · error · Error
Smithery authorization failed.
Error message
Smithery authorization failed.
What it means
Thrown by #waitForSmitheryCliApiKey when the Smithery authorization poll returns status "error". If the poll response carries a message it is used as the error text; this literal string is the fallback when the server reports failure without a message. It means Smithery itself rejected or failed the CLI auth session.
Source
Thrown at packages/coding-agent/src/modes/controllers/mcp-command-controller.ts:2422
const startedAt = Date.now();
while (!signal.aborted) {
if (Date.now() - startedAt >= timeoutMs) {
throw new Error("Smithery authorization timed out after 5 minutes.");
}
let response: SmitheryCliPollResponse;
try {
response = await pollSmitheryCliAuthSession(sessionId, signal);
} catch (error) {
// A single hung/slow poll aborts with TimeoutError; retry until the deadline.
if (isTimeoutError(error)) continue;
throw error;
}
if (response.status === "success" && response.apiKey) {
return response.apiKey;
}
if (response.status === "error") {
throw new Error(response.message ?? "Smithery authorization failed.");
}
await Bun.sleep(pollIntervalMs);
}
throw new Error("Smithery authorization cancelled.");
}
async #handleSmitheryBrowserLogin(): Promise<boolean> {
const session = await createSmitheryCliAuthSession();
const fallbackLoginUrl = getSmitheryLoginUrl();
this.#showMessage(
[
"",
theme.bold("Smithery Login"),
theme.fg("muted", "Browser authorization started. Complete auth in your browser."),
theme.fg("dim", "Authorize URL:"),
theme.fg("accent", session.authUrl),
theme.fg("dim", `Fallback: ${fallbackLoginUrl}`),View on GitHub (pinned to 9690622007)
Solutions
- Re-run /mcp smithery-login to start a fresh authorization session and approve it in the browser.
- If browser auth keeps failing, use the API-key fallback: run /mcp smithery-login and paste your key from smithery.ai when prompted.
- Check your Smithery account state (suspended/billing) at smithery.ai — account problems can surface as auth errors.
- If Smithery's service is degraded, retry later.
Defensive patterns
Strategy: try-catch
Validate before calling
// Validate an existing key instead of entering the browser flow
await searchSmitheryRegistry("mcp", { limit: 1, apiKey: storedKey }); // throws on 401/403 → key invalid, re-login needed Type guard
function isSmitheryAuthError(err: unknown): err is Error {
return err instanceof Error && err.message === "Smithery authorization failed.";
} Try / catch
try {
await smitheryLogin();
} catch (err) {
if (isSmitheryAuthError(err)) {
showWarning("Smithery rejected the authorization; falling back to API key entry.");
return await promptForApiKey();
}
throw err;
} Prevention
- Approve (don't deny) the consent screen when the browser flow opens.
- Start a fresh session promptly — server-side sessions can expire while pending.
- Keep an API key from smithery.ai handy as the fallback path.
- Verify your Smithery account is in good standing (not suspended, billing current).
When it happens
Trigger: Polling a Smithery CLI auth session (created by /mcp smithery-login) whose server-side status became "error" with no accompanying message — e.g. the auth request was denied, the session expired server-side, or Smithery's auth service reported an internal failure.
Common situations: User clicked 'Deny' or abandoned the consent flow in a way Smithery marks as error; the session expired before approval; a Smithery-side outage marking sessions as failed.
Related errors
- ${context}: ${response.status} ${response.statusText}${suffi
- Smithery authorization cancelled.
- Smithery login cancelled. Run /mcp smithery-login, then retr
- An unknown error occurred
- assume-role
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/e0f0777167476649.
Report an issue: GitHub.