Skip to content
AgentSearch

How to Add Web Search to an Agno Agent (Free Tier, No API Key)

Agno is a Python framework for building agents. You give an Agent a model and a list of tools, and it decides when to call them. What it doesn't ship with is a way to reach the live web. Ask it about a release from last week or a docs page that just changed and it can only guess. This guide adds Agno web search through Agno's built-in MCPTools toolkit and the AgentSearch MCP server.

Search works right away with no API key, no signup and no wallet. You get 25 free searches per IP in total, then pay per call. The 25 is a lifetime allowance and it never resets. When the agent needs a whole page, it gets clean markdown back, with a small free daily trial (5 extracts and 3 renders a day per IP) and pay-per-call pricing after that.

You'll build:

  1. An MCPTools toolkit that starts npx -y @agentsearchhq/agentsearch-mcp over stdio.
  2. A tool filter, so the model only sees search, extract and render.
  3. A full Agno Agent that searches and reads pages.
  4. A search-then-read script with no model in the loop.
  5. An optional paid setup with a hard budget.

What we actually ran (November 26, 2026): agno 3.2.1, mcp 2.3.0, fastmcp 4.2.6 and @agentsearchhq/agentsearch-mcp 1.8.7 on Python 3.13 and Node 24. We connected MCPTools, listed and filtered the tools, called the search tool directly, and ran the search-then-read script below exactly as printed (two real free searches and two free-trial extracts in total), and built the Agent with the filtered toolkit. We did not run a live model call. That step sends your prompt to the model provider, so it needs your own model key (for example OPENAI_API_KEY).

What the agent gets (and what it costs)

The AgentSearch MCP server exposes eight tools. For a research agent, three matter:

Tool What it does Cost
agentsearch_web_search Live web search, up to 5 results with title, URL and snippet 25 free searches per IP in total (never resets), then $0.003 per call over x402
agentsearch_extract Any public URL as clean markdown Free trial: 5 a day per IP, then $0.002 per call
agentsearch_render Reads JavaScript-heavy pages that plain extract can't Free trial: 3 a day per IP, then pay per call (see /render)

There's no account and no API key at any tier, and no minimum spend. Paid calls use x402: the API answers with a 402 and a price, the MCP server signs a small USDC payment on Base, and you're only charged when a usable answer comes back. More on the Search and Extract pages.

Step 1: Install Agno with MCP support

python -m venv .venv && source .venv/bin/activate
pip install "agno[mcp]==3.2.1" openai

The mcp extra matters. Agno 3.x builds MCP connections with fastmcp, and a plain pip install agno mcp leaves it out. You won't get an import error when the module loads. You get fastmcp not installed the first time MCPTools connects. The extra pulls in mcp (2.1 or later) and fastmcp 4.x. openai is only for the model in Step 4.

You also need Node.js 20 or newer, because the MCP server runs with npx.

Step 2: Connect the AgentSearch MCP server

MCPTools takes a command string, splits it, and starts the server as a stdio subprocess. Use it as an async context manager so the subprocess is cleaned up when you're done:

import asyncio
from agno.tools.mcp import MCPTools

async def main():
    async with MCPTools(
        command="npx -y @agentsearchhq/agentsearch-mcp",
        timeout_seconds=60,
    ) as web:
        print(sorted(web.functions))

asyncio.run(main())

When we ran this, it printed all eight tools:

['agentsearch_extract', 'agentsearch_news_search', 'agentsearch_render',
 'agentsearch_review_lookup', 'agentsearch_review_submit', 'agentsearch_screenshot',
 'agentsearch_search_and_read', 'agentsearch_web_search']

The transport defaults to stdio when you pass command and no url, so you don't need to set transport yourself. timeout_seconds is the client's read timeout. The default is 10 seconds, and a generous value gives npx room on the first run, when it downloads the package.

Step 3: Give the agent only the right tools

Eight tools is more than a research agent needs, and every tool description goes into the model's context. include_tools keeps only the ones you name:

WEB_TOOLS = ["agentsearch_web_search", "agentsearch_extract", "agentsearch_render"]

async with MCPTools(
    command="npx -y @agentsearchhq/agentsearch-mcp",
    include_tools=WEB_TOOLS,
    timeout_seconds=60,
) as web:
    print(sorted(web.functions))
    # ['agentsearch_extract', 'agentsearch_render', 'agentsearch_web_search']

There's also exclude_tools if you'd rather drop a few by name. The names have to match exactly. If you include a tool the server doesn't have, Agno logs an error and the toolkit comes up with no tools at all (see Troubleshooting).

Pass the connected toolkit straight into Agent(tools=[...]):

import asyncio
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools

WEB_TOOLS = ["agentsearch_web_search", "agentsearch_extract", "agentsearch_render"]

async def main():
    async with MCPTools(
        command="npx -y @agentsearchhq/agentsearch-mcp",
        include_tools=WEB_TOOLS,
        timeout_seconds=60,
    ) as web:
        agent = Agent(
            model=OpenAIChat(id="gpt-5.4-mini"),  # reads OPENAI_API_KEY
            tools=[web],
            instructions=[
                "Use agentsearch_web_search for anything recent or factual.",
                "If a snippet isn't enough, read the page with agentsearch_extract.",
                "Use agentsearch_render only when extract comes back empty.",
                "Cite the URLs you used.",
            ],
            markdown=True,
        )
        await agent.aprint_response(
            "What changed in the latest Agno release? Cite sources.",
            stream=True,
        )

asyncio.run(main())

Each MCP tool becomes an Agno Function with the server's own name, description and JSON schema, so the model sees the same arguments the server documents (query and max_results for search, url, formats and max_chars for extract). Keep the Agent inside the async with block: once the block exits, the MCP subprocess is gone.

We built this exact agent and confirmed it holds the three filtered tools. The aprint_response call is the part we didn't run. It needs your model key, and any model Agno supports will work in place of OpenAIChat.

Search, then read: no model in the loop

Sometimes you don't want a model deciding anything. You just want the top hit for a query, as markdown. Every function in the toolkit has an async entrypoint you can call directly. It returns a ToolResult whose content is the tool's JSON text:

import asyncio, json
from agno.tools.mcp import MCPTools

async def search_then_read(query: str) -> str:
    async with MCPTools(
        command="npx -y @agentsearchhq/agentsearch-mcp",
        include_tools=["agentsearch_web_search", "agentsearch_extract"],
        timeout_seconds=60,
    ) as web:
        hits = await web.functions["agentsearch_web_search"].entrypoint(
            query=query, max_results=3
        )
        results = json.loads(hits.content)["results"]
        top_url = results[0]["url"]

        page = await web.functions["agentsearch_extract"].entrypoint(
            url=top_url, max_chars=4000
        )
        return json.loads(page.content)["markdown"]

print(asyncio.run(search_then_read("agno python agent framework MCPTools"))[:500])

This is the part we ran end to end. The search for "agno python agent framework MCPTools" came back with three results. The top one was https://github.com/agno-agi/agno, and the extract call returned that page's title and markdown. Each result also has title, content, domain and published_date, so you can pick a URL by domain instead of the first.

You only pay to read the page you picked. If you'd rather get hits and page text in a single call, the server also has agentsearch_search_and_read ($0.005 per paid call). Add it to include_tools if you want it.

When to use Render for JavaScript pages

agentsearch_extract fetches the page HTML and turns it into markdown. That covers docs, blogs, READMEs and most articles. Single-page apps, dashboards and some pricing pages ship an empty shell and fill it in with JavaScript, so extract comes back with little or no text.

That's what agentsearch_render is for. It loads the page in a real browser, waits for the content, and returns the rendered markdown. It's slower, so the Step 4 instructions only use it when extract comes back empty. You get 3 free renders a day per IP without a wallet. After that it's pay per call. See Render for details, and our search-then-read guide for LangChain for a longer look at this fallback.

Going past the free tier: pay per call with x402

When the 25 free searches are used up, add a wallet. Use a new, dedicated wallet holding a few dollars of USDC on Base, never your main one. The MCP server reads these environment variables:

Variable What it does
AGENTSEARCH_WALLET_PRIVATE_KEY Key of the dedicated wallet. Turns on paid extract and render.
AGENTSEARCH_MODE=paid Also makes search paid ($0.003 per call). A wallet key alone keeps search on the free tier.
AGENTSEARCH_MAX_TOTAL_ATOMIC Spend cap per server session in USDC atomic units (default 1000000, which is $1.00).
AGENTSEARCH_MAX_PER_CALL_ATOMIC Optional lower cap per call.

One Agno detail: MCPTools does not forward your whole shell environment to the server. It starts from a minimal set (HOME, PATH, USER and a couple of others) and merges in whatever you pass as env. So pass the wallet variables explicitly:

import os
from agno.tools.mcp import MCPTools

web = MCPTools(
    command="npx -y @agentsearchhq/agentsearch-mcp",
    include_tools=["agentsearch_web_search", "agentsearch_extract", "agentsearch_render"],
    env={
        "AGENTSEARCH_WALLET_PRIVATE_KEY": os.environ["AGENTSEARCH_WALLET_PRIVATE_KEY"],
        "AGENTSEARCH_MODE": "paid",
        "AGENTSEARCH_MAX_TOTAL_ATOMIC": "200000",  # $0.20 hard cap per session
    },
    timeout_seconds=60,
)

Live prices on November 26, 2026: search $0.003, news $0.003, extract $0.002, search-and-read $0.005, all paid in USDC over x402 on Base. No signup, no API key, no minimums. Calls are only charged when a usable answer comes back. We checked the variable names against the package README. We didn't run a paid call for this post.

Troubleshooting

fastmcp not installed or an agent with no tools. Install the extra: pip install "agno[mcp]". connect() logs connection errors rather than raising them, so a missing dependency can look like a silent agent. Check the logs.

Included tool(s) not present in the toolkit. A name in include_tools doesn't match the server. Run Step 2 to print the exact names. They all start with agentsearch_.

Timeouts on the first run. npx downloads the package the first time. Raise timeout_seconds, or install it globally (npm i -g @agentsearchhq/agentsearch-mcp) and use command="agentsearch-mcp".

npx: not found. Install Node.js 20+ and make sure it's on the PATH your Python process sees.

The agent ignores the tools. Make it explicit in instructions (when to search, when to extract), and use a model that supports tool calling.

HTTP 429 from search, extract or render. You've used the free allowance: the 25 lifetime searches for your IP, or the daily extract (5) and render (3) trial. Add a wallet as shown above to keep going.

Wallet set but search still free. That's expected. Search only switches to paid with AGENTSEARCH_MODE=paid. Also check you passed the variables through env=, because Agno doesn't forward them automatically.

FAQ

Does Agno web search need an API key?

Not with this setup. The AgentSearch MCP server gives you 25 free searches per IP in total with no key, account or wallet, then you pay per call over x402.

Can I use another model?

Yes. The toolkit doesn't care which model drives the agent. Swap OpenAIChat for any Agno model class that supports tool calling, and install that provider's package.

Get started

pip install "agno[mcp]==3.2.1" openai

Then point MCPTools at npx -y @agentsearchhq/agentsearch-mcp, filter to the three web tools, and hand it to your Agent. You get 25 free searches per IP in total with no key, then $0.003 per paid search.

More from the blog

Service pages: Web Search API · Web Extract API · Web Render API