ScavioScavio
ProductPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Add Web Search to opencode CLI
Tutorial

How to Add Web Search to opencode CLI

Give opencode CLI live multi-surface web search in one config line using the Scavio MCP endpoint.

Get Free API KeyAPI Docs

opencode CLI and similar terminal coding agents discover MCP servers from config. Adding Scavio gives the agent live Google SERP, Reddit, YouTube, and doc search in one tool class. This tutorial wires it up in under 10 minutes.

Prerequisites

  • opencode CLI installed
  • A Scavio API key
  • Node.js 20+ (for mcp-remote bridge)

Walkthrough

Step 1: Open the opencode MCP config

opencode reads MCP servers from ~/.opencode/mcp.json.

Bash
mkdir -p ~/.opencode && touch ~/.opencode/mcp.json

Step 2: Register the Scavio MCP

Use mcp-remote to bridge HTTP SSE into a CLI process.

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

Step 3: Export the API key

Load from your shell rc so the CLI inherits it.

Bash
echo 'export SCAVIO_API_KEY=sk_live_...' >> ~/.zshrc && source ~/.zshrc

Step 4: Verify the tools are visible

Start opencode and list tools.

Bash
opencode
> /tools
# Expect scavio_search, scavio_reddit, scavio_youtube

Step 5: Test a live query

Ask for something that requires fresh data.

Bash
> what does the latest r/opencodeCLI thread on web search say?

Python Example

Python
# opencode CLI is a CLI-first tool; no Python setup needed.
# To test the MCP endpoint directly:
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
r = requests.post('https://api.scavio.dev/api/v1/search',
    headers={'x-api-key': API_KEY},
    json={'query': 'opencode CLI web search'})
print(r.json().get('organic_results', [])[:3])

JavaScript Example

JavaScript
// opencode discovers tools from mcp.json; no JS code required.
// Direct API call for parity:
const API_KEY = process.env.SCAVIO_API_KEY;
const r = await fetch('https://api.scavio.dev/api/v1/search', {
  method: 'POST',
  headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ query: 'opencode CLI web search' })
});
console.log(((await r.json()).organic_results || []).slice(0, 3));

Expected Output

JSON
opencode CLI exposes scavio_* tools in /tools. The agent calls them automatically when the user question needs live data.

Related Tutorials

  • How to Add Web Search to Claude Code via Zaiglm Config
  • How to Give Hermes Agent Web Search Access
  • How to Connect MCP to Your Enterprise Knowledge Base

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.

opencode CLI installed. A Scavio API key. Node.js 20+ (for mcp-remote bridge). A Scavio API key gives you 50 free credits on signup.

Yes. The free tier includes 50 credits on signup, 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.

Related Resources

Use Case

MCP Search Gateway for Multi-Agent Systems

Read more
Best Of

Best Web Search API for opencode CLI in 2026

Read more
Use Case

MCP Custom Search Server

Read more
Best Of

Best MCP Search Tools for IDE Integration in 2026

Read more
Comparison

Scavio MCP vs Built-in MCP web_search

Read more
Solution

Give AI Agents Multi-Source Search via MCP

Read more

Start Building

Give opencode CLI live multi-surface web search in one config line using the Scavio MCP endpoint.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy