#5514·openwork

[Bug]: Google-backed custom MCP connections ask members to sign in again every hour because no refresh token is requested

Author: dominykasvlCreated Oct 1, 2026Updated Oct 1, 2026
Labelsbug

Summary

A per-member OAuth MCP connection to Google's BigQuery MCP (https://bigquery.googleapis.com/mcp) works after sign-in. About an hour later OpenWork asks the member to sign in again. Den never asks Google for offline access, so Google issues a one-hour access token without a refresh token. When that token expires, Den deletes the credential and marks the connection reconnect_required / credential_expired.

To Reproduce

  1. In OpenWork Cloud → Connectors → Add connector, add an MCP connection with URL https://bigquery.googleapis.com/mcp. Use OAuth with a pre-registered Google Web client, and have each member sign in.
  2. Sign in to it from the desktop app and use a BigQuery tool. This works.
  3. Wait about an hour and use it again. The app asks you to sign in again.

Expected behavior

After the first sign-in, Den refreshes the Google access token in the background, the same way the native Google Workspace provider does.

Actual behavior

About an hour after each sign-in, the connection becomes reconnect_required (credentialHealthReason: credential_expired) and the member has to sign in again.

Screenshots (optional)

No response

OW version & Desktop info (optional)

No response

Additional context (optional)

  • Google only issues a refresh token when the request has access_type=offline. The default is online (Google docs). User access tokens expire after one hour (Google docs). Google's authorization server metadata does not list offline_access.
  • External MCP OAuth adds offline_access only when the authorization server advertises it (docs/external-mcp-oauth.md#L63), and nothing else adds access_type. The redirect hook just stores the URL: oauth-provider.ts#L466-L468.
  • When the access token expires and there is no refresh token, the credential is deleted: oauth-provider.ts#L399-L405.
  • The native Google Workspace provider already sends access_type=offline and prompt=consent select_account: provider-registry.ts#L76.