gemini-workspace-mcp
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-workspace-mcp
English | 简体中文
Make full use of Gemini Mac App's Task Mode — equip Gemini with a real, controllable local engineering scaffold!
The native Gemini Mac App already packs strong Task Mode reasoning and execution capabilities, yet putting it to work on real repositories out of the box hits familiar friction: manual prompt handoffs, coarse directory permissions, disruptive confirmation popups, and no structured lifecycle or audit trail.
gemini-workspace-mcp solves this by pairing Gemini Mac App with a task-scoped local workspace MCP service and resident daemon. With dual-socket isolation, short-lived per-task capabilities, zero-popup staged file writes, concurrent task queuing, and objective MCP call telemetry, developers and external orchestrator agents can reliably delegate real coding, planning, and code review work to Gemini.
Key Features
Dual-Channel Isolation — Separates the trusted Host Control Plane (
serve-host) from the Worker Workspace Plane (serve) over dedicated0600Unix domain sockets (h.sockandw.sock) backed by a single SQLite store.Task-Scoped Bearer Capabilities — Every worker tool call requires a per-task
task_idand short-livedcapabilitysecret. Grants are bounded to explicit roots (read_onlyorread_write), time-limited via TTL, and revocable immediately upon acceptance or cancellation.Zero-Popup Staged File Writes — Workers stage proposed edits in task-private SQLite storage via
task_stage_file; the host validates policy rules and commits each staged file viahost_task_applywith SHA-256 preflight checks and per-file atomic rename, avoiding native UI confirmation popups (not a cross-file transaction or cross-process lock against external editors).Multi-Session Concurrency & Async FIFO Queue — Supports configurable concurrent slots (
max_concurrent_tasks), non-blockingasync_dispatch=Truequeuing with a resident background dispatcher, and a frontmost-only idle guard (idle_guard_seconds) so UI automation avoids interrupting active user input.Objective Per-Task MCP Telemetry (
mcp_metrics) — Tracks completed authorized worker handler calls, error counts, per-tool breakdowns, and canonical non-capability request / redactedstructuredContentUTF-8 bytes (excluding cancelled calls and pre-handler SDK validation errors). Because the native Gemini Mac App does not expose server-side token usage,official_model_tokensis explicitly reported asnullrather than estimated.
Related MCP server: Arrgon
Architecture
A single resident daemon arbitrates between the trusted host orchestrator (serve-host), the native Swift Accessibility helper (gemini-task), and the worker MCP endpoint (serve) inside Gemini Mac App:
flowchart LR
HostAgent["Host / Orchestrator Agent"] <-->|stdio| HostProxy["serve-host (stdio proxy)"]
HostProxy <-->|"h.sock (0600 UDS)"| Daemon["Resident Daemon\n(SQLite + FIFO Dispatcher)"]
Daemon <-->|"stdin/stdout JSON"| SwiftHelper["gemini-task (Swift AX Helper)"]
SwiftHelper <-->|"macOS AppKit / AX"| GeminiApp["Native Gemini Mac App"]
GeminiApp <-->|"stdio"| WorkerProxy["serve (stdio proxy)"]
WorkerProxy <-->|"w.sock (0600 UDS)"| DaemonTypical task lifecycle: host_task_create (mint bounded grant) → host_task_submit (dispatch or queue into Gemini Mac App) → worker inspects/stages changes via serve & reports completion via task_report → host_task_apply & host_task_accept (atomically commit staged files and revoke capability).
Platform Support & Requirements
macOS Only for full Gemini Mac App delegation.
Component | Requirement | Notes |
OS | macOS (Apple Silicon / Intel) | Native helper (GeminiTask.swift) uses AppKit & macOS Accessibility ( |
Native Client | Gemini Mac App | Tested on |
Permissions | Accessibility (TCC) | Required for the context driving |
Python |
| Tested with Python |
Toolchain |
|
|
Quick Start
1. Clone & Build
git clone https://github.com/SaromChars/gemini-workspace-mcp.git
cd gemini-workspace-mcp
uv sync --locked
uv build --wheel --out-dir dist .Create an isolated runtime environment, install the wheel with its dependencies, and compile the native Swift Accessibility helper:
BASE="$HOME/.local/share/gemini-workspace-mcp"
HOST_PRIVATE="$HOME/.local/state/gemini-workspace-mcp-host"
mkdir -p -m 0700 "$BASE" "$BASE/runtime" "$BASE/control" "$BASE/run" \
"$HOST_PRIVATE" "$HOST_PRIVATE/bin" "$HOST_PRIVATE/run" "$HOST_PRIVATE/logs"
uv venv "$BASE/runtime/env" --python 3.13
uv pip install --python "$BASE/runtime/env/bin/python" dist/gemini_workspace_mcp-0.8.1-py3-none-any.whl
swiftc -O -framework Cocoa -framework ApplicationServices \
tools/gemini-app/GeminiTask.swift -o "$HOST_PRIVATE/bin/gemini-task"
chmod 0700 "$HOST_PRIVATE/bin/gemini-task"
shasum -a 256 "$HOST_PRIVATE/bin/gemini-task"2. Configure policy.json & daemon.json
$HOST_PRIVATE/policy.json (0600) — set helper_sha256 to the shasum -a 256 output above and replace $HOME with your absolute home directory path:
{
"version": 1,
"origin_host": "local",
"private_dir": "$HOME/.local/state/gemini-workspace-mcp-host",
"helper_path": "$HOME/.local/state/gemini-workspace-mcp-host/bin/gemini-task",
"helper_sha256": "<64-hex-sha256-of-gemini-task>",
"helper_timeout_seconds": 20,
"max_ttl_seconds": 3600,
"max_queue": 8,
"requests_per_minute": 30,
"model": "Neon",
"allowed_roots": {
"work": {
"path": "$HOME/workspace",
"mode": "read_write"
}
},
"max_concurrent_tasks": 3,
"idle_guard_seconds": 5.0,
"auto_activate_app": true,
"restore_previous_app": true,
"enable_background_dispatcher": true
}Replace
$HOMEin JSON files with your actual absolute home directory path (JSON does not expand environment variables).
$BASE/control/daemon.json (0600):
{
"version": 1,
"worker_socket": "$HOME/.local/share/gemini-workspace-mcp/run/w.sock",
"host_socket": "$HOME/.local/state/gemini-workspace-mcp-host/run/h.sock",
"policy_file": "$HOME/.local/state/gemini-workspace-mcp-host/policy.json"
}3. Start the Resident Daemon (launchd)
"$BASE/runtime/env/bin/python" -I -m gemini_workspace_mcp --state-dir "$BASE/control" daemon launchagent \
--label local.gemini-workspace-mcp \
--python "$BASE/runtime/env/bin/python" \
--output "$HOST_PRIVATE/local.gemini-workspace-mcp.plist" \
--log-dir "$HOST_PRIVATE/logs"
install -m 0600 "$HOST_PRIVATE/local.gemini-workspace-mcp.plist" "$HOME/Library/LaunchAgents/local.gemini-workspace-mcp.plist"
launchctl bootstrap "gui/$(id -u)" "$HOME/Library/LaunchAgents/local.gemini-workspace-mcp.plist"
"$BASE/runtime/env/bin/python" -I -m gemini_workspace_mcp --state-dir "$BASE/control" daemon status4. Connect MCP Clients
Host Client (orchestrator):
$HOME/.local/share/gemini-workspace-mcp/runtime/env/bin/python -I -m gemini_workspace_mcp \ --state-dir $HOME/.local/share/gemini-workspace-mcp/control \ serve-host --policy $HOME/.local/state/gemini-workspace-mcp-host/policy.jsonWorker Client (Gemini Mac App Local MCP):
$HOME/.local/share/gemini-workspace-mcp/runtime/env/bin/python -I -m gemini_workspace_mcp \ --state-dir $HOME/.local/share/gemini-workspace-mcp/control \ serve
MCP Tools Reference
Host Control Tools (serve-host)
Tool | Purpose |
| Register a bounded task, roots ( |
| Dispatch the task to Gemini Mac App immediately or enqueue via |
| Poll events and handle bounded native approval cards when |
| Return current task state, slot/queue status, |
| Long-poll for durable worker events up to 30 seconds. |
| Fetch durable events and task status/metrics without mutating state. |
| Read a file inside an authorized task root from the trusted host side. |
| Validate policy & SHA-256 preconditions and commit staged files from |
| Persist host acknowledgment receipt for an event cursor and optionally revoke the task ( |
| Request cancellation, revoke capability, and clean up active slot state. |
| Reconcile native app state when submission/stop status is uncertain. |
| Composite deterministic helper: create → submit → wait/advance → optional apply & accept. |
Worker Workspace Tools (serve)
All worker tools require task_id and capability.
Tool | Purpose |
| Inspect task roots, mode, and limits (never returns the bearer capability). |
| List regular files inside one authorized named root. |
| Bounded literal UTF-8 content search inside an authorized root. |
| Read a bounded UTF-8 file slice with full-file SHA-256 digest. |
| Stage a create/update file write in task-private storage for |
| Direct hash-checked create/update inside a |
| Persist an idempotent |
| Read durable events for the active grant. |
| Cancellable poll for new events while rechecking capability validity. |
Security Model & Non-Goals
Path & Link Safety: Rejects directory traversal (
..), absolute paths, symlinks (O_NOFOLLOW_ANY/ fd-walk), multi-hardlink files, special files, and.gitcomponents.No Shell or Network Tools: Worker tools have no command execution, HTTP server, or host-wake capabilities.
Secret Hygiene: Capabilities are excluded from logs, metrics byte counts, and
PrivateOutputredacts any accidental secret echo.Non-Goals: This service is not an OS-level sandbox and cannot restrict Gemini Mac App's own built-in tools or same-UID local processes. It does not estimate or fabricate official Gemini model token counts.
Development & Testing
PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m pytest -qDocumentation
License
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
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.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Build, test and cache insights for Xcode, Gradle and Bazel projects, for coding agents.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to securely inspect and edit approved code, use semantic code intelligence, run builds/tests, supervise bounded processes, inspect Git, and execute owner-approved SSH commands on engineering workstations.2Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables Google Gemini to autonomously read, write, search, and patch code files and run whitelisted developer commands inside a sandboxed local workspace for edit-and-verify coding workflows.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP hosts such as Claude Code, Codex, and Antigravity to hand coding tasks to an already-signed-in Gemini for Windows desktop app, which reads authorized files, edits code, and runs verification commands on its own hidden Win32 desktop without stealing focus or touching the clipboard. Tasks return a request ID immediately so work proceeds in the background, alongside code review, dedicated-session chat, and workspace snapshot/rollback tooling.1MIT
- 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