@swerverx402/websearch-mcp
v0.3.1
Published
MCP server that lets an agent search and scrape the web and pay for it itself — per request in USDC on Base via x402. No API keys.
Maintainers
Readme
@swerverx402/websearch-mcp
An MCP server that lets your agent search and scrape the web — and pay for it itself. Each call is a per-request micropayment in USDC on Base via x402. Fund a small wallet, and your agent pays as it goes. No API keys, no accounts, no dashboards.
search "anthropic claude" → 402 Payment Required → sign $0.01 USDC → results + on-chain receiptInstall
The server carries a wallet and pays automatically. Point it at a funded Base wallet via SWERVER_WALLET_KEY (see Wallet setup).
Claude Code
claude mcp add websearch --env SWERVER_WALLET_KEY=0xYOUR_KEY -- npx -y @swerverx402/websearch-mcpClaude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"websearch": {
"command": "npx",
"args": ["-y", "@swerverx402/websearch-mcp"],
"env": { "SWERVER_WALLET_KEY": "0xYOUR_KEY" }
}
}
}Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"websearch": {
"command": "npx",
"args": ["-y", "@swerverx402/websearch-mcp"],
"env": { "SWERVER_WALLET_KEY": "0xYOUR_KEY" }
}
}
}OpenClaw
openclaw mcp add websearch --command npx --arg -y --arg @swerverx402/websearch-mcp --env SWERVER_WALLET_KEY=0xYOUR_KEYWallet setup
The server signs payments with a Base wallet you provide. Use a dedicated, low-balance wallet — never your main one.
- Create a fresh EVM wallet (with
viem, MetaMask, or any tool). - Fund it with a small amount of USDC on Base — a few dollars covers hundreds of calls at ~$0.01 each.
- Put its private key in
SWERVER_WALLET_KEY.
A per-request spend cap (SWERVER_MAX_SPEND, default $0.10) protects you from an over-priced route. Combined with a small wallet balance, the worst case is bounded.
Without SWERVER_WALLET_KEY, the server still runs — discovery endpoints work and paid tools return a clear "payment required" message instead of results.
Configuration
| Env var | Default | Description |
|---|---|---|
| SWERVER_WALLET_KEY | — | Private key of a funded Base wallet. Without it, paid routes return instructions instead of results. |
| SWERVER_MAX_SPEND | 0.10 | Max USDC to spend per request (a safety ceiling). |
| SWERVER_NETWORK | eip155:8453 | CAIP-2 network the wallet signs for (Base mainnet). |
| SWERVER_WEBSEARCH_URL | https://websearch--gw.swerver.net | Gateway URL. |
Tools
search
Search the web and return results with titles, URLs, and snippets.
query (required) Search query
count Number of results (1-20, default: 10)
timeout Page load timeout in seconds (default: 30)scrape
Fetch a single web page with a headless browser that renders JavaScript.
url (required) URL to scrape
format markdown | html | text | links (default: markdown)
selector CSS selector to wait for before extracting (for SPAs)
wait_until load | domcontentloaded | networkidle0
wait Extra seconds to wait after page event (0-30)
evaluate JavaScript to run on the page (returns eval result)
stealth Anti-bot fingerprint randomization (default: false)
user_agent Custom User-Agent string
max_length Truncate content to N characters (token budget)
timeout Page load timeout in seconds (default: 30)batch_scrape
Fetch up to 20 URLs in parallel. Individual failures don't affect other results.
urls (required) Array of URLs (max 20)
format markdown | html | text | links (default: markdown)
evaluate JavaScript to run on each page
stealth Anti-bot fingerprint randomization (default: false)
user_agent Custom User-Agent string
max_length Truncate content per result
timeout Page load timeout in seconds (default: 30)When the gateway returns a settlement receipt, it's surfaced as a _payment field alongside the result, so the agent — and you — can see proof of payment.
How it works
Agent → MCP server (your wallet) → websearch--gw.swerver.net → headless browser
│
x402 payment (USDC on Base)The gateway returns 402 Payment Required with the price. This server — built on the x402 v2 client stack (@x402/fetch + @x402/evm) — signs a USDC payment with your wallet, retries, and returns the result (with the settlement receipt as _payment when the gateway provides one). No API key is ever exchanged.
Discovery endpoints are free and unauthenticated:
License
MIT
