Purpose: Galley's MCP kernel is used to connect Galley document projects to the user's own coding agent, letting the agent perform document reading, suggestions, and edit proposals under an existing subscription or paid plan, without needing to configure a model provider API key for Galley's built-in agent.
Main capabilities: The kernel runs over stdio and exposes a set of tools to the agent; except for list_projects, every tool requires passing project (i.e., the projectId returned by list_projects). The agent can read documents, list files, search the project, view references, and submit edit proposals via propose_edit and propose_files. Proposals are first applied to a temporary copy, then published as pending proposals, displayed in Galley as review cards with a read-only diff, and accepted or rejected by a human; multi-file proposals take effect atomically, and remain pending if they conflict with the user's edits in the meantime. Tool responses faithfully return applied, rejected, or pending_review. Auto-accept can optionally be enabled per authorization; it is off by default and unavailable to viewers; when enabled, a rollback-capable checkpoint is created before each application, a persistent audit log is recorded, and a persistent banner with a kill switch is displayed.
Usage: Requires a running Galley, a running sync relay (ws://localhost:1234 for local development), a project open in the browser, and a checkout of this repository. The kernel is provided as the galley-mcp command in the repository; it has not yet been published to npm, so it must be installed once from the checkout directory (e.g., pnpm link, or using a symlink); alternatively, run it directly with pnpm -C /path/to/galley --filter @galley/mcp start -- …. Open the project in Galley and click Share to obtain the room ID after /join/ in the join link; the sync address can use --url instead of --sync, and the relay address is read from the site's /config.js. Then register it as a stdio server in Claude Code, Codex, or Claude Desktop. The room ID is equivalent to a credential and should be kept like a password.
Project selection: By default, project mode is used, which limits the kernel to manually created rooms; control mode requires enabling it in Settings → Agent AccessEnabled by default off. Galley generates a session-level control room and a one-time pairing code (expires in 10 minutes). The kernel obtains the real key through an authenticated ECDH handshake, and the pairing information is saved in ${XDG_STATE_HOME:-$HOME/.local/state}/galley/kernel/pairing.json. list_projects returns only id, name, and timestamp; reading requires per-project authorization, with zero authorization by default; the first open_project pops up an authorization dialog for file access, Ask/Auto review mode, and optional background access, with Ask as the default and background access off by default.
Use cases: users who want to use their own coding agent in a local document workflow for writing assistance, review, and revision suggestions, while retaining a human acceptance gate.
Limitations: the agent cannot directly edit documents; this is a structural limitation rather than a setting; the Galley tab must remain open, otherwise synchronization cannot occur; binary upload requires a compatible web app and sync relay, and older browsers return binary_protocol_unsupported; --compile-url must be a loopback address, otherwise it is rejected to prevent data leakage; hosted connectors retain a copy of the project on the server, and images and project fonts are not currently included in the server copy; the kernel uses stdio rather than a network service, with no port exposed.