Loop
How it worksThe loopWhy LoopPricingDocs
guide Gemini · 2 minutes

Connect Loop to Gemini.

Loop is a remote MCP server. Google Gemini reaches it two ways — the Gemini CLI (a single line in settings.json) or the google-genai SDKin Python. Either way, Loop’s four tools let Gemini search, verify, and act on real local businesses in Kreuzberg, Berlin.

option 1 Gemini CLI
1

Open your Gemini CLI settings

Edit ~/.gemini/settings.json(create it if it doesn’t exist) for a user-wide install. For a single project, use .gemini/settings.json in the project root instead.

2

Add Loop under mcpServers

Add the block below. The Gemini CLI uses the httpUrl key for remote streamable-HTTP MCP servers (as opposed to url for SSE or command for local stdio).

~/.gemini/settings.json
{
  "mcpServers": {
    "loop": {
      "httpUrl": "https://stayinloop.dev/mcp"
    }
  }
}
3

Verify the connection

Restart the gemini command and run /mcp. Loop appears in the server list and its tools (search, get_details, verify, report) become available to the model.

option 2 google-genai SDK (Python)
1

Install the SDKs

You need the Gen AI SDK and the MCP Python SDK. Set GEMINI_API_KEY in your environment for the Gemini model.

shell
pip install google-genai mcp
2

Pass the Loop session to generate_content

Open a streamable-HTTP connection to Loop, wrap it in a ClientSession, and hand the live session to tools. The Gen AI SDK lists Loop’s tools and calls them automatically. MCP support in the SDK is currently labeled experimental.

loop_gemini.py
import asyncio
from google import genai
from google.genai import types
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

client = genai.Client()  # reads GEMINI_API_KEY from the environment


async def main():
    # Loop is a remote streamable-HTTP MCP server.
    async with streamablehttp_client("https://stayinloop.dev/mcp") as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()
            response = await client.aio.models.generate_content(
                model="gemini-2.5-flash",
                contents=(
                    "Find a quiet restaurant with outdoor seating in Kreuzberg, "
                    "verify how fresh the data is, then report the outcome."
                ),
                # Pass the live MCP session straight into tools — the SDK lists
                # Loop's tools and calls them automatically. (Experimental.)
                config=types.GenerateContentConfig(tools=[session]),
            )
            print(response.text)


asyncio.run(main())

Have an API key?

Loop reads an Authorization: Bearer header for higher rate limits (60 reads/min vs 30 anonymous). In the Gemini CLI, add a headers block:

~/.gemini/settings.json — with key
{
  "mcpServers": {
    "loop": {
      "httpUrl": "https://stayinloop.dev/mcp",
      "headers": {
        "Authorization": "Bearer sk_live_YOUR_KEY"
      }
    }
  }
}

In the SDK, pass the same header to streamablehttp_client:

loop_gemini.py — with key
async with streamablehttp_client(
    "https://stayinloop.dev/mcp",
    headers={"Authorization": "Bearer sk_live_YOUR_KEY"},
) as (read, write, _):
    ...

Get a free key at stayinloop.dev/#pricing — no credit card, instant.

try this prompt

Find me a quiet restaurant with outdoor seating and vegan options in Kreuzberg tonight — then verify how fresh the data is, and report back whether the result was correct.

This exercises all four tools: search finds candidates, verify re-checks freshness live, and report records the outcome — updating the record’s confidence for every future agent that calls Loop.

← Full API referenceWatch your calls on the signals board →