Gemini CLI
Hydrate memory in Gemini CLI via MCP. One command to register, one prompt to verify.
Prerequisites
Both tools installed and on your $PATH.
-
Hydrate:
This placescurl -fsSL gethydrate.dev/install | shhydrate-mcpalongside the mainhydratebinary. - Gemini CLI: see google-gemini/gemini-cli for install instructions. Version 0.26 or later.
Register Hydrate with Gemini
One command:
gemini mcp add hydrate hydrate-mcp
That writes a stdio MCP entry into your Gemini settings pointing at the
hydrate-mcp binary on your $PATH. Gemini will spawn it
on demand the first time a prompt triggers a tool call.
Verify the registration
gemini mcp list Expected output:
Configured MCP servers:
hydrate (stdio) - Disconnected "Disconnected" is correct. Stdio MCP servers are spawned on
demand — they only go "Connected" while a tool call is in flight. If you
see hydrate in the list at all, registration worked.
First prompt
Paste this and send:
gemini --prompt "Call hydrate_recall with query='tech stack' and summarise what you find in 3 bullets" Gemini will invoke the Hydrate tool, receive rendered facts from your context store, and answer from them. If you see three bullets grounded in real project facts, you're done.
Configuration
The hydrate-mcp binary reads its config from environment variables
at call time:
HYDRATE_API— base URL for the Hydrate API (default:http://localhost:8089).SESHELL_CONTEXT_USER— your Hydrate user ID (Enterprise only).SESHELL_CONTEXT_KEY— your Enterprise API key.SESHELL_CONTEXT_APP— your Enterprise app reference.
Free-tier users running the local Hydrate daemon can skip the
SESHELL_* vars entirely — the defaults point at
localhost:8089 and that's all you need.
Make recall automatic (optional)
Gemini is tool-use, not auto-inject. The model only calls
hydrate_recall when it has a reason to — usually because you
prompt it, or because a system instruction nudges it. If you want Hydrate to
feel like it "just works" across every prompt, add a system instruction to
~/.gemini/settings.json:
{
"system_instruction": "At the start of any non-trivial task, call hydrate_recall with a short query describing the task to load relevant project memory. Prefer facts from the recalled context over assumptions."
} That's the closest Gemini gets to Claude Code's auto-inject hooks. It's honest: the model still has to decide, but the instruction makes it almost always decide yes.
Tools exposed
hydrate_recall(query, project?)— returns rendered facts for the given query, optionally scoped to a project.hydrate_save_fact(text, category?)— writes a new fact to your store.hydrate_list_projects()— lists the projects tracked in your store.
Troubleshooting
- Gemini can't find
hydrate-mcp. Runwhich hydrate-mcp. If it's empty, re-run the install one-liner and confirm the binary landed on your$PATH. On macOS, check~/go/binand/usr/local/bin. - Enterprise user seeing empty recalls. The binary is reading
localhost:8089by default. ExportHYDRATE_API,SESHELL_CONTEXT_USER,SESHELL_CONTEXT_KEY,SESHELL_CONTEXT_APPin the shell that launches Gemini CLI. - Gemini never calls the tool. Gemini invokes tools only when the prompt gives it a reason. Either be explicit ("call hydrate_recall..."), or add the system instruction above to your settings.