Add live web search to an Agno agent
Agno supports MCP natively — load Superhighway's five search tools via MCPTools in a few lines, or define a typed Toolkit that calls the REST API with a free key.
Two paths
| Path | Best for | What you need |
|---|---|---|
| MCPTools | All five tools, fully autonomous — agent pays per call | A funded Base wallet + npx |
| Custom Toolkit + API key | Typed methods, controlled spend | A free API key from /pricing |
Path 1: MCP server (recommended for autonomous agents)
pip install agno httpx
import asyncio
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools
async def main():
async with MCPTools(
"npx -y superhighway-mcp",
env={
"AGENT_PRIVATE_KEY": "0xYOUR_FUNDED_BASE_WALLET_KEY",
"X402_NETWORK": "base",
},
) as mcp_tools:
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[mcp_tools],
markdown=True,
)
agent.print_response(
"What are the latest developments in AI agent frameworks?",
stream=True,
)
asyncio.run(main())
The agent gets all five tools — web_search, news_search, image_search, scrape, research — and each call settles a $0.001–$0.005 USDC payment automatically. See wallet setup or the x402 flow.
Path 2: Custom Toolkit with an API key
Get a free API key (1,000 calls/month) and define a typed toolkit:
import os
import httpx
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools import Toolkit
class SuperhighwayTools(Toolkit):
def __init__(self, api_key: str):
super().__init__(name="superhighway")
self.api_key = api_key
self.register(self.web_search)
self.register(self.news_search)
self.register(self.research)
def web_search(self, query: str, limit: int = 5) -> str:
"""Search the live web for current events, facts, and research."""
r = httpx.get(
"https://superhighway.walls.sh/search",
params={"q": query, "limit": limit},
headers={"Authorization": f"Bearer {self.api_key}"},
timeout=10,
)
r.raise_for_status()
results = r.json()["results"]
return "\n\n".join(
f"**{x['title']}**\n{x['url']}\n{x['description']}" for x in results
)
def news_search(self, query: str) -> str:
"""Search recent news articles with published dates."""
r = httpx.get(
"https://superhighway.walls.sh/news",
params={"q": query},
headers={"Authorization": f"Bearer {self.api_key}"},
timeout=10,
)
r.raise_for_status()
results = r.json()["results"]
return "\n\n".join(
f"**{x['title']}** ({x.get('publishedDate', '')})\n{x['url']}\n{x['description']}"
for x in results
)
def research(self, query: str) -> str:
"""Search + read the top matching pages for a query — returns full content."""
r = httpx.get(
"https://superhighway.walls.sh/research",
params={"q": query, "pages": 2},
headers={"Authorization": f"Bearer {self.api_key}"},
timeout=30,
)
r.raise_for_status()
data = r.json()
return "\n\n---\n\n".join(
f"## {p['title']}\n{p['url']}\n\n{p['markdown'][:3000]}"
for p in data["pages"] if not p.get("error")
)
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[SuperhighwayTools(api_key=os.environ["SUPERHIGHWAY_API_KEY"])],
show_tool_calls=True,
markdown=True,
)
agent.print_response("Summarize the top AI news from the last 48 hours.", stream=True)
Register only the tools your agent needs — web_search and news_search for real-time Q&A, research for deep multi-page synthesis.
Which tools are available
| Tool / endpoint | What it returns | Price |
|---|---|---|
web_search / /search | Ranked web results — title, URL, description | $0.001 |
news_search / /news | Recent news with published dates | $0.001 |
image_search / /images | Image URLs, thumbnails, source pages | $0.001 |
scrape / /scrape | Any URL → clean markdown text | $0.002 |
research / /research | Search + read top pages in one call | $0.005 |
Full API reference: /openapi.json. Get a free API key or learn the x402 wallet flow.