Connect Gemini CLI to Your Studio
What it is
Section titled “What it is”Gemini CLI is Google’s Gemini tool that runs in your computer’s terminal. With the AI connector, it can look up your studio’s data (sales, customers, appointments, and finances) when you ask, using the permissions of the API key’s user. It only reads data; it doesn’t change anything in the system.
When to use it
Section titled “When to use it”- You already use Gemini in the terminal and want to ask about your studio’s activity without opening the system.
- You want to combine figures from the system with other tasks Gemini handles for you.
Before you start
Section titled “Before you start”Have the connector address ready. Copy it as described in the article Connect your AI,
and make sure you have an API key with “Allow use as AI connector” enabled. Gemini CLI must be installed on your computer.
You can also sign in to the system: without the key header, type /mcp auth heya in Gemini CLI and sign in on the
screen that opens.
Step by step
Section titled “Step by step”Step 1 — Add the connector
Section titled “Step 1 — Add the connector”In the terminal, run the command below, replacing the address with the one you copied using
Copy address and hk_... with your key:
gemini mcp add --transport http --header "Authorization: Bearer hk_..." heya https://seu-dominio/mcpTo use it in every folder on your computer, add -s user. If you prefer to edit the
configuration file (~/.gemini/settings.json), use this snippet:
{ "mcpServers": { "heya": { "httpUrl": "https://seu-dominio/mcp", "headers": { "Authorization": "Bearer hk_..." } } }}Use httpUrl, not url: in Gemini CLI, url is the old connection format and doesn’t work with the connector.
Step 2 — Check the connection
Section titled “Step 2 — Check the connection”Open Gemini CLI and type /mcp. The heya connector should appear as CONNECTED, with the tools
listar_areas, buscar_ferramentas, and executar_consulta.
Step 3 — Ask a question
Section titled “Step 3 — Ask a question”For example, ask: “What expenses are due this week at the studio?”
What happens next
Section titled “What happens next”- Gemini finds the right query for your question, runs it, and responds with figures from the system.
- The key appears in the API Key tab, with Last used updated.
- To revoke access, revoke the key in the API Key tab. Gemini will lose access within 30 seconds.
Common mistakes and questions
Section titled “Common mistakes and questions”Q: Does it work with Gemini in the browser (gemini.google.com)? A: Not yet. Gemini in the browser requires its own sign-in instead of an API key. Use Gemini CLI.
Q: /mcp shows DISCONNECTED. What should I do?
A: Make sure you used httpUrl (not url), the address ends in /mcp, and you pasted the entire key,
including Bearer followed by a space.
Q: Gemini says the key needs “Allow use as AI connector” enabled. Why? A: The key was created without that option. Edit the key in the API Key tab and select Allow use as AI connector.
Q: My Gemini CLI has become Antigravity CLI. Do these steps still apply?
A: Google has replaced Gemini CLI with Antigravity CLI for some accounts. Look for the option to
add an MCP server over HTTP with a header: the address and the Authorization: Bearer hk_...
header are the same.
Q: Can I save the key in a project file?
A: Avoid doing that. The project’s .gemini/settings.json file is usually added to version control, which would expose the key.
Use your user’s file instead (~/.gemini/settings.json).