Gemini Hands
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gemini Hands Run the test suite and summarize any failures"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Listens on a local port. Gemini on the web arrives through Tailscale Funnel, a Cloudflare tunnel, or your own HTTPS reverse proxy
Tool names and PascalCase arguments follow Antigravity / original agy (
Path,CommandLine,Confirm)HTTP serves Streamable MCP (
/mcp) plus OAuth; a local subprocess can usestdiowith no configOne HTTP process per machine. Destructive commands are refused until you
Confirm. Sessions claim write pathsUI language defaults to English; switch to Chinese in the setup screen or with
language=zh
Private repo: https://github.com/luckfu/gemini-hands. The sibling Node project gemini-space is read-only reference and is not modified.
Contents
Related MCP server: OneCode Core
Requirements
Python 3.13+
Gemini on the web: an HTTPS hostname (Tailscale Funnel or Cloudflare is enough)
Tailscale mode: signed-in Tailscale app, Funnel and HTTPS certificates enabled in the admin console
Cloudflare mode:
cloudflaredonPATH(no Cloudflare account)
Install
git clone https://github.com/luckfu/gemini-hands.git
cd gemini-hands
uv syncThen run uv run gemini-hands …. After you install the script, gemini-hands works on its own.
Five-minute start
uv run gemini-hands serveIf there is no config yet, the terminal UI opens. Pick how Gemini should reach this machine, set a workspace, Save and start.
Startup prints the MCP URL and the owner password. You can also ask later:
uv run gemini-hands url # https://…/mcp for Gemini on the web
uv run gemini-hands password # owner password; copied to the clipboardPaste the URL into a custom Gemini connector. Leave Client ID / Secret empty. On the authorize page, paste the owner password.
Day to day:
uv run gemini-hands serve # start
uv run gemini-hands stop # stop
uv run gemini-hands setup # edit config
uv run gemini-hands doctor # check the tunnelLanguage (English is the default):
uv run gemini-hands config set language=zh # 中文
uv run gemini-hands config set language=en # EnglishConnect Gemini on the web
sequenceDiagram
participant You
participant Hands as Gemini Hands
participant Gemini as Gemini on the web
You->>Hands: serve (Funnel or Cloudflare)
Hands-->>You: https://host/mcp + owner password
You->>Gemini: Custom connector URL, empty client id/secret
Gemini->>Hands: OAuth register + authorize
You->>Hands: paste owner password
Hands-->>Gemini: code + tokens
Gemini->>Hands: MCP toolsThe server must be running.
Open gemini.google.com/customize/connectors → + Custom.
MCP Server URL is the output of
uv run gemini-hands url, for example:https://macbook-air.your-tailnet.ts.net/mcp https://xxxx.trycloudflare.com/mcpLeave Client ID and Client Secret empty. Dynamic client registration accepts Gemini’s six
oauth-redirect*.googleusercontent.comcallbacks.On the approve page, paste the owner password from the start log or
uv run gemini-hands password. It lives in~/.gemini-hands/auth.jsonasownerToken. It is not your Google password.After it connects, ordinary chat and Gemini Task can call tools.
Google binds a connector by hostname. Do not hang a second test connector on the same host or you will get 401s. Use another hostname for parallel tests (for example *.ts.net vs *.trycloudflare.com).
A trycloudflare hostname changes every start; update the connector. A Tailscale Funnel hostname usually follows the machine name and can stay.
Four connection modes
Gemini Hands always listens on this machine (public listens on 0.0.0.0). Remote modes forward HTTPS to that port. Default port 7676.
Mode |
| Gemini on the web | Who opens the tunnel |
This machine only |
| cannot connect | none. Use |
Tailscale Funnel |
|
|
|
Cloudflare tunnel |
|
|
|
Existing public HTTPS |
| your | your reverse proxy forwards 443 |
local
For clients on this computer. No OAuth. Use it for the Gemini app, debugging, or stdio.
tailscale
Install and sign in to Tailscale (downloads).
In admin DNS turn on HTTPS certificates and Funnel.
gemini-hands config set connect=tailscalethenserve. Leave the URL empty; Funnel is enabled on start. Iftailscaleis missing,serveprints install notes and exits.The hostname is usually
https://<machine>.<tailnet>.ts.netand stays stable.
cloudflare
Install
cloudflaredand keep it onPATH(downloads).Choose Cloudflare and leave the HTTPS URL empty.
On start,
cloudflaredopens a*.trycloudflare.comtunnel. No Cloudflare account. If the binary is missing,serveprints install notes and exits — it will not install it for you.Gemini on the web must use the hostname printed this start.
If you already have a named host, put
https://space.your.domainin config and the server will not open trycloudflare.
public
Nginx / Caddy / a cloud load balancer already terminates TLS. Gemini Hands listens on 0.0.0.0:<port>. Config holds the HTTPS origin that already opens in a browser, without /mcp.
Tailscale and cloudflared
Only Gemini on the web needs a tunnel. stdio / connect=local do not.
Tailscale
OS | Typical install |
macOS | App from the site, or |
Windows | Installer, or |
Linux | Distro package from the site, or |
cloudflared
OS | Typical install |
macOS |
|
Windows |
|
Debian / Ubuntu | Cloudflare apt repo, or a |
Other Linux | Matching binary from GitHub Releases, on |
Do not assume every machine has brew. cloudflared --version and tailscale status should work in a terminal.
Commands
gemini-hands Open the UI. Create config if missing; start or edit if it exists
gemini-hands setup Jump straight to the edit form
gemini-hands config Show current config (same as config show)
gemini-hands config show
gemini-hands config path Print ~/.gemini-hands/config.json
gemini-hands config set … Change fields without rewriting everything
gemini-hands password Print the owner password and copy it
gemini-hands url Print the MCP URL for Gemini on the web
gemini-hands serve Start HTTP. Opens the UI if config is missing
gemini-hands serve --setup Edit config, then start
gemini-hands serve --stdio Same as stdio
gemini-hands stop Stop the running HTTP server
gemini-hands doctor Check mode, URL, and tunnel
gemini-hands status Same as doctor
gemini-hands stdio Local subprocess; no config required
gemini-hands init Write a full config from flags (needs --connect)gemini-hands setup
gemini-hands config set workspace ~/Documents/gemini-hands
gemini-hands config set connect=cloudflare
gemini-hands config set connect=tailscale
gemini-hands config set port=7676
gemini-hands config set public-url=https://space.example.com
gemini-hands config set workspace=~/project connect=local
gemini-hands config set language=zhKeys for config set: connect, port, workspace, public-url, listen-host, hold-ms, language. Switching connect clears the old public URL so Tailscale / Cloudflare can request a new one.
A running server does not pick up new config by itself:
gemini-hands stop
gemini-hands serveOne-shot write (replaces the whole file, does not merge):
gemini-hands init --connect cloudflare --port 7676 --workspace ~
gemini-hands init --connect public --public-url https://space.example.com --port 7676Configuration
Files live in ~/.gemini-hands/ (GEMINI_HANDS_HOME overrides). If only ~/.gemini-space exists, the first start renames it.
File | Contents |
| Mode, port, workspace, public URL, language |
| Owner password |
| Running HTTP process (written on start, removed on exit) |
| trycloudflare log |
| Funnel log |
Field | Meaning | Default |
|
| required |
| Local port |
|
| Usually omit. |
|
| HTTPS origin, no |
|
| Starting directory for | home |
| How long to wait before returning a task id |
|
|
|
|
The setup screen (gemini-hands / setup) can change mode, port, workspace, a fixed HTTPS origin, and 中文 / English. The home screen shows the owner password. serve prints it every start.
Tools
Arguments are PascalCase. Paths must be absolute. There is no separate “open workspace” step.
Tool | What it does |
| Read text. At most 800 lines or 46080 bytes per call; over 100MB or binary is not inlined |
| Create or overwrite. Existing files need |
| Replace every |
| List a directory |
| Search file contents; regex and case-insensitive flags |
| Glob filenames, e.g. |
| Run zsh in the workspace. Non-daemons wait; timeout returns a task id |
|
|
| Code Mode: async Python calling |
| Wait on a running |
| Cancel |
| Current mode and MCP URLs; does not read files |
Common run_command fields: CommandLine, toolSummary, WaitMsBeforeAsync, IsDaemon, Confirm.
No web search, browser, cron, or sub-agent swarm. Those are out of scope.
Behavior
Workspace. run_command starts in workspace (home by default). File tools still take absolute paths and may point outside that folder.
Waiting. Non-daemon commands wait on the server up to holdMs (45s default). After that you get a task id; poll with manage_task + Action=status + TaskId.
Session isolation. A Gemini session that wrote a path claims it. Another session cannot write that path or a child of it.
Destructive commands. rm -rf aimed at /, ~, *, plus mkfs / shutdown / reboot / dd and similar, are refused. After you agree in the chat, retry the same command with Confirm: true.
Code Mode. Use execute to touch many files from one async Python snippet calling tools.*. At most 64 tool calls, 6 concurrent.
OAuth. local and stdio do not require OAuth. Remote modes enable dynamic client registration for Gemini’s Google redirect hosts. The owner password is only for the approve page.
Local stdio
For the Gemini app or an editor as a subprocess. No port, no config required:
uv run gemini-hands stdioProtocol on stdout, human logs on stderr. If a config exists, workspace and holdMs are reused.
Audit page and icon
After a remote start:
Audit:
https://hostname/web/(owner password first)Icon:
https://hostname/icon.png(also/icon.svg,/favicon.png)
MCP initialize sends title and icons. Gemini’s custom-app UI may still show a default glyph; the files are served.
Process and ports
Only one HTTP listener. A second serve prints the live pid and URLs and exits.
If the preferred port is taken by something else, the next 30 ports are tried and the config is updated (7676 is in use; using 7677 instead). If the occupant is this same Gemini Hands process, it will not start a second copy.
stop sends SIGTERM. A Cloudflare quick tunnel dies with the process. Tailscale Funnel is node config and may still point at the old port until the next serve.
Troubleshooting
Symptom | What to do |
Gemini asks for Client ID / Secret | Dynamic registration failed. Check |
Authorize page: what to paste? |
|
401 after approve | A second connector on the same hostname, or a trycloudflare host that already rotated |
| Remote mode has not started, or the tunnel is still coming up |
Tailscale Funnel failed | Installed and signed in? Funnel / HTTPS certs on? On |
tailscale / cloudflared not found | That mode needs the binary. Install it, then |
trycloudflare timed out |
|
Config changed but behavior did not |
|
Port in use | Use the port printed at start, or |
Destructive command refused | Confirm in the chat, then retry with |
uv run gemini-hands doctor
curl -sS http://127.0.0.1:7676/healthz
curl -sS "$(uv run gemini-hands url | sed 's|/mcp$||')/healthz"Environment
Variable | Meaning |
| Config directory, default |
| Same (old name) |
|
|
Development
uv sync
uv run python -m unittest discover -s testsPackage gemini_hands, entry gemini-hands. HTTP uses the MCP Python SDK Streamable HTTP transport. The setup UI is Textual.
License
Available Tools
12 toolscancel_executionB
Cancel a running execute snippet.
Inputs: execution_id (required). Returns: result
edit_fileA
Replace every exact occurrence of Target in a file. Target must match the file text, including whitespace.
Inputs: Path (required), Target (required), Replacement (required), ArtifactMetadata. Returns: result
executeA
Run an async Python snippet that can await tools.* to batch many local operations in one call.
Inputs: code (required), yield_time_ms. Returns: result
find_by_nameB
Find files or directories by name glob. Prefer this over find or ls.
Inputs: Path (required), Pattern (required). Returns: result
grep_searchA
Search file contents under a path. Prefer this over a shell grep.
Inputs: Path (required), Query (required), IsRegex, CaseInsensitive. Returns: result
list_dirB
List one directory. Prefer this over a shell ls.
Inputs: Path (required). Returns: result
manage_taskB
List, wait on, write to, or kill a background command from this session.
Inputs: Action (required), Input, TaskId. Returns: result
poll_executionC
Wait for an execute snippet that was still running.
Inputs: execution_id (required), yield_time_ms. Returns: result
read_fileB
Read a text file. Each call returns at most 800 lines or 46080 bytes.
Inputs: Path (required), EndLine, StartLine, ByteOffset. Returns: result
run_commandA
Run a zsh command. The server waits for it to finish. A long command returns a task id for manage_task.
Inputs: CommandLine (required), toolSummary (required), WaitMsBeforeAsync (required), Confirm, +1 more. Returns: result
server_infoB
Report that this process speaks MCP over stdin and stdout.
Inputs: no named parameters. Returns: result
write_fileA
Create or replace a file. Parent directories are created. Set Overwrite or Append when the file exists.
Inputs: Path (required), Content (required), Append, Overwrite, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
File tools are cleanly separated by action (read/write/edit/list/grep/find), and search-based tools explicitly state which shell command they replace. The one fuzzy area is two parallel task-lifecycle sets: run_command+manage_task for shell processes versus execute+poll_execution+cancel_execution for Python snippets, which an agent could mix up despite the descriptions.
Most tools follow a predictable verb_noun pattern (read_file, write_file, list_dir, grep_search, find_by_name, run_command, manage_task, cancel_execution). Two deviations stand out: bare verb 'execute' and noun-only 'server_info', which break the pattern without causing confusion.
12 tools is squarely in the well-scoped range, and each one maps to a distinct capability: file I/O, directory listing, content/name search, shell execution, background task control, and Python batching. Nothing feels redundant or padded.
Core file operations (read, write, edit, list, search) plus command execution and async task control cover the agent's lifecycle well. There is no dedicated delete or move/rename file tool, but run_command provides a workaround, making it a minor gap.
Maintenance
Related MCP Connectors
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.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceExposes a governed suite of 38 tools over one OAuth-gated MCP endpoint so web AI chat clients can read and edit files, run whitelisted shell commands, search, query Git/SQLite, drive browsers via DevTools, and manage background jobs on the local machine. Remote access runs through Tailscale Funnel while local tools connect straight to 127.0.0.1, keeping operations permission-scoped rather than granting unrestricted shell access.-
- AlicenseNot gradedqualityBmaintenanceConnects 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.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 gradedqualityBmaintenanceEnables Gemini web chat to access and control a local PC's files, search, Git, shell commands, and background processes across macOS, Windows, and Linux through an OAuth-secured MCP connector.1MIT