mcp

MCP refresh token expired: why tools vanish and how reconnect works

When remote MCP tools work on day one and disappear on day two, the access token has usually expired and the client couldn't refresh it. Either no refresh token was issued, the refresh token itself expired or was revoked, or rotation sent the client a new refresh token it didn't store. The client then asks you to authenticate again. The fix is mostly on the authorization server (AS): issue refresh tokens to MCP clients, set lifetimes that fit how often people actually use the tool, and handle rotation cleanly.

Symptom card

  • Tools were listed yesterday. Today they're missing, or the server shows as needing auth.
  • Server logs show 401s on expired tokens with no successful refresh before them.
  • Reconnecting fixes it until the next expiry.

Token lifetime basics

  • Access tokens are short-lived on purpose. Their expiry isn't a bug.
  • Refresh tokens let the client get a new access token without another browser login. Whether one gets issued depends on your AS config, and some servers need a scope such as `offline_access` before they'll issue one.
  • Refresh token lifetime caps how long the session can go without a fresh login. Absolute and idle limits both count.

Rotation and revocation pitfalls

  • With rotation, every refresh returns a new refresh token and invalidates the old one. If two client processes refresh at the same time, one can end up holding a dead token.
  • Reuse detection on some servers revokes the whole token family after one stale reuse.
  • Password changes or admin revocation end every session. That's expected, but it looks the same as this bug.

Check your AS docs for the exact behavior instead of assuming it.

Reconnecting in the client

Cursor and Claude each have their own way to re-authenticate an MCP server. Follow the current Cursor docs and Claude's help pages instead of the UI steps in an old post. After you reconnect, confirm `tools/list` returns again, then watch the next expiry window in your server logs.

Debugging refresh failures

Log every token-endpoint response on the AS side, with secrets redacted. A failed `grant_type=refresh_token` call names the cause (`invalid_grant`, an expired token, or a revoked one). MCP Inspector is useful for re-running the initial flow, and the failure card covers the challenge-side breakages.

Where the kit fits

The MCP Starter Kit ($27) is built for remote MCP sessions that have to survive more than one day of use in Cursor and Claude Connect. Soft path: start at /free; Cheat Sheet for the skim checklist mindset; kit when you want the auth-ready layout.

Soft next step

Confirm your AS issues refresh tokens to the MCP client, then log one full expiry-and-refresh cycle. Soft ladder: /free, then the MCP Starter Kit ($27). Related: OAuth pillar.

FAQ

Why did my MCP tools disappear after a day?+

Usually the access token expired and the refresh failed or wasn't possible, so the client lost authorization. Connect worked; the session didn't survive.

Does remote MCP use refresh tokens?+

It can. Whether a client gets one depends on your authorization server's settings and the scopes requested. Some servers only issue refresh tokens for specific offline-access scopes.

How do I force Cursor to re-authenticate an MCP server?+

Use the reconnect or re-auth control Cursor documents for MCP servers. Check Cursor's current docs for the exact UI rather than relying on a remembered path.

What token lifetimes should my AS issue?+

Short-lived access tokens plus a refresh token is the usual pattern. Choose lifetimes to fit your security needs; there's no single correct number.

Does refresh token rotation break MCP clients?+

It can if the client reuses an old refresh token after rotation, or if two requests race. Confirm rotation and reuse rules on your AS before you blame the client.

How do I debug refresh failures?+

Check your AS logs for the refresh request and the error it returned, such as an invalid or expired grant. Then reproduce the refresh in Inspector before you change client config.

Get the free starter

Value first, then a kit when you are ready. No fake urgency. Start with Harness Desk Starter at /free.