imem.ai

Connect imem to Gemini CLI

4 steps · about 75 seconds

Gemini CLI supports MCP over Streamable HTTP. imem uses OAuth discovery, so Gemini opens the browser the first time it needs to authorize your vault — no API key needed.

Server URL
https://mcp.imem.ai

Authentication uses OAuth in the browser with PKCE and dynamic client registration. No API key is needed; tokens are scoped to one vault and can be revoked from settings.

Setup steps

  1. 1

    Add the server with one command

    Run this command:

    gemini mcp add --transport http imem https://mcp.imem.ai
  2. 2

    Or configure manually

    If you prefer manual config, add this to ~/.gemini/settings.json:

    ~/.gemini/settings.json
    {
      "mcpServers": {
        "imem": {
          "httpUrl": "https://mcp.imem.ai",
          "timeout": 30000,
          "trust": false
        }
      }
    }
  3. 3

    Confirm the connection

    Start Gemini CLI, run /mcp, and confirm the imem server is connected.

  4. 4

    Approve OAuth

    If Gemini asks for authorization, approve the browser OAuth flow and return to the terminal.

Verify the connection

Paste the test prompt into Gemini CLI. Gemini should save and read back a harmless test memory, then tell you imem is ready.

Test prompt
Run the imem setup check now. Use the "setup_imem" tool if it is available.

It should save and read a harmless test memory, then tell me whether imem is ready.

Troubleshooting

  • /mcp shows imem as disconnected — re-run the add command and check ~/.gemini/settings.json for a stale entry.
  • Authorization loops — finish the browser OAuth flow before returning to the terminal; the session token is held by Gemini, not by you.

Ready to remember everything?

Create a free vault, connect Gemini CLI, and your AI keeps durable memory across every session.