Use Prefsly with Gemini CLI
Let Gemini CLI retrieve one authorized Prefsly profile through remote MCP.
Set it up
- Run the command below in a terminal where Gemini CLI is installed. Use --scope user if you want Prefsly available across projects.
Gemini CLI commands
gemini mcp add --transport http --scope user prefsly https://www.prefsly.io/mcp gemini trust gemini mcp list gemini # Inside Gemini CLI: /mcp auth prefsly /mcp list - From the project directory where you will use Gemini CLI, run gemini trust and approve the folder. Gemini does not connect MCP servers while the workspace is untrusted.
- Start Gemini CLI, run /mcp auth prefsly, then complete the Prefsly sign-in and profile consent flow in your local browser.
- Run /mcp list to confirm the connection and available tools. Add the startup instruction below to ~/.gemini/GEMINI.md to apply it across projects.
Startup instruction for ~/.gemini/GEMINI.md
At the start of every new session, call the `prefsly` MCP tool `get_profile` and use its returned preferences throughout the session. If the call fails, tell me that prefsly.io preferences could not be loaded.
Good to know
Gemini CLI's OAuth flow opens a browser and returns to a local callback on the same machine. If Gemini CLI is running over SSH or in a headless environment, complete the login from a local session or use a profile token in a supported configuration instead.
Create and use a profile token
Update or disconnect
For copied prompts, copy a new prompt after edits. For MCP, your next tool call sees the saved revision. Revoke a connection from Prefsly Connections when you no longer want a client to retrieve the profile.
Official source
Gemini CLI MCP documentation ↗
Published by Prefsly · Last reviewed September 25, 2026 · All documentation