Skip to content
Projects

441777523/gemini-local-master-hub

View on GitHub

About

Windows local MCP hub & Antigravity plugin for Gemini Web/Desktop (46 tools) — Gemini 本地 MCP 插件/中控: dual-stack browser (cua-driver + devtools), batch code tools, PowerShell, WinRT OCR, Vision & multi-agent dispatch.

AI & Machine Learning

How these counts are measured

Measured star growth

in 24h
Collecting history
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README_EN.md

Original

Gemini Local Master Hub

GitHub Stars GitHub Downloads Release

中文文档 | English | Changelog | llms.txt

Turn Gemini Web, Gemini Desktop, mobile browsers, and any stdio MCP client into a full local Windows master controller (47 tools) — featuring native shell-free run_script (Node.js/Python), dual-stack browser control with DevTools auto-attach & profile isolation, fair-quota batch tools, cua-driver GUI automation with full structuredContent passthrough, local WinRT OCR & Vision inspect, and multi-agent async orchestration (v1.5.0).

Out of the box, Gemini stays in the cloud — it cannot read your local codebase, run scripts or PowerShell commands, inspect live browser DevTools, control Windows desktop apps, or dispatch heavy tasks to local CLI agents.

Gemini Local Master Hub wraps your local Windows filesystem, native Node/Python script runner, UTF-8 PowerShell, dual-stack browser bridges (cua-driver 0.71.1+ + chrome-devtools-mcp), zero-dependency local vision (WinRT OCR + .NET C# template matching + Gemini Flash Vision), shared MEMORY.md, and local CLI agents (Antigravity / Gemini CLI) into a single Streamable HTTP & stdio MCP server exposed safely through a permanent Cloudflare Named Tunnel.


Supported Clients

  • Gemini Web (gemini.google.com): ✅ Fully supported
  • Gemini Desktop: ✅ Fully supported
  • Standard stdio MCP clients: ✅ npx -y gemini-local-master-hub --stdio
  • Mobile:
    • Continue existing sessions: Conversations started on Gemini Web/Desktop continue to work with MCP inside the Gemini mobile app ✅
    • Start a new MCP session on mobile: Open gemini.google.com in a mobile browser to initiate new MCP-enabled chats.

What's New in v1.5.0 (Full Notes: CHANGELOG.md)

  • Native Shell-Free run_script (Tool #47): Run Node.js (CJS/ESM) and Python scripts directly via temp script files — completely avoids Windows PowerShell 5.1 double-quote stripping.
  • DevTools & CUA Bridge Overhaul:
    • browser_devtools auto-probes 127.0.0.1:9222, supports custom browserUrl/wsEndpoint/autoConnect, launches Chrome with a dedicated profile (~/.cache/gemini-hub-chrome-profile), and auto-retries with --isolated if a profile lock occurs.
    • cua-bridge & devtools-bridge preserve structuredContent; desktop_clipboard now returns real clipboard text (include_text: true by default) and supports writing text, image_path, or file_path.
  • Fair Quotas & Multi-Task Orchestration:
    • Water-filling fair quotas for batch_read, batch_outline, and batch_search; wait_task supports waiting on taskIds[] (any / all); list_tasks sorts newest-first with status/prefix filters.
    • dispatch_antigravity prevents model-suffix --effort conflicts, auto-falls back from --mode auto to accept-edits on Windows builds < 26100, and injects local proxy env vars; dispatch_gemini_cli supports isolated API keys & timeout circuit-breakers.
    • cocos_build adds per-project mutex locking, clean env, hung-process tree reaping, pre/post output false-success guards, and strictly serial postbuild execution.
  • Security & Reliability Hardening:
    • resolvePathSafe symlink/junction escape guard via fs.realpathSync; vision_inspect hides API keys via temporary curl -K config files; atomic Windows case-normalized batch_edit with rollback; crash-safe fs_manage overwrite-move; GIT_TERMINAL_PROMPT=0 + allowlisted git_action; streaming read_file (>10 MB) & tail-window transcript reading; 6h periodic storage pruning.

Why Gemini Local Master Hub?

  • Triple-Mode Deployment: Ready-to-install Antigravity Plugin (skills/setup-gemini-hub/SKILL.md), standalone Cloudflare Tunnel HTTP MCP server, or instant npx --stdio server.
  • Zero Heavy Dependencies: Pure Node.js + built-in Windows capabilities — no Python, no OpenCV, no ripgrep required (optional Python runtime supported automatically by run_script).
  • Context & Quota Friendly:
    • code_outline & batch_outline extract structure with line numbers (saves 80–90% context);
    • Water-filling batch_read / batch_outline / batch_search prevent large early items from starving later ones;
    • Zero-API-cost local log compaction in get_task_status (preserves head, error lines, tail, and git status);
    • dispatch_antigravity never hardcodes models — choose any model per task or configure agyStandardModel / agyHeavyModel in hub/config.json.
  • Resilient & Safe: Auto-reconnecting Cloudflare Tunnel daemon (run-all.mjs, 5s → 60s backoff + full process tree cleanup), zero OAuth scraping, zero reverse-proxying, symlink-safe allowedRoots, timing-safe high-entropy secretPath with spoof-resistant per-IP 403 rate limiting, and minimal public /health.

Toolset Overview (46 General Tools + 1 Optional Engine Tool = 47 Tools)

Category Tools Highlights
Code, Batch & Filesystem (16) project_bootstrap, list_dir, code_outline, batch_outline, read_file, batch_read, write_file, edit_file, batch_edit, find_files, grep_search, batch_search, fs_manage, git_inspect, git_action, project_diagnostics Pure Node.js, water-filling fair quotas, streaming >10 MB reads, Windows case-normalized atomic multi-file edits with rollback & post-edit verify, trash-backed delete, non-interactive whitelisted Git ops
Scripts, System, Memory & Agents (14) run_script, run_shell, run_checks, manage_process, local_memory, dispatch_antigravity, dispatch_gemini_cli, wait_task, get_task_status, list_tasks, cancel_task, list_antigravity_conversations, read_conversation_transcript, cocos_build (optional) Shell-free Node/Python run_script, UTF-16LE -EncodedCommand PowerShell, parallel checks with tree-kill timeouts, WMI detached services, shared MEMORY.md, multi-task wait_task(any/all), newest-first list_tasks, managed cocos_build
Dual-Stack Browser (2) browser_cua, browser_devtools Human-like browser automation via cua-driver 0.71.1+ + Chrome DevTools (chrome-devtools-mcp) with auto-attach (9222), dedicated profile & --isolated retry
Desktop GUI Control (12) desktop_list_windows, desktop_get_window_state, desktop_get_desktop_state, desktop_bring_to_front, desktop_click, desktop_drag, desktop_type_text, desktop_hotkey, desktop_scroll, desktop_clipboard, desktop_run_steps, desktop_window_control Persistent cua-driver 0.71.1+ bridge on WinSta0\Default with structuredContent passthrough, full clipboard text/image/file support, window frame/menu/value control & recording
Local Vision (3) desktop_ocr_find, desktop_find_image, vision_inspect Offline Windows WinRT OCR, zero-Python .NET C# NCC template matching, local Gemini Flash vision-to-pixel coordinates with regional crop & curl -K header-only API key protection

Quick Start (Windows 10/11)

Option A — Instant stdio MCP

npx -y gemini-local-master-hub --stdio

Option B — Full HTTP MCP + Cloudflare Tunnel (Gemini Web / Desktop / Mobile)

  1. Prerequisites:
    • Node.js 20+
    • Standalone cua-driver 0.71.1+ (%LOCALAPPDATA%\Programs\Cua\cua-driver\bin\cua-driver.exe)
    • cloudflared.exe placed in hub/bin/cloudflared.exe (or on PATH)
    • (Optional) GEMINI_API_KEY (or separate visionGeminiApiKey / geminiCliApiKey in hub/config.json)
  2. Clone & Initialize:
    git clone https://github.com/441777523/gemini-local-master-hub.git
    cd gemini-local-master-hub
    powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\setup.ps1 -AllowedRoots @("D:\projects") -RegisterTask
    

    setup.ps1 generates a BOM-free hub/config.json with a random secretPath. You can optionally configure agyStandardModel / agyHeavyModel (run agy models to list IDs) and change them anytime.

  3. Verify End-to-End:
    node .\scripts\verify.mjs
    
  4. Connect to Gemini & Enable "Always Allow":
    • Open Gemini Web (gemini.google.com) or Gemini Desktop → Settings → Connected Apps (Custom apps) → Add Custom App and paste the URL from hub/current-public-url.txt.
    • Click into Gemini Local Master Hub under Connected Apps and set tool permissions to Always allow to avoid repeated confirmation prompts (re-enable once whenever tools are updated).

Compliance & License

Strictly adheres to official Google / Antigravity Terms of Service: zero OAuth token extraction, zero client modification, zero raw model proxying — built exclusively on official MCP Custom Apps and unmodified official CLIs for personal single-machine use.

Licensed under GNU AGPL-3.0. Free for personal and open-source use; any modified distribution or network/commercial service built on this software must disclose its source code under AGPL-3.0. For closed-source commercial licensing, please contact the author.

Explore related projects

Loading…