Tutorial

How to Add Search to Gemini CLI

Give Google's Gemini CLI real-time web, shopping, and video search by wiring in the Scavio MCP server. Step-by-step guide with config examples.

Google's Gemini CLI is a terminal-first agent that supports Model Context Protocol servers, which means you can extend it with third-party tools like Scavio for real-time search. Out of the box, Gemini CLI grounding lags behind a live Google SERP. Wiring in Scavio's MCP server gives you five platforms of live data in one config step.

Prerequisites

  • Node.js 20+ installed
  • Gemini CLI installed via npm install -g @google/gemini-cli
  • A Scavio API key from scavio.dev
  • Basic familiarity with JSON config files

Walkthrough

Step 1: Install Gemini CLI

Install Google's terminal agent globally.

Bash
npm install -g @google/gemini-cli

Step 2: Export your Scavio API key

Set the key as an environment variable so the MCP server can read it.

Bash
export SCAVIO_API_KEY="sk_live_your_key_here"

Step 3: Add Scavio to the Gemini config

Open ~/.gemini/config.json and add the Scavio MCP server entry.

JSON
{
  "mcpServers": {
    "scavio": {
      "command": "npx",
      "args": ["-y", "@scavio/mcp"],
      "env": { "SCAVIO_API_KEY": "${SCAVIO_API_KEY}" }
    }
  }
}

Step 4: Restart Gemini CLI

Exit and relaunch Gemini CLI to load the new MCP server.

Bash
gemini

Step 5: Ask a live-data question

Prompt Gemini with something that requires fresh web data, and watch it call Scavio.

Bash
> what is the top Reddit post in r/ClaudeCode this week?

Python Example

Python
# Gemini CLI is configured via JSON, not Python. Scavio can also be called directly:
import os, requests
r = requests.post('https://api.scavio.dev/api/v1/search',
    headers={'x-api-key': os.environ['SCAVIO_API_KEY']},
    json={'query': 'top reddit post r/ClaudeCode this week'})
print(r.json()['organic_results'][0])

JavaScript Example

JavaScript
const res = await fetch('https://api.scavio.dev/api/v1/search', {
  method: 'POST',
  headers: { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ query: 'top reddit post r/ClaudeCode this week' })
});
console.log((await res.json()).organic_results[0]);

Expected Output

JSON
> Gemini calls scavio.search_google with the query and returns structured results with titles, URLs, and snippets. Gemini synthesizes the top results into a direct answer with citations.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Node.js 20+ installed. Gemini CLI installed via npm install -g @google/gemini-cli. A Scavio API key from scavio.dev. Basic familiarity with JSON config files. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Give Google's Gemini CLI real-time web, shopping, and video search by wiring in the Scavio MCP server. Step-by-step guide with config examples.