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.
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/).
Keep your token private. Your Daasity MCP token is specific to your workspace and grants read access to your data. Treat the token like a password. Anyone with the token can query your data until it expires or you revoke it. Never paste it into a shared document, a ticket, or a public repository.
Connect Gemini CLI to Daasity
Step 1 — Generate your Daasity MCP token
In Daasity, open the AI Analyst tab.
Select Connect Your AI.
Open the Manual token tab.
Choose Gemini CLI from the tool list, then select Generate Token.
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.
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:
Fresh installs only. If you have never configured Gemini CLI before and have no existing settings to preserve, you can write the whole file in one command. This overwrites ~/.gemini/settings.json and will remove any other MCP servers or preferences already configured there.
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))'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_viewsandquery. If you see aNot Acceptableerror, yourAcceptheader is malformed. Check it in both the curl command and~/.gemini/settings.json.
Step 5 — Launch Gemini CLI
Start the CLI from your normal terminal shell:
geminiIf 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.
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 revenueConnection checkpoint: If Gemini returns semantic-view names from your own workspace, the MCP connection is working. Because answers come from governed semantic views, they apply your workspace's valid-order rules, revenue definitions, and reporting timezone, so they reconcile to your Daasity dashboards.
Troubleshooting
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
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?