Skip to main content
Glama
jakemaxsigal-creator

Base Intel Search

README.md
# Base Intel Search — MCP server 🔎⚡

**Pay-per-call web search for AI agents, settled in USDC on Base via [x402](https://x402.org).**

Add one MCP server and your agent gets a `web_search` tool. Each query is paid
automatically from your wallet (~**$0.015 USDC** per call) — **no API key, no
account, no subscription.** Powered by the [Base Intel](https://base-intel-api.jakemaxsigal.workers.dev) `/search` API.

```
agent calls web_search("…")
   → GET /search?q=…        → 402 Payment Required
   → x402 signs a USDC payment from your wallet
   → request retried        → 200 + ranked, cited results
```

The agent never sees the payment — it just calls a tool and gets answers. Payment
is transparent, instant, and per-call.

## Why use it

- **No signup / no key.** Fund a wallet with a few dollars of USDC on Base; that's it.
- **Pay only for what you use.** ~$0.015 per query, no monthly fee.
- **Real-time web.** Ranked, de-duplicated results with source + date, plus top news.
- **Filters.** Recency (day/week/month/year), site restriction, result count.

## Install

### Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "base-intel-search": {
      "command": "npx",
      "args": ["-y", "base-intel-search-mcp"],
      "env": {
        "EVM_PRIVATE_KEY": "0xYOUR_PAYING_WALLET_PRIVATE_KEY"
      }
    }
  }
}
```

Restart Claude Desktop. You'll see a **web_search** tool.

### Any MCP client

```bash
EVM_PRIVATE_KEY=0x… npx -y base-intel-search-mcp
```

## Funding the wallet

`EVM_PRIVATE_KEY` is a wallet **you** control that pays per query. Fund it on **Base**:

- A few dollars of **USDC** (covers hundreds of searches at ~$0.015 each)
- A tiny amount of **ETH** for gas

> Use a dedicated low-balance wallet for agent spending — never your main wallet.

## The `web_search` tool

| Param | Type | Notes |
| --- | --- | --- |
| `query` | string | required |
| `recency` | `day` \| `week` \| `month` \| `year` | optional time window |
| `site` | string | restrict to a domain, e.g. `arxiv.org` |
| `count` | number (1–20) | results to return (default 10) |

Returns ranked results (title, url, snippet, source, date, extra context) + top news as JSON.

## Configuration

| Env | Default | Purpose |
| --- | --- | --- |
| `EVM_PRIVATE_KEY` | — (required) | wallet that pays per query |
| `SEARCH_API_URL` | Base Intel `/search` | override the search endpoint |
| `X402_NETWORK` | `eip155:8453` | payment network (Base mainnet) |

## How payment works

Built on the [x402](https://x402.org) protocol v2 using `@x402/axios` + `@x402/evm`.
The first request to `/search` returns `402 Payment Required`; the x402 client signs
a USDC `transferWithAuthorization` from your wallet and retries. Settlement is on
Base L2 (sub-cent gas, ~2s). You pay the resource directly — this server holds no
funds and takes no custody.

## License

MIT