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.
mkdir -p ~/.opencode && touch ~/.opencode/mcp.jsonStep 2: Register the Scavio MCP
Use mcp-remote to bridge HTTP SSE into a CLI process.
{
"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.
echo 'export SCAVIO_API_KEY=sk_live_...' >> ~/.zshrc && source ~/.zshrcStep 4: Verify the tools are visible
Start opencode and list tools.
opencode
> /tools
# Expect scavio_search, scavio_reddit, scavio_youtubeStep 5: Test a live query
Ask for something that requires fresh data.
> what does the latest r/opencodeCLI thread on web search say?Python Example
# 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
// 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
opencode CLI exposes scavio_* tools in /tools. The agent calls them automatically when the user question needs live data.