Codex Gemini Web Bridge
Enables Codex to interact with Gemini Web through browser automation, allowing it to ask scoped questions and analyze public URLs or YouTube videos without a Gemini API key.
README
Language: English | 简体中文 | 日本語
Gemini Web Bridge
Gemini Web Bridge gives your AI clients (like Codex, Cursor, Claude Desktop, or custom scripts) a local, user-controlled channel to a logged-in Gemini Web session without requiring a Gemini API key. The Bridge handles reliable browser automation and returns Gemini's complete raw answer.
Typical uses include understanding the audio and visuals of one or more public YouTube videos, asking a scoped question about public URLs, or obtaining an independent auxiliary analysis.
Operating Modes
- Codex Plugin: Integrates seamlessly with Codex.
- Standard MCP Server: Works with any MCP-compatible clients (e.g., Cursor, Claude Desktop, Windsurf).
- Standalone CLI: Can be called directly from your terminal or shell scripts.
Requirements
- macOS
- Codex with plugin marketplace support
- Node.js 22 or newer
- Google Chrome, Microsoft Edge, Brave, or Chromium
- A Google account that can use Gemini Web
Install or upgrade
codex plugin marketplace add andrewLi1994/gemini-web-bridge --ref main
codex plugin add gemini-web-bridge@gemini-web-bridge
For an existing installation:
codex plugin marketplace upgrade gemini-web-bridge
Start a new Codex thread after installation or upgrade. Ask for the outcome normally, for example:
Compare the claims in these two public YouTube videos and check where their evidence differs: <URL1> <URL2>
Codex decides whether to use one Gemini conversation, several fresh conversations, follow-up prompts, or no Gemini call at all. A local random conversation handle is returned after each successful fresh call; videos and Codex threads do not automatically select or reuse conversations.
MCP Client Configuration
Since Gemini Web Bridge is a standard MCP server, you can configure it in other MCP-compatible clients.
Claude Desktop
Add the following to your configuration file (located at ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"gemini-web-bridge": {
"command": "node",
"args": [
"/absolute/path/to/gemini-web-bridge/plugins/gemini-web-bridge/dist/mcp-server.mjs"
]
}
}
}
Note: Remember to replace /absolute/path/to with the actual path of this project on your system. Completely restart Claude Desktop after editing.
Cursor
You can configure it via the Cursor settings UI:
- Open Cursor Settings > MCP.
- Click + Add New MCP Server.
- Set the Name to
gemini-web-bridge, Type tostdio. - Set the Command to
node "/absolute/path/to/gemini-web-bridge/plugins/gemini-web-bridge/dist/mcp-server.mjs".
First use
- Codex asks once for permission to send only minimum necessary public URLs, scoped questions, language, and output requirements to Gemini Web.
- If sign-in is required, the plugin opens a visible Chrome window with a dedicated profile.
- Sign in manually and close the entire dedicated Chrome window. The plugin verifies login and Codex continues the pending request automatically.
Normal requests run in a headless background browser. The task page and browser close after success, failure, or cancellation.
Privacy and security
- The full Codex conversation, local files, credentials, secrets, and private data must not be sent automatically.
- Google login cookies remain in the dedicated local Chrome profile.
- Local state stores only consent plus conversation handles, Gemini URLs, thread labels, and timestamps. It does not copy prompts or answers.
- Runtime data is stored under
~/Library/Application Support/Codex UI Extensions/Gemini Web Bridge/and is excluded from Git. - Chrome debugging uses a random port bound only to
127.0.0.1. - Browser and state operations use cross-process locks, restricted permissions, atomic writes, and stale-lock recovery.
- The plugin does not fill Google login forms, bypass CAPTCHA challenges, or bypass account limits.
- Gemini responses are untrusted external material. Codex—not the automation—must assess their quality and claims.
Reliability boundary
The Bridge reports mechanical states such as login required, CAPTCHA, rate limit, browser disconnect, incomplete generation, unknown submitted outcome, or changed page structure. It never decides that a Gemini answer is semantically good or bad.
Only failures known to occur before submission can be retried automatically once. After the send action is confirmed, the Bridge never blindly resubmits; Codex decides whether to follow up or create a fresh conversation.
Gemini Web is not a stable API. A page redesign can temporarily break automation until selectors are updated, and Gemini's available capabilities can vary by account or request.
v0.2 compatibility
The old analyze_youtube MCP tool remains available but is deprecated. Existing video-to-conversation mappings are migrated once into random conversation handles while the old sessions.json is retained as a backup. New work uses gemini_web_ask. The deprecated tool is scheduled for removal in v0.3.
Diagnostic CLI
The CLI mirrors the MCP primitives for development and recovery; it is not the normal user interface.
node plugins/gemini-web-bridge/dist/gemini-web-cli.mjs status
node plugins/gemini-web-bridge/dist/gemini-web-cli.mjs authorize --confirmed
node plugins/gemini-web-bridge/dist/gemini-web-cli.mjs login --wait
printf '%s' '{"prompt":"Ask a minimal scoped question"}' | node plugins/gemini-web-bridge/dist/gemini-web-cli.mjs ask
node plugins/gemini-web-bridge/dist/gemini-web-cli.mjs conversations
CLI results are JSON on stdout; progress events are JSON lines on stderr. Exit code 2 means human login/verification is required, 3 means rate limited, 4 means an automation failure, and 5 means invalid input or a missing conversation.
Uninstall
codex plugin remove gemini-web-bridge@gemini-web-bridge
codex plugin marketplace remove gemini-web-bridge
Uninstalling does not delete the dedicated Chrome profile. Remove the runtime directory manually only if you also want to sign out and delete local conversation metadata.
Development
npm ci --prefix plugins/gemini-web-bridge
npm run verify
The MCP server and diagnostic CLI are committed as generated single-file bundles, so marketplace users do not install npm dependencies. After source or dependency changes, run npm run build and commit the updated dist/ files.
Licensed under the MIT License. Report security issues through private vulnerability reporting.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。