gemini-bridge
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gemini-bridge
Windows 原生 MCP Streamable HTTP + OAuth 2.0 桥接网关:让云端 Gemini 网页端(gemini.google.com) 能够直接读写本机项目、运行校验命令,并指挥本机编码 Agent(如 Codex)干活与回收反馈。
无需把本地项目推上 GitHub;本地
codex exec直接读取~/.codex/config.toml(无缝复用cc-switch三方中转站配置)。
架构概览
Gemini Web App (gemini.google.com)
│ HTTPS Streamable HTTP (POST /mcp) + OAuth 2.0 / PKCE
▼
Cloudflare Tunnel (your-tunnel) -> https://gemini-bridge.your-domain.com
│ HTTP -> 127.0.0.1:8788 (仅监听本机回环)
▼
gemini-bridge (Node.js 零外部依赖)
├─ fs_* 工具 : 直接读写/搜索/编辑本机白名单工作区(带备份与回收站)
├─ git_* / shell_* : 查状态/Diff、跑测试与构建校验(短等 + 后台 job 轮询)
└─ agent_* 编排器 : 派活给本地 Agent(当前内置 codex,可扩展其他 Agent)Related MCP server: Gemini Space
全部 20 个 MCP 工具清单
1. 工作区与文件工具(10 个,供 Gemini 自己查代码、写文档与小改)
工具 | 作用 | 说明 |
| 列目录 | 支持 |
| 读文件 | 支持 |
| 查元信息 | 判断文件/目录是否存在、大小与修改时间 |
| 按文件名查找 | 支持 |
| 搜文件内容 | 支持字面量或正则( |
| 写/新建文件 | 覆盖前自动备份到 |
| 精确字符串替换 |
|
| 建目录 | 递归创建目录 |
| 移动/重命名 | 支持文件或目录,默认防覆盖( |
| 安全删除 | 软删除移入 |
2. Git 与终端校验工具(5 个,供 Gemini 查改幅与跑验证)
工具 | 作用 | 说明 |
| 查仓库状态 | 返回当前分支、改动/未跟踪文件列表及 |
| 查具体 Diff | 支持 |
| 执行命令 | 通过 PowerShell 运行命令;默认同步等 15 秒,超时自动转后台返回 |
| 查后台命令 | 按 |
| 终止命令 | Windows 下用 |
3. 多 Agent 编排工具(5 个,供 Gemini 指挥 Codex 等干重活并收反馈)
工具 | 作用 | 说明 |
| 查看可用 Agent | 列出已接入 Agent、可选模型目录( |
| 派发任务 | 调起本地 |
| 查看任务反馈 | 返回状态、所用模型/档位、 |
| 同上下文续跑 | 传 |
| 停止 Agent 任务 | 终止运行中的 Agent 子进程树 |
本机 config.json 的 agents.codex.defaultSandbox 设为 danger-full-access。生效模式按显式 sandbox、配置默认值、workspace-write 的顺序选择;agent_resume 未指定 sandbox 时,优先沿用同一 Agent、工作区和会话的最近任务模式,无任务记录时使用配置默认值。
生效模式为 danger-full-access 时,codex exec 和 codex exec resume 均传入 --dangerously-bypass-approvals-and-sandbox,跳过 Codex 的审批与沙盒限制。新任务的 read-only / workspace-write 仍使用 -s <mode>;普通模式续跑保留原有参数形式,不额外传入 -s。
安全设计
机制 | 说明 |
仅绑定本机 | 服务监听 |
OAuth 2.0 + PKCE | 授权页面需输入 |
目录白名单 |
|
敏感文件黑名单 | 自动拦截 |
网关自保护 | 拒绝通过 API 读取或修改 |
审计日志 | 每次读、写、命令执行、Agent 派发与 OAuth 行为均记录到 |
目录结构
gemini-bridge/
├─ server.mjs HTTP 服务入口(/health、OAuth 端点、/mcp)
├─ lib/
│ ├─ config.mjs 配置热加载、路径安全校验、备份与 diff 工具
│ ├─ oauth.mjs OAuth 2.0 / PKCE / RFC 9728 元数据与授权确认页
│ ├─ mcp.mjs MCP Streamable HTTP (JSON-RPC 2.0) 分发器
│ ├─ tools-fs.mjs fs_* 文件与工作区工具
│ ├─ tools-shell.mjs git_* 与 shell_* 工具
│ └─ agents.mjs 可扩展 Agent 适配器注册表(当前含 codex)
├─ test/
│ └─ bridge.test.mjs 单元测试(node:test)
├─ public/
│ └─ index.html 仅限本机访问的 Codex 实时监控前端(SSE + 浅/深色切换)
├─ chrome-extension/ Chrome Side Panel 扩展(可在 Gemini 右侧打开监控面板)
├─ config.example.json 配置模板(不含密钥)
├─ start-gemini-bridge.cmd 后台启动脚本
├─ stop-gemini-bridge.cmd 停止脚本
├─ show-credentials.cmd 查看本机 OAuth Client ID / Secret / Passcode
├─ CONNECTOR-BRIEF.md 推荐喂给 Gemini 的协同工作指引
└─ CHANGELOG.md 变更记录日常使用与管理
运行测试:
npm test启停与开机自启(Windows 计划任务):
已注册无窗口计划任务
gemini-bridge(登录自启,常驻内存约 50~60 MB)与gemini-bridge-watchdog(每 5 分钟检查一次/health,挂掉自动拉起,平时零内存常驻)。手动启动 / 清除暂停:
start-gemini-bridge.cmd手动停止并暂停保活:
stop-gemini-bridge.cmd(会写入.gemini-bridge/PAUSED)查看接入凭据:
show-credentials.cmd健康检查:
Invoke-RestMethod http://127.0.0.1:8788/health
Chrome 右侧边栏(与 Gemini 网页端同屏联动):
打开 Chrome 的
chrome://extensions/→ 开启右上角「开发者模式」→ 点击「加载已解压的扩展程序」→ 选择本项目目录下的chrome-extension文件夹。用普通 Chrome 标签页打开
https://gemini.google.com,点击右上角扩展图标(或按Alt+Shift+B)即可在右侧展开 Codex 实时执行面板(仅直连本机127.0.0.1:8788,不经过公网隧道)。
扩展其他 Agent:
在
lib/agents.mjs的ADAPTERS对象中新增适配器(实现inspect与buildCommand),即可通过同一套agent_*工具调度claude、opencode等其他本地 CLI Agent。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI agents to Filepad workspaces through OAuth MCP.
Drive Google Antigravity from the Gemini app: remote MCP with OAuth 2.1 + PKCE.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables Gemini Spark to securely read, edit, and search a selected local workspace, execute shell commands, and integrate development tools via MCP with user approval safeguards.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables Google Gemini Web and its parallel Task subagents to securely access a local machine through OAuth 2.1, exposing deterministic file, command, task-management, Code Mode, and Skills tools over MCP.5MIT
- AlicenseNot gradedqualityBmaintenanceTurns a local coding IDE into a remote MCP endpoint so users can send tasks, inspect files, and poll results from Gemini or other MCP clients via OAuth-secured Streamable HTTP.MIT
- AlicenseNot gradedqualityCmaintenanceEnables Gemini web and mobile apps to access explicitly authorized local directories through MCP for sandboxed file, Git, and terminal operations with OAuth protection.MIT