Coding agents like Claude Code, Cursor, and OpenCode are more effective when they can search the web for current documentation, API references, and error solutions. Without web search, they rely on training data that may be outdated for fast-moving libraries. This tutorial adds Scavio's search via MCP for IDE-based agents and via REST API for custom agents.
Prerequisites
- A coding agent (Claude Code, Cursor, or custom)
- A Scavio API key from scavio.dev
Walkthrough
Step 1: Configure MCP for Claude Code
Add Scavio's MCP server to Claude Code's project config.
// .claude/mcp.json (project-level config):
{
"mcpServers": {
"scavio": {
"url": "https://mcp.scavio.dev/mcp",
"headers": {
"x-api-key": "your_scavio_api_key"
}
}
}
}Step 2: Configure MCP for Cursor
Add Scavio to Cursor's MCP configuration.
// .cursor/mcp.json:
{
"mcpServers": {
"scavio": {
"url": "https://mcp.scavio.dev/mcp",
"headers": {
"x-api-key": "your_scavio_api_key"
}
}
}
}Step 3: For custom coding agents, add a search tool
If you are building a custom coding agent, add a search function as a tool.
import requests, os
def web_search(query: str) -> str:
"""Search the web for documentation, API references, and error solutions."""
resp = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': os.environ['SCAVIO_API_KEY']},
json={'platform': 'google', 'query': query}, timeout=10)
results = resp.json().get('organic', [])[:5]
return '\n'.join(f'{r["title"]}: {r["snippet"]} ({r["link"]})' for r in results)Step 4: Test with common coding queries
Verify the search works for typical coding agent queries.
# Test queries:
print(web_search('Next.js 15 app router migration guide'))
print(web_search('Python requests timeout error handling'))
print(web_search('React useEffect cleanup function'))Python Example
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
def search_docs(query):
data = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
json={'platform': 'google', 'query': query}, timeout=10).json()
return [(r['title'], r['link']) for r in data.get('organic', [])[:5]]JavaScript Example
async function searchDocs(query) {
const data = 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({platform: 'google', query})
}).then(r => r.json());
return (data.organic || []).slice(0, 5).map(r => ({title: r.title, url: r.link}));
}Expected Output
A coding agent with live web search for documentation, API references, and error solutions via MCP or REST API.