gemdesk
by azjhf-dev
README.md
# gemdesk
An MCP server plus a small browser bridge that lets a coding harness (Antigravity, Claude Code, OpenCode, Cursor) hand background jobs to **Gemini.app task mode** and collect the results.
Idea credit: a post on r/AntigravityGoogle describing a "hivemind-gemini-desk" workflow. That author's repo was not public, so this is an independent design built only from the public description. No code was copied.
Status: day 6 of 7 (harness configs for Claude Code, Cursor, OpenCode and Antigravity, plus the review-then-handoff workflow in docs/HANDOFF.md).
Previous status, day 5: docs/GATEWAY.md holds a docs-only gateway recipe; config validation flags unsafe settings. The content script is implemented (prompt submit, stream-end detection, challenge/rate-limit detection, cancel) and tested against a saved HTML fixture, but not yet against a live Gemini session.
## How it fits together
harness --MCP stdio--> gemdesk server --ws (127.0.0.1, token)--> extension --> Gemini.app tab
Tools exposed over MCP: desk_submit, desk_status, desk_result, desk_list, desk_cancel, desk_roles, desk_logs, desk_health, desk_resume.
## Roles and results
Every job runs under a role (planner, researcher, reviewer, worker). The role wraps the prompt with instructions plus a result contract, so the Gemini tab ends its reply with a fenced json block: outcome (success/partial/failure), a one-paragraph summary, files touched, details and followups. desk_result returns that structure when the model followed the contract, the raw text otherwise. Add your own roles under "roles" in gemdesk.config.json.
Every job also gets an append-only audit log at ~/.gemdesk/logs/<jobId>.jsonl (created, state changes, progress). Read it with desk_logs.
## Try it
npm install
npm test
npm start # MCP over stdio, bridge on ws://127.0.0.1:8765
Settings are in gemdesk.config.json (defaults in src/config.mjs). The config is validated at load: bad types, non-loopback bridge hosts, abusive pacing and non-HTTPS gateway URLs are flagged (strict mode refuses to start).
## Safety behaviour
- maxConcurrentJobs (default 2) caps parallel jobs; each runs in its own open Gemini tab, so open as many tabs as you allow jobs.
- minSecondsBetweenJobs (default 20) spaces every job start.
- Transient errors (tab busy, composer not found, no tab open) retry up to maxRetries (2) with doubling backoff from retryBackoffSeconds (30).
- A captcha or rate-limit page is never retried. It fails the job, pauses all dispatch and leaves queued jobs queued. Check with desk_health, and call desk_resume only after a human has dealt with it.
## Read before using it for real
Driving a consumer web app with an extension may break Google's terms and can put the signed-in account at risk. See docs/RISKS.md. Nothing here has been run against a real Google account.
docs/GATEWAY.md holds a docs-only recipe for giving Gemini.app a call-back path to terminal, filesystem and GitHub tools through a Docker MCP gateway over tailnet-only HTTPS (nothing run, no ports opened).
## Connect a harness
harnesses/ has ready MCP config snippets for Claude Code, Cursor, OpenCode and Antigravity (see harnesses/README.md). The workflow they are for, review-then-handoff - Gemini plans and reviews, the harness model checks and edits - is in docs/HANDOFF.md.
See docs/ARCHITECTURE.md and docs/ROADMAP.md.
TDQS
A3.5/5.0
Scored across 5 tools
Disambiguation5/5
Each tool maps to a distinct lifecycle action on a job: submit, status, result, list, cancel. The only near-neighbor pair (status vs. result) is clearly separated by the descriptions (progress vs. final output).
Naming Consistency5/5
All five tools use the same desk_ prefix followed by a concise verb or noun, in consistent snake_case. The pattern is immediately predictable.
Tool Count5/5
Five tools is a tight, well-scoped surface for an async job queue. Every tool earns its place with no redundancy.
Completeness4/5
The full queue lifecycle is covered: submit, poll status, fetch result, enumerate, and cancel. Minor gaps exist for blocking/waiting on completion or streaming logs, but agents can work around these by polling.
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues