Add Selvedge to Gemini CLI
Run selvedge setup --agent gemini (0.3.12+) to write the MCP entry and GEMINI.md instructions. Selvedge stores the reasoning Gemini CLI records and makes it available to subsequent sessions.
Before you start
Section titled “Before you start”pip install selvedge gives you the selvedge CLI (selvedge setup, selvedge blame, and the selvedge prompt helper below):
pip install selvedgeThe MCP config below launches the server with uvx instead of a bare selvedge-server, so the package can be fetched on demand — the editor still needs to find uv installed. Prefer the global binary? Swap uvx --from selvedge selvedge-server for selvedge-server.
Add the MCP server
Section titled “Add the MCP server”Add this to .gemini/settings.json in your project:
{ "mcpServers": { "selvedge": { "command": "uvx", "args": ["--from", "selvedge", "selvedge-server"] } }}Prefer not to touch config files? selvedge setup detects Gemini CLI and writes this for you (with a .bak first).
Tell your agent when to call it
Section titled “Tell your agent when to call it”Selvedge captures decisions when your agent calls it. Install the instruction block into your project’s GEMINI.md:
selvedge prompt --install GEMINI.mdIt’s also a copy-paste block on the site: the Selvedge agent prompt block.
Verify
Section titled “Verify”Restart Gemini CLI in the project. Run /mcp and confirm Selvedge’s tools are available. Ask the agent to save a real rejected approach using log_change and retrieve it using prior_attempts in a new session.
If it doesn’t connect
Section titled “If it doesn’t connect”The agent must be able to find uvx (manual config) or selvedge-server (wizard setup). Approve the server if prompted. Setup writes GEMINI.md so the agent knows when to use Selvedge; it does not install Claude Code lifecycle hooks.
- Quickstart → — the three-command setup and what
selvedge setupautomates. - MCP tools → — the eight tools Gemini CLI will be able to call.
- Gemini CLI MCP docs → — the upstream reference.