For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connect Gemini CLI

Connect Gemini CLI to Daasity via MCP to query governed semantic views from your terminal. Setup, verification, and troubleshooting steps.

Connect Gemini CLI to your governed Daasity data using the Model Context Protocol (MCP). Once connected, you can discover semantic views and query your workspace metrics in natural language directly from your terminal, without writing SQL or leaving your shell.

Do this in your terminal, not the Connections screen. Gemini CLI is configured through a local settings file on your machine. The Connections screen in Daasity is where you generate your token; everything after that happens in Terminal.

Prerequisites

  • AI Analyst enabled on your Daasity workspace.

  • Gemini CLI installed on your machine, or Node.js and npm available so you can install it.

  • A Google AI Studio API key configured in Gemini CLI, or a linked Google Cloud billing account.

  • Permission to edit files in your home directory (~/.gemini/).

Connect Gemini CLI to Daasity

1

Step 1 — Generate your Daasity MCP token

  1. In Daasity, open the AI Analyst tab.

  2. Select Connect Your AI.

  3. Open the Manual token tab.

  4. Choose Gemini CLI from the tool list, then select Generate Token.

  5. Copy both the MCP server URL and the token. You'll need both in Step 3.

Your token looks like dsy_mcp_pk_.... Your MCP server URL is specific to your environment, so always use the one shown on your own Daasity screen rather than one copied from documentation or from a colleague.

Don't reuse a URL from documentation. MCP URLs are environment-specific. Always copy yours from your own Daasity screen.

2

Step 2 — Install Gemini CLI

If you don't already have Gemini CLI on your machine, install it:

npm install -g @google/gemini-cli

Confirm the install:

gemini --version
3

Step 3 — Add Daasity as an MCP server

Gemini CLI reads its MCP configuration from ~/.gemini/settings.json. Open that file in your editor and add a daasity entry under mcpServers, replacing both placeholders with the values you copied in Step 1:

{
  "mcpServers": {
    "daasity": {
      "url": "<your Daasity MCP URL>",
      "type": "http",
      "headers": {
        "Authorization": "Bearer <your Daasity MCP token>",
        "Accept": "application/json, text/event-stream"
      }
    }
  }
}

If the file already contains other servers or settings, add the daasity block alongside them rather than replacing the file. If ~/.gemini/settings.json does not exist yet, create it with the contents above.

Each field is doing specific work, and the connection will fail without all three:

python3 -c 'import json, os; p=os.path.expanduser("~/.gemini/settings.json"); d={"security":{"auth":{"selectedType":"gemini-api-key"}},"mcpServers":{"daasity":{"url":"<your Daasity MCP URL>","type":"http","headers":{"Authorization":"Bearer <your Daasity MCP token>","Accept":"application/json, text/event-stream"}}}}; open(p,"w").write(json.dumps(d,indent=2))'

4

Step 4 — Verify the connection

Before launching the CLI, confirm that Daasity accepts your credentials and headers. Run this directly in your terminal, substituting your own URL and token:

curl -X POST <your Daasity MCP URL> \
  -H "Authorization: Bearer <your Daasity MCP token>" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'

Connection checkpoint: You should receive a JSON payload listing available tools, including find_views and query. If you see a Not Acceptable error, your Accept header is malformed. Check it in both the curl command and ~/.gemini/settings.json.

5

Step 5 — Launch Gemini CLI

Start the CLI from your normal terminal shell:

gemini

If you're on the Google AI Studio free tier, pin the session to a high-quota model so background agents don't exhaust your rate limit mid-session:

gemini --model <a high-quota model, for example gemini-3.1-flash-lite>

Users with a paid Google Cloud billing account linked to AI Studio can run gemini on production Pro models without quota concerns.

6

Step 6 — Run your first query

At the interactive > prompt, ask Daasity to describe your catalog. Gemini CLI invokes the find_views tool, compiles the correct Snowflake SQL against your governed semantic views, and returns your workspace data.

> Use Daasity to list my available semantic views and metrics
> What are my top 5 selling products according to Daasity?
> Query Daasity for my order and order line revenue

Troubleshooting

Symptom
Solution

HTTP 406 or JSON-RPC -32600 on connect

The Accept header is missing or altered. It must read exactly application/json, text/event-stream in ~/.gemini/settings.json.

Not Acceptable from the curl test in Step 4

Same cause as above. Fix the header in the curl command first, then in your settings file.

The CLI hangs, times out, then falls back to Google Web Search

The connection is attempting SSE transport. Confirm "type": "http" is set on the daasity server and that you are not passing --transport sse.

Free-tier quota exhausted within minutes

Shell commands were typed at the > prompt. The CLI reads them as coding questions and spawns background subagents. Exit the prompt and run all flags from your primary terminal shell.

401 or 403 from the curl test

The token is expired or revoked. Return to AI Analyst → Connect Your AI → Manual token and generate a new one.

Connection succeeds but no semantic views are returned

AI Analyst may not be fully provisioned on your workspace yet. Semantic views are generated when the connection is first established; allow time for that to complete, then retry.

Readiness checklist

Check
Confirmed when

Token generated

You copied both the MCP server URL and token from Connect Your AI.

Server configured

~/.gemini/settings.json contains a daasity entry with type, Authorization, and Accept all set.

Credentials accepted

The Step 4 curl test returns a tool list containing find_views and query.

CLI connected

Gemini CLI launches without transport warnings.

Data flowing

A prompt at > returns semantic-view names from your own workspace.

What's next

  • Connections are read-only, tenant-isolated, quota-capped, and revocable at any time from Connect Your AI.

  • A token expires after 30 days without use. If queries start failing with a 401, generate a new token.

  • To connect a different client, see the other guides under Connect Your AI / MCP.

Last updated

Was this helpful?