Google WebMCP
Use this skill to operate Google Search and Gemini through the built-in --site google bridge preset in @webmcp-bridge/local-mcp.
For generic bridge setup patterns or non-Google sites, switch to $webmcp-bridge.
Prerequisites
- -
uxc is installed and available in PATH. - INLINECODE5 is installed and available in
PATH. - Network access to
https://www.google.com and https://gemini.google.com. - On a fresh machine, or under an isolated
HOME, install Playwright browsers first with npx playwright install. - Gemini is auth-sensitive. Expect
bootstrap_then_attach behavior when the profile is not signed in yet.
Core Workflow
- 1. Ensure the fixed Google link exists:
-
command -v google-webmcp-cli
- if missing or pointed at the wrong profile, run
skills/google-webmcp/scripts/ensure-links.sh
- 2. Inspect the bridge and tool schema before calling tools:
-
google-webmcp-cli -h
-
google-webmcp-cli search.web -h
-
google-webmcp-cli gemini.chat -h
-
google-webmcp-cli gemini.image.download -h
- 3. Check authentication state first when Gemini may need sign-in:
-
google-webmcp-cli bridge.session.status
-
google-webmcp-cli auth.get
- if the session is not ready, start bootstrap or switch to headed:
-
google-webmcp-cli bridge.session.bootstrap
-
google-webmcp-cli bridge.session.mode.set '{"mode":"headed"}'
-
google-webmcp-cli bridge.open
- 4. Use search tools for public search results:
-
google-webmcp-cli search.web '{"query":"playwright browser automation","limit":10}'
-
google-webmcp-cli page.get
- 5. Use Gemini through the same authenticated browser profile:
- text:
google-webmcp-cli gemini.chat '{"prompt":"Summarize these results","mode":"text","timeoutMs":180000}'
- image:
google-webmcp-cli gemini.chat '{"prompt":"a watercolor fox reading documentation","mode":"image","timeoutMs":300000}'
- download current visible images:
google-webmcp-cli gemini.image.download '{"limit":4,"timeoutMs":120000}'
- 6. Use debug and navigation helpers only when necessary:
-
google-webmcp-cli page.navigate '{"url":"https://gemini.google.com/app"}'
-
google-webmcp-cli page.inspect '{"limit":20}'
- 7. Parse JSON output only:
- success path:
.ok == true, consume
.data
- failure path:
.ok == false, inspect
.error.code and INLINECODE34
Default Target
The built-in preset uses:
CODEBLOCK0
The default profile path is:
CODEBLOCK1
Refresh the link with:
CODEBLOCK2
Guardrails
- - Keep the Google profile isolated from other sites.
- Google uses
bootstrap_then_attach; do not expect Gemini tools to work until the managed profile is authenticated. - Prefer explicit
bridge.session.mode.set over relaunching the command to change runtime mode. - Long Gemini generations can legitimately take minutes. Increase
timeoutMs instead of spawning parallel retries. - INLINECODE38 works on visible generated images in the current or target conversation. Do not assume it can recover images that are no longer visible.
- INLINECODE39 must stay on Google-owned hosts only.
- If the user closes the visible Google window manually, the headed owner session ends. Run
google-webmcp-cli bridge.open again if you still need a visible session on the same profile.
References
- - Common command patterns:
-
references/usage-patterns.md
- INLINECODE42
Google WebMCP
使用此技能可通过 @webmcp-bridge/local-mcp 中内置的 --site google 桥接预设来操作 Google 搜索和 Gemini。
如需通用桥接设置模式或非 Google 站点,请切换到 $webmcp-bridge。
前提条件
- - uxc 已安装并可在 PATH 中使用。
- npx 已安装并可在 PATH 中使用。
- 可访问 https://www.google.com 和 https://gemini.google.com 的网络连接。
- 在新机器或隔离的 HOME 环境下,首先使用 npx playwright install 安装 Playwright 浏览器。
- Gemini 对认证敏感。当配置文件尚未登录时,预期会出现 bootstrapthenattach 行为。
核心工作流程
- 1. 确保固定 Google 链接存在:
- command -v google-webmcp-cli
- 如果缺失或指向错误的配置文件,运行 skills/google-webmcp/scripts/ensure-links.sh
- 2. 在调用工具前检查桥接和工具模式:
- google-webmcp-cli -h
- google-webmcp-cli search.web -h
- google-webmcp-cli gemini.chat -h
- google-webmcp-cli gemini.image.download -h
- 3. 当 Gemini 可能需要登录时,首先检查认证状态:
- google-webmcp-cli bridge.session.status
- google-webmcp-cli auth.get
- 如果会话未就绪,启动引导或切换到有头模式:
- google-webmcp-cli bridge.session.bootstrap
- google-webmcp-cli bridge.session.mode.set {mode:headed}
- google-webmcp-cli bridge.open
- 4. 使用搜索工具获取公开搜索结果:
- google-webmcp-cli search.web {query:playwright browser automation,limit:10}
- google-webmcp-cli page.get
- 5. 通过同一已认证的浏览器配置文件使用 Gemini:
- 文本:google-webmcp-cli gemini.chat {prompt:Summarize these results,mode:text,timeoutMs:180000}
- 图像:google-webmcp-cli gemini.chat {prompt:a watercolor fox reading documentation,mode:image,timeoutMs:300000}
- 下载当前可见图像:google-webmcp-cli gemini.image.download {limit:4,timeoutMs:120000}
- 6. 仅在必要时使用调试和导航辅助工具:
- google-webmcp-cli page.navigate {url:https://gemini.google.com/app}
- google-webmcp-cli page.inspect {limit:20}
- 7. 仅解析 JSON 输出:
- 成功路径:.ok == true,使用 .data
- 失败路径:.ok == false,检查 .error.code 和 .error.message
默认目标
内置预设使用:
bash
--site google
默认配置文件路径为:
bash
~/.uxc/webmcp-profile/google
使用以下命令刷新链接:
bash
skills/google-webmcp/scripts/ensure-links.sh
安全护栏
- - 保持 Google 配置文件与其他站点隔离。
- Google 使用 bootstrapthenattach;在托管配置文件完成认证之前,不要期望 Gemini 工具能正常工作。
- 优先使用显式的 bridge.session.mode.set,而非重新启动命令来更改运行时模式。
- 较长的 Gemini 生成任务可能需要数分钟。请增加 timeoutMs,而不是启动并行重试。
- gemini.image.download 仅适用于当前或目标对话中可见的已生成图像。不要假设它能恢复不再可见的图像。
- page.navigate 必须仅停留在 Google 拥有的主机上。
- 如果用户手动关闭可见的 Google 窗口,有头所有者会话将结束。如果仍需要在同一配置文件上使用可见会话,请重新运行 google-webmcp-cli bridge.open。
参考
- references/usage-patterns.md
- scripts/ensure-links.sh