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/mcpBy 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 ansvarA 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.
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 a
broader term, then retry with allow_broadening=true and label
any relaxed matches as such.
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.