MCP token expired
Error code
{
"code": "token_expired",
"message": "MCP Session Expired. Re-approve the connection in your AI client, or generate a new token in Developer Tools → MCP Tokens if you connected with a token. How to reconnect: https://doc.mor.payments.ai/connect",
"docUrl": "https://doc.mor.payments.ai/errors/token-expired"
}
HTTP status
401
Cause
The MCP credential passed its expiry. Either the pai_mcp_* token passed the end of the duration chosen when it was generated (at most 7 days), or the 90-day OAuth connection reached its expiry. An OAuth connection warns before this happens: inside its last 14 days, whoami returns a credentialExpiryWarning with the re-approve link, and every tool result carries the same warning under _meta["ai.payments/credentialExpiryWarning"] plus a closing text block. The link opens the connect page, at the top of the page.
How to fix
- Connected with OAuth: re-approve the connection in your AI client, then call
whoamito confirm. The connect page walks through it for each client. - Connected with the device grant (no terminal): the client never ran OAuth, so there is nothing to re-approve in it. Run the device grant again (Connect without a terminal) and replace the
Authorizationheader with the new token, then callwhoamito confirm. - Connected with a token: generate a new token in Developer Tools → MCP Tokens, on the same tab (Sandbox or Live) as the MCP URL your client uses, and replace the old one in your client config. See Manual: User MCP Key.