Connect Gemini

    "Gemini" is several products, and their MCP support differs. Developer surfaces — Gemini CLI, Gemini Code Assist, and Google Antigravity — connect to the gateway the same way Claude or Cursor do: point them at https://gateway.ansvar.eu/mcp and approve one browser login. The Gemini app at gemini.google.com and Gemini Enterprise are more constrained; their sections below say exactly what works today. If you build your own agent on the Gemini API or ADK, you need the headless path at the end.

    Gemini CLI

    One command registers the gateway:

    gemini mcp add --transport http ansvar https://gateway.ansvar.eu/mcp

    By default this writes to .gemini/settings.json in the current project; add --scope user to register it globally in ~/.gemini/settings.json. Then start gemini and run:

    /mcp auth ansvar

    A browser opens for the OAuth login at auth.ansvar.eu — there is no client ID or key to configure; Gemini CLI discovers the gateway's OAuth endpoints and registers itself automatically. Approve the login, return to the terminal, and verify with /mcp list: the ansvar server should read connected, with the tool catalogue your tier includes.

    Gemini Code Assist (VS Code and JetBrains)

    Code Assist's agent mode shares the Gemini CLI engine. In VS Code it reads the same ~/.gemini/settings.json, so the CLI command above (with --scope user) also configures the extension. Or add the entry by hand — JetBrains uses a separate mcp.json in the IDE's config directory with the same schema:

    {
      "mcpServers": {
        "ansvar": {
          "httpUrl": "https://gateway.ansvar.eu/mcp"
        }
      }
    }

    The first tool call triggers the browser OAuth flow. Agent mode is still labelled Preview by Google, and org admins can restrict which MCP servers load — if the server never appears, ask whether your organization enforces an MCP allowlist.

    Google Antigravity

    In the Agent panel, open the … menu → MCP Servers → Manage MCP Servers → View raw config, and add:

    {
      "mcpServers": {
        "ansvar": {
          "serverUrl": "https://gateway.ansvar.eu/mcp"
        }
      }
    }

    Note the field name — Antigravity uses serverUrl, not the httpUrl key the rest of the Gemini family reads. Restart Antigravity, then authenticate from the MCP Servers panel. Antigravity handles OAuth automatically for servers that support Dynamic Client Registration, which the gateway does — no client credentials to paste.

    The Gemini app (gemini.google.com)

    The regular Gemini chat — consumer or Workspace — has no custom MCP or connector support; only Google's own curated apps are available. The exception is Gemini Spark, the agentic mode Google launched 2026-06-30: it accepts custom MCP apps and registers against the gateway automatically. Spark is currently limited to personal Google AI Ultra accounts (US, 18+) and is not available on Workspace-managed accounts, so it is not a path for an enterprise rollout yet. If your team uses the Gemini app day-to-day, the practical options today are Gemini CLI or Gemini Enterprise.

    Gemini Enterprise

    Gemini Enterprise (formerly Agentspace) can reach the gateway through its Custom MCP Server connector — an admin-configured data store, currently in Preview and off by default until a Google Cloud org-policy admin enables it. Unlike the developer surfaces, this connector does not self-register: it asks for a pre-provisioned OAuth client ID and secret alongside the authorization and token URLs.

    We provision that client for you. with your organization name, and we return the client credentials plus the exact values for each connector field. Google's side is: Google Cloud Console → Agent Platform → Data stores → Create data store → Custom MCP Server, with the server URL https://gateway.ansvar.eu/mcp. The connector speaks streamable HTTP, which is what the gateway serves.

    Get your first cited answer

    Paste one of these tasks exactly as written. Each reads one source, so it runs on every plan, Free included, and you get the law's text with a link you can open.

    Whichever surface you connected, /mcp list or the connected status only proves the login worked. Paste the task into the Gemini CLI prompt, the Code Assist or Antigravity agent panel, or a chat with your Gemini Enterprise agent.

    An EU regulation article. You should get the text of Article 17 (right to erasure), linked to eur-lex.europa.eu.

    Using Ansvar, retrieve GDPR Article 17 and show its official source link.

    A national law provision. You should get the German text of § 26 BDSG (employee data), linked to gesetze-im-internet.de.

    Using Ansvar, retrieve section 26 of the German Federal Data Protection Act (BDSG) and show its official source link.

    NIS2 obligations for a sector. You should get the ten measures in Article 21(2), linked to eur-lex.europa.eu.

    Using Ansvar, retrieve NIS2 Article 21 and list the cybersecurity measures an energy company must take. Show the official source link.

    DORA incident reporting for a bank. You should get the initial notification, intermediate report and final report of Article 19(4), linked to eur-lex.europa.eu.

    Using Ansvar, retrieve DORA Article 19 and list the reports a bank must file after a major ICT-related incident. Show the official source link.

    What a good answer looks like: the text of the provision, its article or section number, and a link to the official publisher. Your client should also show a call to an Ansvar tool, usually get_provision. An answer with no tool call and no source link came from the model's memory: lead the message with "Using Ansvar" and add the routing instructions.

    Instruct your agent — the routing pack

    A connected agent without routing instructions can still answer legal questions from its training data — the connector sitting idle at exactly the moment it should prove itself — when a message does not name Ansvar. Where it lives depends on the surface: Gemini CLI and Code Assist read a project GEMINI.md(or a global ~/.gemini/GEMINI.md), Antigravity takes it as an Always-On rule, and a Gemini Enterprise agent takes it in the system-instructions field. The block is the same set that Instruct your agent explains line by line; adapt the jurisdictions to your market.

    You are a compliance research assistant. Answer legal, regulatory,
    and security-standards questions only from Ansvar tool results,
    never from your own knowledge.
    
    For every legal, regulatory, or standards question:
    1. Call the search tool, always with a scope: jurisdictions=["SE"]
       (adapt to your market; add "EU" for EU regulation - GDPR, NIS2,
       the AI Act), or frameworks=["GDPR"] for one EU framework across
       the board. On the Free plan, pass exactly one jurisdiction or
       framework per call.
    2. Never pass the user's whole question as the query. Reduce it to
       1-3 legal key terms in the language of the law you are searching
       - Swedish terms for Swedish law. Try alternative terms as separate
       searches. If a multi-concept query returns nothing, split it into
       one search per concept.
    3. If a search returns nothing, retry once with a synonym or the
       corpus's own term for the concept. Whenever a response reports
       withheld relaxed matches (meta.broadening_available is true, or
       meta.message says so), tell the user and offer a re-run with
       allow_broadening=true; re-run only if they accept, and label any
       relaxed matches as such. Never set allow_broadening on your own.
       If meta.recommended_scopes names scope ids you did not search,
       search those next.
    4. Cite every answer: law, article, and source URL from the
       results. If the results do not contain the answer, say which
       searches you ran and that you will not answer from memory -
       never invent a source.

    Building your own: Gemini API, ADK, Interactions API

    None of the code-level Gemini paths run the browser OAuth flow for you — they pass a fixed Authorization header. Google's ADK attaches the gateway via McpToolset(connection_params=StreamableHTTPConnectionParams(url=...)) with a header provider; the Interactions API's native mcp_server tool takes a static headers map (as of 2026-07-02 it did not support Gemini 3 models — check Google's current docs before building on it). Because gateway tokens expire within minutes, a pasted token won't hold — headless setups need a managed service credential, the same shape as n8n or CI. See Clients without OAuth.