On this page
- Where Gemini takes MCP servers now
- Add a custom MCP server to the Gemini app
- Add an MCP server to Gemini CLI
- Sign in to a remote MCP server from Gemini CLI
- Approvals in Gemini CLI
- Antigravity CLI: the same server in mcp_config.json
- Example: a direct mail API from Gemini
- Building on the Gemini API: call the direct mail API with a key
- Gemini MCP questions
Where Gemini takes MCP servers now
Until June 2026, “Gemini MCP” mostly meant Gemini CLI. On June 18, Google stopped serving Gemini CLI to free and Google AI Pro and Ultra accounts and moved them to Antigravity CLI, which keeps its MCP servers in a different file. Gemini CLI still runs for Gemini Code Assist Standard and Enterprise seats, paid API keys and Vertex AI. Meanwhile the Gemini app itself started taking custom MCP servers, which Google calls custom connected apps.
Add a custom MCP server to the Gemini app
- On a computer, open gemini.google.com, then Settings, Connected Apps. If it isn’t there, look under Personal Intelligence.
- Under Custom apps, choose Add a custom app and enter the server’s URL:
https://mailr.dev/mcpfor Mailr. - Choose Next and follow the sign-in. Servers that support dynamic client registration, as Mailr’s does, need no credentials.
- In a chat, type @ and pick the app to make Gemini use it.
It’s for personal Google Accounts, 18 or over, in the US, in English, with History on; work and school accounts can’t add one yet. You add it on the web, and it then works in the mobile app too. Gemini asks you to confirm write actions, and Google’s developer docs say it reads a tool’s readOnlyHint and destructiveHint to decide when.
Add an MCP server to Gemini CLI
One command adds a remote server. The default scope is the current project, so --scope user makes it available everywhere:
# Adds it for every project (the default scope is the current project)
gemini mcp add --scope user --transport http mailr https://mailr.dev/mcp
# Check it, then sign in from inside a session
gemini mcp list
# > /mcp auth mailrServers live under mcpServers in ~/.gemini/settings.json, or .gemini/settings.json in a project, where an entry with the same name wins. Gemini CLI’s docs still show httpUrl for Streamable HTTP, but the current code marks it deprecated in favor of url with "type": "http", which is what the command writes. Keep underscores out of server names: Gemini CLI’s tool names and policies split on them.
Sign in to a remote MCP server from Gemini CLI
When a server answers with a 401, Gemini CLI reads its protected-resource metadata, finds the sign-in, registers itself with dynamic client registration and opens your browser, with PKCE. For Mailr, that’s Sign in with Mailr: you pick the account and allow it, and the connection gets its own access, never your API keys. /mcp auth mailr signs in again later. The browser has to reach a localhost callback on the machine running the CLI, so over SSH without forwarding the sign-in won’t finish. Gemini CLI doesn’t support client metadata documents, so a server you build for it needs dynamic registration; more in building a remote MCP server.
Approvals in Gemini CLI
Every MCP tool asks before it runs unless you’ve allowed it. To let a server’s read-only tools run on their own and keep asking for the rest, add a policy file. Gemini CLI’s policy engine can match a tool’s readOnlyHint:
# ~/.gemini/policies/mailr.toml
# Mailr's read-only tools (prices, templates, mail status) run without asking.
# Everything else, sends included, still asks.
[[rule]]
mcpName = "mailr"
toolAnnotations = { readOnlyHint = true }
decision = "allow"
priority = 200With that rule, Gemini reads Mailr’s prices, templates and mail status on its own, and asks before it prepares a mailing, checks addresses or sends one.
Antigravity CLI: the same server in mcp_config.json
Antigravity CLI reads ~/.gemini/config/mcp_config.json, or .agents/mcp_config.json in a workspace, and calls the field serverUrl. Remote servers have to use Streamable HTTP; httpUrl and the older SSE transport aren’t supported.
{
"mcpServers": {
"mailr": {
"serverUrl": "https://mailr.dev/mcp"
}
}
}Antigravity signs in with OAuth on its own, trying a client metadata document first and dynamic registration second; Mailr supports both. The resource in the server’s metadata has to match the URL exactly, so use https://mailr.dev/mcp with no trailing slash. /mcp opens its server manager.
Example: a direct mail API from Gemini
- “What would 1,000 6x9 postcards cost?” Answered from your Mailr plan.
- “Prepare the thank-you card for the customers in this CSV.” A draft with the total and a proof link; nothing sent.
- “Send it as a test, then live.” Test mail is free and never prints. The live send asks, and Mailr sends only the exact draft and total you approved.
The same server works in Claude, ChatGPT, Claude Code, Codex, Cursor and VS Code.
Building on the Gemini API: call the direct mail API with a key
The Gemini API can also call a remote MCP server as a tool, with headers you set. Mailr’s server only accepts Sign in with Mailr, though, so for your own app on the Gemini API, give the model a function that calls Mailr’s REST API with a key from your environment; sending mail programmatically has the requests.
Gemini MCP questions
Does the Gemini app support MCP?
Yes. In the Gemini web app, go to Settings, Connected Apps and Add a custom app, then enter the server's URL. It's for personal Google Accounts in the US, 18 or over, in English, with History on, and once added it works in the mobile app too.
Where is the MCP config in Gemini CLI?
In ~/.gemini/settings.json for every project, or .gemini/settings.json in a project, under mcpServers. A project entry replaces a user entry with the same name.
Should I use url or httpUrl in Gemini CLI?
url with "type": "http". The docs still show httpUrl for Streamable HTTP, but the current code marks it deprecated, and gemini mcp add --transport http writes url and type.
Is Gemini CLI still free?
Not for personal accounts. On June 18, 2026, Google moved free and Google AI Pro and Ultra users to Antigravity CLI. Gemini CLI still runs with Gemini Code Assist Standard or Enterprise, an API key or Vertex AI.
Can Gemini send mail without asking?
Only if you let it. Gemini CLI asks before each MCP tool unless you allow it for the session, set trust: true or start in YOLO mode, and the Gemini app confirms write actions. Mailr's own send step also needs the exact total the person approved.