Skip to content

Commit e91409b

Browse files
jhrozekclaude
andauthored
Document automatic upstream token refresh behavior (#607)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 19296c7 commit e91409b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/toolhive/concepts/backend-auth.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,17 @@ This mechanism allows MCP servers to call external APIs with the user's actual
269269
credentials from the upstream provider, while the client only needs to manage a
270270
single ToolHive-issued JWT.
271271

272+
#### Automatic token refresh
273+
274+
Upstream access tokens have their own expiration, independent of the ToolHive
275+
JWT lifespan. When the stored upstream access token has expired, ToolHive
276+
automatically refreshes it using the stored refresh token before forwarding the
277+
request — your MCP session continues without re-authentication.
278+
279+
If the refresh token is also expired or has been revoked by the upstream
280+
provider, ToolHive returns a `401` response, prompting you to re-authenticate
281+
through the OAuth flow.
282+
272283
:::warning[Session storage limitations]
273284

274285
By default, session storage is in-memory only. Upstream tokens are lost when

0 commit comments

Comments
 (0)