Why your Gmail MCP server asks you to sign in again every 7 days
If a self-hosted Gmail connector stops working after a week, your Google OAuth app is almost certainly still in Testing mode. Here's the fix, and what the "unverified app" warning means.
Updated 2026-10-21
You set up a Gmail MCP server, connected it to Claude, and everything worked. A week later, every request fails with an authentication error, or the server asks you to link your mailboxes again.
This almost always has the same cause, and the fix takes two minutes.
The cause: your OAuth app is in Testing mode
Every Google OAuth app has a publishing status: Testing or In production. New apps start in Testing. In Testing mode, Google issues refresh tokens that expire after 7 days. When the token expires, the server can no longer reach Gmail on your behalf, and you have to sign in again.
This catches nearly everyone who sets up a Gmail integration for themselves, because nothing in the setup flow warns you until the first week is up.
The fix: publish the app
- Open the Google Cloud console and select your project.
- Go to Google Auth Platform → Audience.
- Under Publishing status, click Publish app and confirm. The status changes to In production.
- Don’t click Prepare for verification or submit anything. You don’t need verification for your own use.
- Relink each mailbox once. Tokens issued while the app was in Testing still expire, so link
them again to get long-lived tokens. In Surfski, ask Claude to
relink_accounteach alias.
From then on, the refresh tokens don’t expire on a schedule. They stop working only if you revoke access, change your password in some cases, or leave a token unused for six months.
What about the “unverified app” warning?
Once the app is in production, signing in shows a screen saying Google hasn’t verified this app. That is expected:
- Gmail’s read scopes are restricted scopes. To offer an app with them to the public, Google requires app verification and a yearly third-party security assessment (CASA).
- For your own app, you can skip both. Click Advanced, then Go to your app (unsafe). The wording is alarming, but it means “not reviewed by Google”, not “known to be harmful”.
- An unverified app can be used by up to 100 users over its lifetime. That’s plenty for a person, a family or a small team.
If your mailboxes are in Google Workspace, the admin can mark your app as trusted, which can also stop Workspace policy from blocking the sign-in. See how to trust Surfski in the Google Workspace Admin console.
Checklist
- Publishing status is In production.
- You did not submit the app for verification.
- You relinked every mailbox after publishing.
- For Workspace mailboxes, the admin marked the app as trusted.
Surfski’s quickstart covers all of this as step 1, and the AI setup prompt checks it for you as you go.
Frequently asked questions
- Do I have to get my app verified by Google to stop the 7-day expiry?
- No. Publishing the app (moving it from Testing to In production) is enough to stop the 7-day expiry. Verification is a separate review that you only need to offer the app to the public.
- Is the "Google hasn't verified this app" warning dangerous?
- Not when it is your own app on your own server. It means Google hasn't reviewed the app. You can click Advanced, then continue. An unverified app can be used by up to 100 users over its lifetime.
- Will publishing the app make it public?
- No. Publishing only changes the token lifetime and who may sign in. Nobody can use your server unless their address is on your allowlist.