Google search for your AI agent
serpgrab runs a hosted MCP server at https://api.serpgrab.com/mcp. Add it to Claude, Cursor, VS Code, ChatGPT or any other MCP client, and your agent can search Google and Google Maps in real time. There is nothing to install: it is one URL and your serpgrab key. Agents with a wallet can skip the key and pay per call with x402.
The tools
google_search: titles, links, dates and snippets, plus Google's AI Overview, answer box, knowledge panel, local pack, ads and "People also ask" when Google shows them. Choose the country, language, location and time range (past hour to past year), and read up to 3 pages.google_maps_search: businesses and places, 20 per page, with name, type, rating, review count, address, phone, hours, website, coordinates and place_id.
The agent gets readable text rather than raw JSON, so results use less of its context. Each page read is one search on your plan, and connecting is free.
Setup
Replace YOUR_KEY with your serpgrab key in each example.
Claude Code
claude mcp add --transport http serpgrab https://api.serpgrab.com/mcp \
--header "X-API-Key: YOUR_KEY"Cursor
In ~/.cursor/mcp.json, or .cursor/mcp.json in a project:
{
"mcpServers": {
"serpgrab": {
"url": "https://api.serpgrab.com/mcp",
"headers": { "X-API-Key": "YOUR_KEY" }
}
}
}VS Code
In .vscode/mcp.json, or run MCP: Open User Configuration:
{
"servers": {
"serpgrab": {
"type": "http",
"url": "https://api.serpgrab.com/mcp",
"headers": { "X-API-Key": "YOUR_KEY" }
}
}
}Windsurf
In Cascade's MCP menu, choose Open MCP config file and add:
{
"mcpServers": {
"serpgrab": {
"serverUrl": "https://api.serpgrab.com/mcp",
"headers": { "X-API-Key": "YOUR_KEY" }
}
}
}Codex
In ~/.codex/config.toml:
[mcp_servers.serpgrab]
url = "https://api.serpgrab.com/mcp"
http_headers = { "X-API-Key" = "YOUR_KEY" }Claude.ai, Claude Desktop, ChatGPT and other clients that only take a URL
Some clients have no field for a header. Put the key in the URL instead, and choose no authentication:
https://api.serpgrab.com/mcp?api_key=YOUR_KEY- Claude.ai and Claude Desktop: Settings › Connectors › Add custom connector.
- ChatGPT: turn on developer mode, then Settings › Connectors › Create.
We don't log keys sent in the URL, but the client stores the URL along with its settings. Keep it as private as the key itself.
With a Pro plan on RapidAPI
If you subscribed to Pro on RapidAPI, connect through RapidAPI instead: change the URL and send your RapidAPI key with RapidAPI's two headers. The tools are the same.
Claude Code
claude mcp add --transport http serpgrab https://google-serp-search-results-json.p.rapidapi.com/mcp \
--header "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
--header "X-RapidAPI-Host: google-serp-search-results-json.p.rapidapi.com"Cursor, and other clients with headers
The same two headers go in VS Code's, Windsurf's or Codex's config in place of X-API-Key.
{
"mcpServers": {
"serpgrab": {
"url": "https://google-serp-search-results-json.p.rapidapi.com/mcp",
"headers": {
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "google-serp-search-results-json.p.rapidapi.com"
}
}
}
}RapidAPI counts every request to the server, so connecting uses about three of your plan's requests, and each tool call one more. Clients that only take a URL can't send RapidAPI's headers.
No key: pay per call with x402
Connect to https://api.serpgrab.com/mcp with no key, and each tool call pays for itself in USDC on Base, using the x402 protocol. There is no account and nothing to sign up for, which suits agents that run on their own.
- The agent calls a tool. The first answer is the price, not results.
- Its x402 client signs a USDC payment and repeats the call, with the payment attached in the call's
_meta. - We run the search and settle the payment. The results come back with the transaction in
_meta["x402/payment-response"].
Price: $0.003 a search. google_search costs $0.003 per page read (pages: 2 is $0.006), and google_maps_search $0.003 per page. A tool call that fails is never charged.
What the agent needs: a wallet with USDC on Base and an MCP client that speaks x402. No ETH is needed: the facilitator pays the gas. With the @x402/mcp client in JavaScript:
import { createx402MCPClient } from '@x402/mcp';
import { ExactEvmScheme } from '@x402/evm/exact/client';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
import { privateKeyToAccount } from 'viem/accounts';
const client = createx402MCPClient({
name: 'my-agent',
version: '1.0.0',
schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(privateKeyToAccount(process.env.WALLET_KEY)) }],
spendControls: { maxAmountPerPayment: '$0.05' }, // never more than this per call
autoPayment: true,
});
await client.connect(new StreamableHTTPClientTransport(new URL('https://api.serpgrab.com/mcp')));
const result = await client.callTool('google_search', { query: 'best pizza in austin' });
console.log(result.content[0].text); // the results
console.log(result.paymentResponse?.transaction); // the USDC payment on BaseKeep the wallet small, like a prepaid card: fund it with a few dollars of USDC and cap each payment (spendControls). The same wallet can pay the plain API too; seePay per search with x402.
Questions
What does it cost? The same as the API: 250 free searches a month, then the Pro plan at $15 a month for 5,000 searches. Every results page the agent reads is one search. When the free searches run out, the tool tells the agent when they come back and how to upgrade. Without a key, x402 charges $0.003 a search in USDC, per call.
Which transport is it? Streamable HTTP, stateless, with JSON replies. Clients that only speak stdio can connect through mcp-remote.
I want the full JSON, not text. Use the API itself: the same results in SerpApi's format, at https://api.serpgrab.com/search.
Something broken, or a tool you'd like? Email hello@serpgrab.com.