# Grace period for OAuth refresh token retries

You can now set a [refresh token grace period](https://clerk.com/docs/guides/configure/auth-strategies/oauth/how-clerk-implements-oauth.md#refresh-token-grace-period) of up to 60 seconds, so an OAuth or MCP client can recover from a dropped refresh response without the user authorizing it again.

Clerk replaces an OAuth refresh token every time a client uses it. If the response never reaches the client, for example because the network dropped, the client retries with the token it just used. Until now, Clerk treated that retry as token reuse and revoked the client's access, so the user had to authorize the client again. This is a common reason MCP clients ask users to reconnect.

Within the grace period after a refresh, Clerk accepts the previous refresh token once more and returns a new pair of tokens.

- The setting applies to every OAuth application on the instance, including clients registered through [Client ID Metadata Documents](https://clerk.com/docs/guides/configure/auth-strategies/oauth/client-id-metadata-documents.md) and dynamic client registration. Applications using Clerk's legacy OAuth implementation don't support it.
- Clerk accepts only the refresh token that the most recent refresh replaced, and only once. Older refresh tokens still count as reuse and revoke the client's access.
- New instances start with a grace period of 30 seconds. Existing instances are unchanged: each refresh token can be used only once until you turn the grace period on.

## Get started

1. In the Clerk Dashboard, navigate to the [**OAuth applications**](https://dashboard.clerk.com/~/oauth-applications) page and select the **Settings** tab.
2. Under **Refresh tokens**, turn on **Refresh token grace period** and set a number of seconds between 1 and 60. Clerk recommends 30.
3. Select **Save**.

You can also set it through the [Backend API](https://clerk.com/docs/reference/backend-api/tag/instance-settings/PATCH/instance/oauth_application_settings) with the Clerk CLI:

```sh
npx clerk@latest api instance/oauth_application_settings -X PATCH -d '{"refresh_token_rotation_grace_period":30}'
```

If you use [Clerk's MCP server](https://clerk.com/docs/guides/ai/mcp/clerk-mcp-server.md) to set up your own, `configure_mcp_server` sets a 30-second grace period when it registers the first MCP server on an instance that has none. If the instance still has none, `check_mcp_server` recommends one.
