Launch the server via mcp-remote to fix OAuth connection#2
Open
simoncoombes wants to merge 1 commit into
Open
Conversation
Gemini CLI's native remote-OAuth transport does not attach the token it acquires after sign-in for DCR / auto-discovered servers, so the connection never establishes (google-gemini/gemini-cli#27745). Route the server through npx mcp-remote, which completes the OAuth flow and caches the token. Verified end-to-end: install, one-time browser sign-in, and a document parse round-trip all succeed. Docs and validate.sh updated to match the new manifest shape.
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.
Why
Installing the extension and signing in currently leaves the server Disconnected. Gemini CLI reports
Successfully authenticatedthenFailed to refresh auth token, and/mcpshowstransform - Disconnected (OAuth not authenticated).Root cause is upstream: google-gemini/gemini-cli#27745. Gemini CLI's native remote-OAuth path does not attach the token it just acquired on the request following sign-in for servers that use Dynamic Client Registration / auto-discovered OAuth (which the Transform server does). The server completes the token exchange and returns valid tokens; the CLI drops them. It affects every DCR-based HTTP MCP server, not just this one, and is unfixed as of 0.50.
What
Launch the
transformserver throughnpx -y mcp-remote <url>instead of the nativehttpUrltransport.mcp-remoteperforms the OAuth flow correctly and caches the token, so sign-in is a one-time browser step. This is the same OAuth approach our Cline integration already uses. Cost is a Node.js 18+ /npxruntime requirement, now documented in the README.gemini-extension.json:httpUrl->command/args, version 0.1.0 -> 0.2.0README.md: install/auth steps updated (one-time browser sign-in on first use; Node/npx requirement)AGENTS.md: re-auth guidance made client-agnostic (was/mcp auth transform)CONTRIBUTING.md: new Transport section explaining the choice and how to revert to native once #27745 shipsscripts/validate.sh: reads the canonical URL fromargsnow; mutation-tested that the mismatch guards still fireVerification
Tested the whole chain on Gemini CLI 0.50.0:
gemini extensions installfrom the repo, one-time browser OAuth via mcp-remote (token cached under~/.mcp-auth),/mcpshowstransformConnected with 4 tools, and a real HTML file parsed to markdown end-to-end (headings + table preserved)../scripts/validate.shpasses.Summary by cubic
Fixes OAuth sign-in for the
transformMCP server by launching it viamcp-remoteinstead of the nativehttpUrltransport. Users now complete a one-time browser sign-in; the token is cached and the server connects reliably.Bug Fixes
npx -y mcp-remote https://mcp.transform.unstructured.ioingemini-extension.json(version bumped to 0.2.0) to work around the Gemini CLI remote‑OAuth bug.README.md,CONTRIBUTING.md), and client-agnostic re-auth guidance (AGENTS.md).scripts/validate.shto read the canonical URL fromargsand retain mismatch checks.Migration
npxon PATH.Written for commit f452f46. Summary will update on new commits.