Skip to main content
Glama
Gemini Windows MCP Server

Gemini Windows MCP Server

by xc-guang

Gemini Windows MCP Server

通过 MCP (Model Context Protocol) + 标准 OAuth 2.0 + Tailscale Funnel,让网页端和手机端 Gemini App 安全远程控制你的 Windows 电脑。无需购买域名,无需公网 IP,开机静默后台运行。

核心特性

  • 原生兼容 Gemini App:完整实现标准 OAuth 2.0(含动态客户端注册与 PKCE)和 Streamable HTTP 协议。

  • 零成本永久域名:基于 Tailscale Funnel 免费获取永久固定 HTTPS 域名。

  • 双重安全防护:

    • 目录沙盒:严格限制只能访问指定的 work_dir,拦截越权路径。

    • 命令白名单:仅允许执行白名单内的开发命令(默认 git / python / pip / node / npm / pytest / uv),禁止 Shell 注入字符,单次执行超时 30 秒。

  • 开箱即用工具:list_files、read_file、write_file、read_image、run_command。

  • 静默后台运行:自动配置 Windows 任务计划程序,使用 pythonw.exe 无黑框自启。

Related MCP server: OneCode Core

快速开始(3 分钟)

前置条件

  1. Windows 10 / 11,已安装 Python 3.10+(安装时勾选 Add to PATH)。

  2. 注册免费 Tailscale 账号,登录客户端后在后台 DNS 页面开启 MagicDNS 与 HTTPS Certificates。

第一步:克隆并一键部署

以管理员身份打开 PowerShell,执行:

git clone https://github.com/xc-guang/gemini-windows-mcp.git
cd gemini-windows-mcp
powershell -ExecutionPolicy Bypass -File .\install.ps1

若终端提示开启 Funnel 权限,点击终端给出的链接在网页确认即可。

脚本完成后会输出你的 MCP Server URL 和 授权密码。

第二步:在 Gemini 中绑定

  1. 打开 gemini.google.com → 左下角 Settings → Connected Apps → Custom apps → Add a custom app。

  2. 填入脚本输出的 MCP Server URL(格式:https://xxx.tailxxxx.ts.net/mcp),点击 Next。

  3. 在弹出的授权网页中输入 授权密码 并确认。

  4. 点击 Connect 完成保存。

第三步:开始使用

在任意 Gemini 对话框(网页端或手机 App)中直接 @Windows PC Control:

  • @Windows PC Control 列出工作目录的文件

  • @Windows PC Control 帮我写一个 python 脚本并运行

  • @Windows PC Control 读取 demo.png,告诉我图里是什么

常用维护命令

修改配置后重启服务(编辑 config.json 后生效):

taskkill /f /im pythonw.exe
Start-ScheduledTask -TaskName "Gemini-MCP-Server"

关闭公网穿透:

tailscale funnel --https=443 off

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to securely inspect and control registered Windows PCs over a private Tailscale network, with risk-based approvals for actions such as launching apps, capturing screens, managing files, and simulating input.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Connects Gemini on the web to a user's own Windows PC, letting it read files, run commands, write to disk, and invoke local skills and other MCP plugins. It reaches the machine through a stable self-hosted Tailscale Funnel URL, with tools enabled and approved by the user.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables remote control of a Windows, Linux, or macOS computer directly from an AI chat client over a self-hosted MCP endpoint, providing file management, terminal command execution, and system status monitoring through a relay-and-agent architecture secured by OAuth and device pairing.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      5
      MIT