Repository navigation
Gemini Notebook card, and Google sign-ins that keep their refresh token - #1
Merged
Merged
Conversation
Google issues a refresh token only when the authorization request asks for access_type=offline (and prompt=consent for an app approved before), so a sign-in at accounts.google.com now asks for both. Google's MCP servers no longer sign out when the one-hour token expires. Plugins gains a Gemini Notebook card for Google's official MCP endpoint, https://notebook.googleapis.com/mcp. Google offers no client registration, so the card takes the client ID and secret of a Desktop app OAuth client, saves them as the server's sign-in app with the notebook scope, and signs in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ard ignores Enter A client ID or secret typed alone no longer falls back to the saved app, the client fields follow the managed/policy lock the Connect button has, and Enter in the secret field connects only when Connect could. Tests cover the issuer's vendor parameters reaching the authorization link, and the card's Disconnect, switch-on after its tools load, and locks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fields Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
審查與 CI 紀錄
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Google 登入時多帶兩個參數,Google 才會發 refresh token:
Plugins 新增第三種卡片,用預先註冊的 App 登入(
client):實測
notebook.googleapis.com/mcp(2026-12-01):/.well-known/oauth-protected-resource/mcp指向accounts.google.comtools/list回 200,呼叫tools/call回 401 並帶resource_metadataEvidence
access_type,Google 只給 access token,一小時後 server 回到 Needs sign-in。Plugins 沒有 Gemini Notebook。server/mcp-oauth-vendor.test.ts:Google issuer(有沒有結尾/都算)會加上access_type=offline和prompt=consent;其他 issuer 和仿冒網域不加。server/mcp-oauth.test.ts:非 Google 的登入不帶access_type。src/lib/hosted-mcp-apps.test.ts:只有gemini-notebook用client,網址是 https,也有 scopes。McpServersPanel.embedded、PluginsPanel.navigation,213 項通過;tsc -b、tsc -p tsconfig.server.json、oxlint --deny-warnings、pnpm i18n:check都通過。src/components/McpServersPanel.hosted.test.ts(新增 5 項 client 卡片測試)。這個檔案在 Node 22 連上游main都載入失敗(Cannot bundle built-in module "node:sqlite"),專案要求 Node ≥ 24,需要在 Node 24 或 CI 上跑。McpOAuthManager加上自建的 Desktop OAuth client,連notebook.googleapis.com/mcp:resource參數。測試完已撤銷 refresh token。accounts.google.com偶爾會逾時。discovery 的 5 秒上限遇到這種情況,會回報「沒有提供 OAuth 登入」,按 Connect 重試就好。這是網路環境的問題,不在這次修改範圍內。Merge Danger
Door: two-way
只加參數、加一張卡片,沒有改資料格式,revert 就能還原。
Blast Radius: Google 登入
所有
accounts.google.com的 MCP 登入(包含 Gmail、Calendar)每次都會出現 Google 的同意畫面(prompt=consent)。resource參數已實測確認 Google 會接受。🤖 Generated with Claude Code