File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -269,6 +269,17 @@ This mechanism allows MCP servers to call external APIs with the user's actual
269269credentials from the upstream provider, while the client only needs to manage a
270270single 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
274285By default, session storage is in-memory only. Upstream tokens are lost when
You can’t perform that action at this time.
0 commit comments