Coding agents hallucinate API signatures, recommend deprecated packages, and miss breaking changes because their training data is static. Adding live web search via MCP gives any coding agent access to current documentation, changelogs, and community discussions. The agent can verify its suggestions against real search results before writing code. This tutorial shows how to add a Scavio MCP search server to your coding agent, configure it to search before coding, and verify that generated code matches current API docs. You will have a coding agent that checks live docs before suggesting solutions.
Prerequisites
- A coding agent (Claude Code, Cursor, Codex, or similar)
- A Scavio API key from scavio.dev
- MCP support in your agent
Walkthrough
Step 1: Add the MCP search server
Configure the Scavio MCP server in your agent's configuration.
# Add to your agent's MCP config (.mcp.json or equivalent):
# {
# "mcpServers": {
# "scavio": {
# "url": "https://mcp.scavio.dev/mcp",
# "headers": {
# "x-api-key": "YOUR_SCAVIO_API_KEY"
# }
# }
# }
# }Step 2: Configure search-before-code behavior
Set up instructions that tell the agent to verify docs before writing code.
# Agent instructions (CLAUDE.md, .cursorrules, or system prompt):
# Before using any API or library:
# 1. Search for the current documentation
# 2. Verify the API signature matches the latest version
# 3. Check for breaking changes or deprecations
# 4. Use the verified API in your codeStep 3: Test with a documentation lookup
Verify the search integration works by looking up a current API.
import os, requests
API_KEY = os.environ["SCAVIO_API_KEY"]
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": "Next.js 15 server actions documentation 2026"})
for r in resp.json().get("organic_results", [])[:3]:
print(f"{r['title']}")
print(f" {r.get('link','')}")Step 4: Verify code accuracy
Have the agent write code and verify it matches current documentation.
# Example workflow:
# 1. Ask agent: "Write a Next.js server action for form submission"
# 2. Agent searches: "Next.js 15 server actions form handling"
# 3. Agent finds current docs and API signatures
# 4. Agent writes code that matches the latest API
# 5. No hallucinated imports or deprecated patterns
# Test the search that the agent would run:
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": "Next.js 15 server action form submission example"})
results = resp.json().get("organic_results", [])[:3]
for r in results:
print(f"{r['title']}: {r.get('link','')}")Python Example
import os, requests
API_KEY = os.environ["SCAVIO_API_KEY"]
def check_docs(query):
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": query})
return [{"title": r["title"], "url": r.get("link","")}
for r in resp.json().get("organic_results",[])[:3]]
for doc in check_docs("Next.js 15 server actions docs"):
print(doc["title"], doc["url"])JavaScript Example
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
async function checkDocs(query) {
const r = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST", headers: H,
body: JSON.stringify({platform: "google", query})
});
return (await r.json()).organic_results || [];
}
checkDocs("Next.js 15 server actions docs").then(rs =>
rs.slice(0,3).forEach(r => console.log(r.title, r.link))
);Expected Output
A coding agent configured with MCP web search that verifies documentation and API signatures against live search results before generating code.