devto 2026-10-03 원문 보기 ↗
Language models stop learning on their training cutoff date. An agent that has to answer "what changed in this library last week?" or "what does this vendor charge today?" needs a tool that can search the live web and read the pages it finds. The Model Context Protocol (MCP) is the standard way to give it one.
This guide connects an MCP client (Claude Desktop, Cursor, Claude Code, or anything else that speaks MCP) to AgentSearch web search and URL extraction. It takes about five minutes. There's no account to create and no API key to manage: each call is paid in USDC through the Pocket Network Agentic Portal.
AgentSearch runs two services on Pocket Network that matter for this guide:
| Service | Service ID | What it returns | Price per call |
|---|---|---|---|
| Web Search | agentsearch-web-search-v1 |
Structured JSON for up to 5 results: title, URL, snippet, score, domain and date for each one | $0.005 |
| Web Extract | agentsearch-web-extract-v1 |
Clean markdown or text of one URL, plus its title, links and fetch metadata | $0.005 |
Both prices come from the service pages on the Pocket Agentic Portal (search, extract). You pay in USDC over x402 on Base, or over MPP on Tempo.
You'll install one MCP server, @pocket-network/agentic-portal-mcp, Pocket's local MCP server for the Agentic Portal. It's listed in the official MCP Registry as network.pocket/agentic-portal-mcp. Pocket's full instructions are at agent.pocket.network/agent-integration.
MCP clients can't pay for tools on their own yet. So the portal's MCP server runs on your machine, keeps the paying wallet's key there, and signs an x402 payment only when a call fits inside the spending limits you set. The portal never holds your key.
npx is available.Open your client's MCP config file:
claude_desktop_config.json
.cursor/mcp.json
.mcp.json
Then add the server, which runs npx -y @pocket-network/agentic-portal-mcp:
{
"mcpServers": {
"pocket-network": {
"command": "npx",
"args": ["-y", "@pocket-network/agentic-portal-mcp"],
"env": {
"POCKET_PRIVATE_KEY": "0x…",
"POCKET_MAX_TOTAL_ATOMIC": "1000000"
}
}
}
}
Put settings in the env block. Desktop clients start MCP servers without your shell's environment, so a variable you export in a terminal won't reach the server.
The server checks every limit before it signs, and signs nothing unless all of them allow the payment. USDC has 6 decimals, so amounts are in atomic units and 1000000 = $1.00.
| Variable | What it does |
|---|---|
POCKET_MAX_TOTAL_ATOMIC |
The most the server will sign for in total while it runs. Required to pay. 1000000 ($1.00) covers 200 AgentSearch calls at $0.005 each. |
POCKET_MAX_PER_CALL_ATOMIC |
The most it will pay for any one call. Set it to 5000 ($0.005) so the agent can only buy calls priced at $0.005 or less. |
POCKET_NETWORK |
The only network it signs on. The default is Base, eip155:8453. |
POCKET_QUOTE_ONLY |
Set to true and the server returns the seller's terms but never pays. Good for a dry run. |
Pocket also warns that you shouldn't count on the client asking before it pays: in their testing, one client's model asked first and another paid without asking. These limits are what protect you either way.
A cautious first config:
{
"mcpServers": {
"pocket-network": {
"command": "npx",
"args": ["-y", "@pocket-network/agentic-portal-mcp"],
"env": {
"POCKET_PRIVATE_KEY": "0x…",
"POCKET_MAX_TOTAL_ATOMIC": "250000",
"POCKET_MAX_PER_CALL_ATOMIC": "5000",
"POCKET_QUOTE_ONLY": "true"
}
}
}
}
Restart the client after you save. Remove POCKET_QUOTE_ONLY when you're ready to make real calls.
The server exposes three tools:
| Tool | What it does | Cost |
|---|---|---|
search_services |
Searches the portal catalogue by keyword and category | Free |
describe_service |
Shows one service's price, operations, schemas and a real captured example | Free |
call_service |
Calls a service and pays its price | The service's price |
If you leave out the private key, only the free tools work, which is a safe way to look around. Try a prompt like this:
Use search_services to find "agentsearch". Then describe_service for agentsearch-web-search-v1 and tell me its price and request schema.
You should see $0.005 and a POST /v1/search operation that takes a query and an optional max_results (up to 5).
Now ask for something that needs fresh information:
Use call_service on agentsearch-web-search-v1 to search for "x402 payment protocol v2 headers", then summarize the top results with their URLs.
Under the hood, the agent sends the same request you could send yourself:
curl -X POST https://agent.pocket.network/v1/agentsearch-web-search-v1/v1/search \
-H 'content-type: application/json' \
-d '{"query":"x402 payment protocol v2 headers","max_results":5}'
# The first response is 402 Payment Required with the terms.
# The MCP server signs them and retries the same request with the payment attached.
The result comes back in the portal's envelope. Fields set by the portal sit under portal, and the supplier's untouched response sits under data:
{
"portal": {
"provenance": "third-party-supplier",
"serviceId": "agentsearch-web-search-v1",
"schemaCheck": "unchecked"
},
"data": {
"query": "x402 payment protocol v2 headers",
"result_count": 5,
"results": [
{ "title": "…", "url": "https://…", "content": "…", "score": 0.91, "domain": "…" }
]
}
}
The data above is trimmed. The full field list is in the search OpenAPI spec.
When the agent needs a whole document, such as a changelog, an API reference page or a pricing table, use extract:
Use call_service on agentsearch-web-extract-v1 with url "https://example.com" and return the markdown.
{ "url": "https://example.com", "formats": ["markdown"], "max_chars": 20000 }
You get title, markdown, links and meta back (status_code, content_type, fetched_at, chars, truncated). Turn any URL into clean markdown for RAG goes deeper on extraction.
Search results and extracted pages are third-party content, and some pages are written to manipulate agents. Pocket's integration guide recommends these habits:
data in a clearly marked data position, such as a tool-result block. Never paste it into a system prompt.portal.schemaCheck. Only passed means a schema check actually ran.POCKET_PRIVATE_KEY is missing, or it's set in your shell instead of the config's env block.POCKET_QUOTE_ONLY is still true.results array with an error object: the search hit its deadline or an upstream error. Check error.retryable and retry with backoff.UNSUPPORTED_CONTENT: the URL is a PDF or an image, not HTML or text.agentsearch-web-render-v1, live on Pocket MainNet). It isn't on the Agentic Portal yet.Do I need an AgentSearch account or API key?
No. You pay per call in USDC through the Agentic Portal, over x402 (Base) or MPP (Tempo).
Which MCP clients work?
Any client that can launch a local stdio MCP server, including Claude Desktop, Cursor and Claude Code.
Who runs the infrastructure?
AgentSearch is served by decentralized Pocket Network suppliers.
Service pages: Web Search API · Web Extract API · Web Render API
Originally published at agentsearchhq.com.