serper-search-mcp-server
This MCP server lets AI agents run multi-provider search, scrape pages, batch queries, generate cited research, and produce RAG-ready context.
Unified search across web, images, videos, news, shopping, places, scholar, patents, and autocomplete.
Provider failover across Serper, Tavily, Brave, Exa, and Firecrawl.
Rich results including Knowledge Graph, Answer Box, People Also Ask, prices, hours, citations, and related searches.
Scrape full pages as markdown or plain text.
Run 1–10 parallel web searches with automatic cross-query deduplication.
Generate cited deep-research reports using OpenRouter or Gemini LLM keys.
Return chunked, metadata-rich RAG context for embeddings and vector databases.
Resolve Google
gotoredirect links into real URLs.Tune token usage and cost with verbosity, snippets-only mode, truncation, freshness filters, country/language, safe search, and result limits.
Uses the Brave Search API as an independent-index fallback provider in the server's auto-failover chain, serving web search results when the primary provider fails or returns empty results.
Wraps the Serper API to return Google Search results, exposing tools for web, image, video, news, shopping, places, scholar, patent, and autocomplete queries, including Knowledge Graph, Answer Box, People Also Ask, and related searches.
Optionally supplies the LLM used by the deep_research tool to synthesize multi-step, cited research reports from parallel sub-query searches.
Returns local business and point-of-interest data including addresses, phone numbers, full 7-day opening hours, GPS coordinates, and directions links.
Provides academic paper search returning authors, journal, publication year, and citation counts for scholarly research queries.
🔍 Serper Search MCP Server v4.1
The First Universal Search Gateway for AI Agents — Google (Serper), Tavily, Brave, Exa, and Firecrawl with auto-failover, 15 tools, and token-smart verbosity.
What this does
This MCP server wraps the Serper API (Google Search results) and exposes 15 tools that any MCP-compatible AI client (Claude, Cursor, Windsurf, KiloCode, n8n, etc.) can call in real time — including web, image, video, news, shopping, places, scholar, patents, autocomplete, full-page scraping, and batch search.
Tool | What you get |
| Unified search |
| Organic results + Knowledge Graph + Answer Box + "People Also Ask" + Related Searches |
| Image URLs, thumbnails, dimensions, source pages + |
| Titles, channels, durations, links |
| Headlines, sources, dates — freshness-filtered |
| Products, prices, ratings, delivery info (always rich) |
| Local businesses & POIs with address, phone, full 7-day hours, GPS + Directions (always rich) |
| Academic papers with authors, journal, year, and citation counts |
| Patents with publication number, assignee, inventor, dates |
| Query completions — cheap, no LLM needed |
| Full page content as markdown — read articles found via search |
| 1–10 parallel web searches with automatic cross-query dedupe |
| Multi-step research: auto sub-queries → parallel searches → LLM-synthesized cited report |
| Clean chunked text with metadata for embedding pipelines & vector DBs — no LLM needed |
| Turn |
Verbosity (token-smart, auto by default)
Mode | Who | What | Tokens |
| server picks | dev→compact, chat→standard, scholar/research→full, places/shopping/images→always rich | varies |
| dev coding | title+URL+1-line snippet, no KG/PAA/Related | ~800 |
| normal chat | KG + Answer Box + 10 organic | ~4k |
| researcher | everything + citations | ~5k |
Credit rule:
compactfetchesnum=5(never fetch-10-show-3). 1 search = 1 credit (1–10 results; >10 = 2), cache hit = 0, scrape = 2 per page (verified live — same with or withoutinclude_images; scrape chains multiply).deep_research: basic 3cr / standard 5cr / deep 8cr.
Providers (universal gateway — auto-failover)
Provider | Cost per 1k | When to use |
Serper (default) | $3-5, 2500 free/mo | Cheapest Google truth — keep first |
Tavily fallback | $8-16 | AI-reranked, finance/news topics |
Brave fallback | $5 | Independent index, private, 669ms |
Exa fallback | $4-7 | Neural semantic when keywords fail |
Firecrawl fallback | ~$3-4 eff | JS-rendered scraping & search upgrade |
SEARCH_PROVIDER_ORDER=serper,tavily,brave,exa # failover chain
SEARCH_FALLBACK=true # on 402/429/5xx/emptyCLI (dev power-tool — 4-32x cheaper than MCP schemas)
npx serper-search-mcp search "react server components" --compact --limit 5
npx serper-search-mcp scrape https://example.com --max-chars 8000
npx serper-search-mcp research "RAG limits" --depth basic
npx serper-search-mcp rag "transformer" --format json
npx serper-search-mcp providers --statusFree to start: Serper gives you 2,500 free queries/month. No credit card required.
Related MCP server: Argus
Quick start
🔑 Provider Keys & Universal Gateway Configuration
This server functions as a Universal Search Gateway. Only SERPER_API_KEY is required. You can add any combination of the other 4 search providers and LLM keys to enable automatic multi-provider failover, semantic search, and scraping upgrades:
Variable | Provider / Purpose | Default / Priority |
| Serper (Google Search baseline) | Required (serper.dev) |
| Tavily (AI-reranked fallback) | Optional (tavily.com) |
| Brave (Independent web index fallback) | Optional (brave.com/search/api) |
| Exa (Neural semantic search fallback) | Optional (exa.ai) |
| Firecrawl (JS-rendered scraping & search upgrade) | Optional (firecrawl.dev) |
| LLM for | Optional (takes priority over Gemini) |
| LLM for | Optional (used when OpenRouter is absent) |
Failover Control:
SEARCH_PROVIDER_ORDER=serper,tavily,brave,exa # custom failover priority chain
SEARCH_FALLBACK=true # auto-failover on 402/429/5xx/empty (default: true)Option 1 — npx (MCP Client Configuration)
Add this to your MCP client config file (Claude Desktop, Cursor, Windsurf, KiloCode).
🌟 Full Universal Gateway Config (All 5 Providers + Failover):
{
"mcpServers": {
"serper-search": {
"command": "npx",
"args": ["-y", "serper-search-mcp"],
"env": {
"SERPER_API_KEY": "${SERPER_API_KEY}",
"TAVILY_API_KEY": "${TAVILY_API_KEY}",
"BRAVE_API_KEY": "${BRAVE_API_KEY}",
"EXA_API_KEY": "${EXA_API_KEY}",
"FIRECRAWL_API_KEY": "${FIRECRAWL_API_KEY}",
"OPENROUTER_API_KEY": "${OPENROUTER_API_KEY}",
"SEARCH_PROVIDER_ORDER": "serper,tavily,brave,exa",
"SEARCH_FALLBACK": "true"
}
}
}
}(You can omit any provider keys you don't use; the server automatically detects configured providers and skips unconfigured ones).
Minimal Config (Serper Only):
{
"mcpServers": {
"serper-search": {
"command": "npx",
"args": ["-y", "serper-search-mcp"],
"env": {
"SERPER_API_KEY": "your_serper_key_here"
}
}
}
}Option 2 — Docker
docker run -i --rm \
-e SERPER_API_KEY \
-e TAVILY_API_KEY \
-e BRAVE_API_KEY \
-e EXA_API_KEY \
-e FIRECRAWL_API_KEY \
-e OPENROUTER_API_KEY \
smjahid/server-serper-search:4For HTTP mode (remote server or cloud):
docker run --rm -p 8080:8080 \
-e SERPER_API_KEY \
-e SERPER_MCP_TRANSPORT=http \
-e SERPER_MCP_HOST=0.0.0.0 \
-e SERPER_MCP_AUTH_TOKEN="your_secure_bearer_token" \
smjahid/server-serper-search:4Option 3 — Shell & CLI (PowerShell / Bash / CMD)
PowerShell (Windows):
$env:SERPER_API_KEY = "your_key"
$env:TAVILY_API_KEY = "your_key" # optional
$env:OPENROUTER_API_KEY = "your_key" # optional
node index.jsBash / macOS / Linux:
export SERPER_API_KEY="your_key"
export TAVILY_API_KEY="your_key" # optional
export OPENROUTER_API_KEY="your_key" # optional
node index.jsWindows Command Prompt:
set SERPER_API_KEY=your_key
node index.jsAI-powered research runs on your own LLM key.
deep_researchuses Gemini's free tier whenGEMINI_API_KEYis set (OpenRouter takes priority if both are set — see the env table above).
Config file locations
Client | Config path |
Claude Desktop (Mac) |
|
Claude Desktop (Win) |
|
Cursor |
|
Windsurf |
|
KiloCode |
|
n8n | MCP Client node → Server URL |
Tool reference
search_web
Google web search with the full SERP breakdown.
{
"query": "best mechanical keyboards 2025", // required
"num_results": 10, // 1–20, default 10
"country": "US", // ISO 3166-1 alpha-2
"search_lang": "en", // language code
"freshness": "pw", // "pd" day · "pw" week · "pm" month · "py" year · "any" no filter
"safesearch": "moderate",// "off" · "moderate" · "strict"
"autocorrect": true,
"page": 1, // pagination
"link_resolution": "auto" // "auto" · "all" · "none" — see Google redirect links below
}Response includes:
🎯 Answer Box — direct answer when available
🧠 Knowledge Graph — entity info (type, description, rating, website, attributes)
🌐 Organic results — title, URL, snippet, sitelinks, date
💬 People Also Ask — up to 4 follow-up questions with answers
🔗 Related Searches — up to 6 suggestions
⏱️ Time filter — footer echoes the applied
freshness(ornone (all time)) so agents know why results look thin
No AI summary on this tool. For a synthesized answer in ONE call use
deep_research(full report, 3–8 credits + LLM) orsearch_rag_context(chunked evidence, 1 credit, no LLM). For latest/current results passfreshness(py,pw, …) — the footer confirms it was applied. Avoidsearch → scrape → scrapechains: every scrape costs 2 credits.
search_images
{
"query": "minimalist desk setup",
"num_results": 10,
"country": "US",
"safesearch": "moderate"
}Returns: image URL, thumbnail, dimensions (width × height), source domain, source page URL.
search_videos
{
"query": "react server components tutorial",
"num_results": 5,
"freshness": "pm"
}Returns: title, channel, duration, publish date, video URL.
search_news
{
"query": "OpenAI GPT-5 release",
"num_results": 10,
"freshness": "pd", // default is past day for news; pass "any" for historical news (or use after:/before: operators in the query)
"country": "US"
}Returns: headline, source publication, date, snippet, URL.
search_shopping
{
"query": "Sony WH-1000XM5 headphones",
"num_results": 8,
"country": "US"
}Returns: product name, price, seller, star rating + review count, delivery info, product URL.
search_places ⭐ unique to this server
{
"query": "ramen restaurants in Shibuya Tokyo",
"num_results": 5,
"country": "JP"
}Returns: business name, category, address, phone, website, star rating + review count, opening hours, GPS coordinates + Google Maps link.
Example use cases:
"Find the top-rated coffee shops near Times Square"
"What dentists are open on Sundays in Austin TX?"
"List coworking spaces in Dhaka"
search_scholar 🆕 v4.0.0
Google Scholar search for academic literature.
{
"query": "attention is all you need",
"num_results": 10,
"freshness": "py", // optional year filter — useful for recent literature
"country": "US"
}Returns: title, link, authors/journal/year (publicationInfo), snippet, and citation count.
scrape 🆕 v4.0.0
Fetch the full contents of a single URL (Serper Scrape API — scrape.serper.dev).
{
"url": "https://example.com/article", // required
"include_markdown": true, // default true — markdown rendering
"include_images": false,
"include_links": false,
"include_videos": false,
"max_chars": 50000 // 1000–200000, default 50000
}Returns the page as markdown (falls back to plain text), truncated for context safety. Costs 2 credits per page (verified live — include_images does not change the price). Before scraping: prefer search_rag_context (1 credit, no LLM) or deep_research for synthesized answers; if you do scrape, chain only 1–3 pages — each page is 2 credits.
search_many 🆕 v4.0.0
Run 1–10 web searches in one call, in parallel.
{
"queries": ["react server components", "vue server components", "sveltekit ssr"],
"num_results": 5,
"country": "US"
}Duplicate URLs across queries are removed automatically; per-query failures are reported inline without failing the batch. One credit per query.
Google redirect links & resolve_links 🆕
Since 2026-10-30, Serper may return Google result links beyond the top 3 as https://www.google.com/goto?url=… redirects. Opening one right after the search lands on Google's "Verifying your request" page instead of the site. Serper's free /resolve endpoint turns them back into real URLs (serper.dev/google-links).
search, search_web, search_images, search_videos, search_news, search_shopping and search_rag_context take a link_resolution parameter:
Mode | Behaviour |
| Serper's default: top 3 resolved. If the shown results still contain redirect links, the output says how many and gives a |
| Also calls |
| Sends |
resolve_links resolves a search later by search_id (the last 50 searches with redirect links are kept in memory) or from a list of goto links:
{ "search_id": "Xq3v…" } // re-renders that search with real URLs
{ "links": ["https://www.google.com/goto?url=…"], "max_wait_seconds": 60 }Links that are not ready yet stay goto links and Serper suggests a wait (often 90 s); it is honoured only if it fits in max_wait_seconds. /resolve failures never fail a search: the original results are kept and the error is shown. deep_research resolves its sources before building the prompt and lists any citation that is still a redirect.
Environment variables
Search Providers & Universal Gateway
Variable | Required | Default | Description |
| ✅ | — | Primary search provider key (serper.dev — 2,500 free queries/mo) |
| ❌ | — | Tavily fallback provider key (tavily.com — AI-reranked search) |
| ❌ | — | Brave Search fallback provider key (brave.com/search/api — independent index) |
| ❌ | — | Exa neural search fallback key (exa.ai — semantic search & highlights) |
| ❌ | — | Firecrawl JS-rendered scraping & search upgrade key (firecrawl.dev) |
| ❌ |
| Comma-separated failover priority chain ( |
| ❌ |
| Auto-failover on 402/429/5xx/empty response ( |
Server & Transport
Variable | Required | Default | Description |
| ❌ |
| MCP transport mode: |
| ❌ |
| Port for HTTP transport mode (1–65535) |
| ❌ |
| Host interface to bind for HTTP mode (non-loopback requires |
| ❌ | — | Bearer token for HTTP |
| ❌ |
|
|
| ❌ | — | Comma-separated extra |
| ❌ |
| Logging verbosity: |
Cache & Resilience Tuning
Variable | Required | Default | Description |
| ❌ |
| Search-result cache TTL in ms ( |
| ❌ |
| Maximum cached responses (LRU eviction) |
| ❌ |
| Per-request timeout for Serper calls in ms |
| ❌ |
| Retries on 429 / 5xx / network errors (honors |
| ❌ |
| Base backoff delay in ms (exponential backoff + jitter) |
| ❌ |
|
|
| ❌ |
| Directory for the persisted cache files |
| ❌ |
| Default |
| ❌ |
| Seconds |
Deep Research LLM Synthesis
Variable | Required | Default | Description |
| ❌ | — | LLM key for |
| ❌ |
| OpenRouter model override |
| ❌ | — | LLM key for |
| ❌ |
| Gemini model override |
| ❌ |
| Per-request timeout for LLM synthesis calls in ms |
| ❌ |
| Retries for LLM calls on rate-limit or network errors |
HTTP transport (remote / Docker)
Run as a stateless Streamable HTTP server (this is also how the Docker image runs):
npx serper-search-mcp --transport http --port 8080
# or via env: SERPER_MCP_TRANSPORT=http SERPER_MCP_PORT=8080 npx serper-search-mcpMCP endpoint:
POST http://localhost:8080/mcpHealth probe:
GET http://localhost:8080/health
Point any Streamable HTTP capable MCP client at http://<host>:8080/mcp.
Optional bearer auth
Set SERPER_MCP_AUTH_TOKEN (or --auth-token) to require authentication on /mcp:
SERPER_MCP_AUTH_TOKEN=secret npx serper-search-mcp --transport http --port 8080curl -X POST http://localhost:8080/mcp \
-H "Authorization: Bearer secret" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Requests without the token get 401. /health stays unauthenticated for load balancers and reports auth_required.
Example prompts
Once connected to any MCP client:
Search for the latest news about Claude 4 and summarize the key points.
Find me 5 Italian restaurants in Warsaw with their ratings and phone numbers.
What is the current price of the MacBook Pro M4 on Google Shopping?
Search for YouTube tutorials on building agentic AI systems published this month.
Find images of brutalist architecture in Eastern Europe.deep_research
Runs multi-step AI research using your own LLM key. No LLM data leaves your environment.
Requires: OPENROUTER_API_KEY (free models at openrouter.ai) or GEMINI_API_KEY (free at aistudio.google.com)
{
"query": "What are the real-world limitations of RAG systems in production?",
"depth": "standard", // "basic" | "standard" | "deep"
"country": "US"
}Depth | Sub-queries | Results each | Best for |
| 3 | 3 | Quick overviews |
| 5 | 5 | Most use cases |
| 8 | 5 | Exhaustive research |
Output: Structured markdown report with inline citations + Sources section.
Supported LLMs via env (all vars documented in the table above):
Provider | Variable | Default |
OpenRouter |
| — |
|
| |
Google Gemini |
| — |
|
|
search_rag_context
Turns Google search results into embedding-ready chunks. No LLM needed — pure text processing.
{
"query": "transformer architecture explained",
"num_results": 10,
"freshness": "py", // optional: pd/pw/pm/py/any — omitted = all time
"max_chunk_words": 200,
"include_paa": true,
"output_format": "json" // "json" or "text"
}JSON output (for vector DB ingestion):
{
"query": "transformer architecture explained",
"total_sources": 10,
"total_chunks": 24,
"total_words": 4231,
"chunks": [
{
"chunk_index": 0,
"source_index": 1,
"title": "Attention Is All You Need",
"url": "https://arxiv.org/abs/1706.03762",
"domain": "arxiv.org",
"date": "2024-01-15",
"text": "The transformer architecture uses self-attention mechanisms...",
"word_count": 198,
"char_count": 1124
}
]
}Text output (for direct prompt injection):
--- Chunk 1 | Source 1 | arxiv.org | 2024-01-15 ---
Title: Attention Is All You Need
URL: https://arxiv.org/abs/1706.03762
The transformer architecture uses self-attention...Use cases:
Feed into Chroma, Pinecone, Qdrant, pgvector
Ground prompts with fresh web data
Build search-augmented RAG pipelines
Architecture
serper-search-mcp-server/
├── index.js ← Zero-build JS entry (npx / Docker) — generated from src/ via `npm run bundle`; never edit by hand
├── src/
│ ├── index.ts ← TypeScript CLI entry
│ ├── api/
│ │ ├── SerperAPI.ts ← HTTP client (per-type endpoints, retry, timeout, TTL cache, scrape)
│ │ ├── LLMClient.ts ← OpenRouter + Gemini client
│ │ └── providers/ ← Universal gateway: Router (failover + RRF fusion) · Serper · Tavily · Brave · Exa · Firecrawl
│ ├── server/
│ │ └── SerperMCPServer.ts ← MCP server, stdio + HTTP transport, bearer auth
│ ├── tools/
│ │ ├── SearchTools.ts ← All 15 tool definitions + validation
│ │ ├── BatchSearch.ts ← search_many (parallel + dedupe)
│ │ ├── DeepResearch.ts ← Multi-step research orchestration
│ │ ├── RAGContext.ts ← Chunk + metadata formatter
│ │ └── ResolveLinks.ts ← link_resolution modes + resolve_links (Serper /resolve)
│ ├── types/
│ │ └── index.ts ← Full TypeScript types
│ └── utils/
│ ├── ResultFormatter.ts ← Markdown formatting
│ ├── LinkResolution.ts ← google.com/goto handling (link_resolution modes + /resolve)
│ ├── HttpRetry.ts ← Timeout + retry/backoff
│ ├── TtlCache.ts ← TTL + LRU cache
│ ├── Logger.ts ← Leveled stderr logger (+ request-id)
│ ├── errors.ts ← Typed error hierarchy
│ ├── Metrics.ts ← /health counters
│ └── EnvCheck.ts ← Boot-time env validation
├── scripts/
│ └── bundle.mjs ← Builds index.js from src/ (`--check` mode for CI)
├── tests/ ← node:test suite (102 tests)
└── .github/workflows/ci.yml ← Node 22/24: build + bundle check + testsDual-file design: index.js runs without any build step (ideal for npx and Docker) and is generated from src/ — the TS tree is the only source of truth. npm run check:bundle fails CI if they drift.
Get a Serper API key
Go to serper.dev
Sign up (free — no credit card)
Copy your API key from the dashboard
You get 2,500 free queries/month
Version evolution
Feature | v1.0.0 | v2.0.1 | v3.0.0 | v4.0.0 |
Total tools | 5 | 5 | 8 | 14 |
| ❌ | ❌ | ❌ | ✅ auto-verbosity + provider failover |
| ✅ organic only | ✅ organic only | ✅ + Answer Box, Knowledge Graph, PAA, Related | ✅ |
| ✅ | ✅ | ✅ + dimensions, domain | ✅ + gallery layout |
| ✅ | ✅ | ✅ + date field | ✅ |
| ✅ | ✅ | ✅ cleaner formatting | ✅ + past-day default |
| ✅ | ✅ | ✅ + delivery, offers | ✅ (always rich) |
| ❌ | ❌ | ✅ address, phone, hours, GPS, Maps link | ✅ + full 7-day hours, directions |
| ❌ | ❌ | ❌ | ✅ papers + citation counts |
| ❌ | ❌ | ❌ | ✅ publication, assignee, dates |
| ❌ | ❌ | ❌ | ✅ fast query completions |
| ❌ | ❌ | ❌ | ✅ full page → markdown |
| ❌ | ❌ | ❌ | ✅ batch + cross-query dedupe |
| ❌ | ❌ | ✅ sub-queries → parallel search → LLM report | ✅ |
| ❌ | ❌ | ✅ chunked text + metadata, JSON/text output | ✅ |
| ❌ | ❌ | ❌ | ❌ → ✅ in v4.1.0 (14 → 15 tools) |
API endpoints | all hitting | all hitting | ✅ correct per-type endpoints | ✅ + scholar + scrape host |
Answer Box / KG / PAA | ❌ | ❌ | ✅ full SERP extraction | ✅ |
Pagination | ❌ | ❌ | ✅ | ✅ |
Autocorrect param | ❌ | ❌ | ✅ | ✅ |
LLM support | ❌ | ❌ | ✅ OpenRouter + Gemini (user's own key) | ✅ |
LLM-free RAG output | ❌ | ❌ | ✅ JSON + plain text | ✅ |
TypeScript types | partial (heavy | partial (heavy | ✅ full types for every result shape | ✅ + scholar/scrape |
MCP SDK version | ^0.5.0 | ^0.5.0 or ^1.0.0 | ^1.0.0 | ^1.0.0 |
Node requirement | >=16 | >=16 | >=18 (native | >=18 |
HTTP transport | ❌ | ✅ | ✅ | ✅ stateless Streamable HTTP |
HTTP bearer auth | ❌ | ❌ | ❌ | ✅ optional |
Retry + timeout | ❌ | ❌ | ❌ | ✅ 429/5xx/network |
Response cache | ❌ | ❌ | ❌ | ✅ TTL + LRU |
Log levels | ❌ | ❌ | ❌ | ✅ error/warn/info/debug/silent |
Tests + CI | ❌ | ❌ | ❌ | ✅ node:test + GitHub Actions |
Docker | ❌ | ✅ | ✅ | ✅ |
npx | ❌ | ✅ | ✅ | ✅ |
Client configs | Claude Desktop only | Claude Desktop + a few | Claude Desktop + Cursor + Windsurf + KiloCode + n8n | ✅ |
Telemetry | ❌ none | ❌ none | ❌ none (intentional — privacy win) | ❌ none |
v4.1.0 (see Changelog): security hardening + correctness sweep — tool count 14 → 15 (added
resolve_links), no new search types.
Changelog
v4.1.0 — Security hardening + correctness sweep (36 fixes)
🔧
freshnesswas silently broken — the server sent invalid Googletbsvalues (qdr:pd/pw/pm/pyinstead ofqdr:d/w/m/y), so Google ignored the filter and returned all-time results (the "16 years ago" problem from the incident log). One mapping fix healed 7 tools:search,search_web,search_videos,search_news,search_scholar,search_many,search_rag_context. Verified live:freshness: py→ Dec 2025–Jun 2026 results at 1 credit.➕
freshness: "any"— explicit no-filter opt-out;search_news(defaults to past day) can now reach historical news (before:2015-01-01verified → 2004–2013 articles).after:/before:operators documented in the tool description.⏱️ Footer
Time filterecho — every web/news response states the applied filter (none (all time)/past day/past year/none (opt-out)) so agents correct in one retry instead of looping.🔧 People Also Ask guards — question-only PAA entries no longer render
undefined/[Read more](undefined);search_rag_contextno longer crashes on them (cleanText(undefined)TypeError).🧹 Dead
summaryparam removed fromsearch_web— Serper never implemented it and it was never rendered; schema/server/type cleaned (stale clients still passingsummaryare silently accepted — non-breaking). Tool description now steers tosearch_rag_context(fast) ordeep_research(thorough) instead of search→scrape chains.💰 Credit transparency —
scrapepricing verified live: 2 credits/page, identical with or withoutinclude_images(incident's "6 credits" = 3 scrapes × 2). README credit rules corrected; the misleading "typical flow: search_web → scrape" guidance replaced with rag/deep-first advice + chain warnings.🧪 Tests — 102/102 : regression tests for all four freshness mappings + the
anyopt-out; the old assertion that enshrined the bug (tbs === 'qdr:pw') corrected to Google's real syntax.🔒 HTTP is safe by default — binds
127.0.0.1, refuses a non-loopback bind withoutSERPER_MCP_AUTH_TOKEN(SERPER_MCP_INSECURE_NO_AUTH=trueopts out),docker-compose.ymlrequires the token, chunked bodies are rejected (411), error messages are sanitized before leaving the process, the Gemini key moved to thex-goog-api-keyheader, bearer comparison is case-insensitive and constant-time (digest compare).🧠 Wrong-results fixes — failover now judges emptiness per search type (videos/shopping/patents/autocomplete are no longer discarded),
provider=allfuses the right result field, non-Serper providers are rejected for non-web searches instead of returning empty output.🧪 Tests are hermetic — cache persistence is opt-in (
SERPER_CACHE_PERSIST=true), files are0600in a0700dir, scoped per API key; the suite passes on immediate re-runs (82/82 ×2).✅ Validation — schema-driven
validateArgs(types, enums, ranges),layoutgallery wired,size/orientationfilter client-side, deadcolor/open_now_onlyparams removed.⚙️ Reliability — body reads are covered by the request timeout,
/resolvewall-time is budgeted, per-request log IDs viaAsyncLocalStorage, cache writes are debounced + atomic, deep-research counts only sources actually sent, empty LLM reports fail loudly, stdio shutdown can't hang.
v4.0.0 — Universal Search Gateway (Multi-Provider, 14 Tools, CLI, Resilience, Tests)
➕ Universal Multi-Provider Gateway — failover chain: Serper → Tavily → Brave (+ Exa/Firecrawl) with
provider=allreciprocal-rank fusion➕ 14 MCP Tools — including unified
search(token-smart auto-verbosity),search_scholar,search_patents,autocomplete,scrape,search_many➕ Developer CLI —
search,scrape,research,rag,providers,statussubcommands➕
search_scholartool — Google Scholar with authors, journal, year, citation counts➕
scrapetool — full page content as markdown viascrape.serper.dev(truncation-safe)➕
search_manytool — 1–10 parallel web searches, cross-query URL dedupe, per-query failure isolation➕ Retry + timeout — 429/5xx/network retries with exponential backoff + jitter (Retry-After honored)
➕ Response cache — in-memory TTL + LRU (
SERPER_CACHE_TTL_MS=0disables); opt-in disk persistence (SERPER_CACHE_PERSIST=true, dirSERPER_CACHE_DIR, written 0600 and scoped per API key)➕ Optional HTTP bearer auth —
SERPER_MCP_AUTH_TOKENguards/mcp;/healthstays open➕ Real log levels —
SERPER_MCP_LOG_LEVELnow controls error/warn/info/debug/silent➕ Test suite + CI — 58
node:testtests (no extra deps, incl. real-HTTP e2e) + GitHub Actions matrix (Node 18/20/22)🔧 HTTP transport now works on Node 18 — WebCrypto shim for the MCP SDK (
crypto.randomUUID); Docker base image bumped tonode:20-alpine🔧
search_langis now correctly mapped to Serper'shl(was previously ignored)🔧 News results default to past-day freshness as documented
🔧
max_chunk_wordsclamped 50–1000 (fixes a hang on zero/negative values)🔧 Unknown
depthfalls back tostandardindeep_research🔧 Unknown tools return
MethodNotFoundinstead ofInternalError🔧
--api-keywithout a value no longer breaks startup🔧
index.jsis generated fromsrc/via esbuild;npm run check:bundleguards drift🔧 Windows-compatible npm scripts;
npm auditreports 0 vulnerabilities
v3.0.0 — Places + Deep Research + RAG
➕
search_placestool — local businesses with address, phone, hours, GPS➕ Knowledge Graph extraction in web search
➕ Answer Box extraction in web search
➕ People Also Ask + Related Searches in web results
➕ Pagination support (
pageparam)➕
autocorrectparam on web search🔧 Corrected per-type Serper endpoints (images/videos/news/shopping now use dedicated endpoints)
🔧 Full TypeScript types for all result shapes
➕
deep_researchtool — multi-step research with LLM synthesis (OpenRouter / Gemini)➕
search_rag_contexttool — embedding-ready chunks with metadata (no LLM needed)🔧 Node ≥ 18 requirement (native
fetch)
v2.0.1
HTTP/SSE transport mode
Docker Compose support
CLI flags
v1.0.0
Initial release: web, images, videos, news, shopping
Contributing
PRs and issues are welcome. Please open an issue before large changes — and if something looks wrong (stale results, unexpected credits, a parameter that seems ignored), start an issue or Discussion with the exact tool call, the response footer line (Provider · Cache · Time filter · credits), and your server version (vX.Y.Z startup banner or npm view serper-search-mcp version); security vulnerabilities go to GitHub Security Advisories, not public issues.
git clone https://github.com/smjahid012/serper-search-mcp-server.git
cd serper-search-mcp-server
npm install
export SERPER_API_KEY="your_key"
node index.js # test immediately, no build requiredLicense
Apache 2.0 — see LICENSE
Built by SMLabs AI · smjahid012
If this saved you time, a ⭐ on GitHub helps others find it.
Available Tools
15 toolsautocompleteB
Google Autocomplete suggestions via Serper API. Returns query completions — cheap, no LLM needed.
Inputs: query (required), country, ui_lang, num_results, +1 more.
deep_researchA
AI-powered deep research tool. Breaks your question into sub-queries, runs multiple Google searches, then synthesizes a cited research report using your LLM (OpenRouter or Gemini). Requires OPENROUTER_API_KEY or GEMINI_API_KEY environment variable.
Inputs: query (required), depth, country.
resolve_linksA
Turn google.com/goto redirect links from a recent search into real URLs via Serper /resolve (free, 0 credits). Requires exactly one of: search_id, or links. Pass the search_id a search result asked for, or a list of goto links. Right after a search one call takes ~20–30 s. Links not ready yet stay goto links; Serper then suggests a wait (often 90 s), which is only honoured if it fits in max_wait_seconds — otherwise call again later.
Inputs: links, search_id, max_wait_seconds.
scrapeA
Fetch and extract the full contents of a single URL via Serper Scrape API. Returns the page content as markdown (or plain text). Costs 2 credits per page (every scrape; include_images does not change the price — chains multiply). For synthesized answers prefer search_rag_context or deep_research over scraping many pages.
Inputs: url (required), max_chars, include_links, include_images, +2 more.
searchB
Unified search — one tool for all types (loads ~700 tokens instead of ~7k for 11 tools). Pick type=web|images|videos|news|shopping|places|scholar|patents|autocomplete and provider=auto|serper|tavily|brave|exa|firecrawl. Credit budget: basic 3 / standard 5 / deep 8 credits for deep_research; 1 credit per search; cache hits cost 0.
Inputs: query (required), type, country, ui_lang, +9 more.
search_imagesB
Google Image search via Serper API. Returns image URLs, thumbnails, dimensions, and source pages. Use layout=gallery for a renderable visual grid (designers/moodboards). Always rich — never compacted.
Inputs: query (required), site, size, layout, +11 more.
search_manyA
Run multiple web searches in one call (parallel). Duplicate URLs across queries are removed automatically. Great for comparing topics, gathering multi-angle context, or fanning out sub-queries. Each query costs 1 credit.
Inputs: queries (required), country, ui_lang, freshness, +3 more.
search_newsA
Google News search via Serper API. Returns headlines, sources, and publication dates. Defaults to past day — pass freshness="any" for historical news, or use after:/before: operators in the query for date ranges.
Inputs: query (required), country, ui_lang, freshness, +4 more.
search_patentsB
Google Patents search via Serper API. Returns patents with publication number, assignee, inventor, and dates. Always rich.
Inputs: query (required), country, ui_lang, provider, +5 more.
search_placesA
Google Places / Maps search via Serper API. Returns local businesses with address, phone, full 7-day hours, ratings, GPS + Directions links. Rich by default; verbosity=compact keeps only title/rating/address.
Inputs: query (required), country, sort_by, ui_lang, +7 more.
search_rag_contextB
Returns Google search results as clean, chunked, metadata-rich text optimized for embedding pipelines and vector databases. No LLM required. Each chunk includes: text, source URL, domain, title, date, word count, and chunk index. Perfect for RAG pipelines, semantic search, and AI grounding.
Inputs: query (required), country, freshness, include_paa, +4 more.
search_scholarA
Google Scholar search via Serper API. Returns academic publications with authors, journal, year, and citation counts. Ideal for research papers and literature reviews.
Inputs: query (required), country, ui_lang, freshness, +2 more.
search_shoppingA
Google Shopping search via Serper API. Returns products with prices, ratings, and delivery info.
Inputs: query (required), country, ui_lang, num_results, +2 more.
search_videosB
Google Video search via Serper API. Returns titles, channels, durations, and links.
Inputs: query (required), country, ui_lang, freshness, +4 more.
search_webA
Google web search via Serper API. Returns organic results plus Knowledge Graph, Answer Box, People Also Ask, and related searches. For latest/current results pass freshness (e.g. py=past year). For a synthesized answer in one call, prefer search_rag_context (fast) or deep_research (thorough) instead of search→scrape chains.
Inputs: query (required), page, country, ui_lang, +10 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
The vertical search tools (search_web, search_images, search_news, search_scholar, etc.) are clearly distinct from each other, but the unified `search` tool explicitly subsumes nine of them, so an agent must guess between `search(type=web)` and `search_web`. The web-retrieval family is also crowded — search, search_web, search_many, search_rag_context, and deep_research all return web results with only subtle intent differences (raw vs chunked vs synthesized vs parallel).
Most tools follow a predictable `search_<vertical>` or verb_noun pattern (search_web, search_news, search_rag_context, resolve_links, deep_research). The lone outlier is `autocomplete` (no verb) and the bare `search`, which breaks the prefix family while sitting in the middle of it.
Fifteen tools is within a reasonable band, but roughly nine of them are redundant duplicates of the unified `search` tool, so the set is effectively two overlapping surfaces shipped together rather than 15 distinct capabilities. The redundancy inflates the count without adding reachable functionality.
Coverage of the search domain is strong: all major Google verticals, scraping, link resolution, RAG-ready chunking, and synthesized research are present. Minor gaps remain around pagination/result-set continuation, batch scraping, and any cache or credit-budget inspection tool, but agents can work around these.
Maintenance
Related MCP Connectors
Web search for AI agents — one tool across 6 engines, routed to the cheapest + cached.
Firecrawl, the context API for AI agents: search, scrape, interact with the web, plus paper search.
Web search, page fetch and cited research for AI agents: 26 engines, 8 tools, one key, from $15/mo.
The best web search for your AI Agent
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceUnified web layer for AI agents. Search across 8 engines, stealth browse with Camoufox/Playwright, manage cookie auth, and act on 24 platforms.29MIT
- AlicenseCqualityBmaintenanceOne endpoint, five search providers. Search broker for AI agents with automatic fallback, RRF ranking, and budget enforcement. The LiteLLM of web search.1561 PyPI9MIT
- AlicenseAqualityDmaintenanceWeb search for AI agents across 6 engines (Serper, Brave, Exa, Tavily, Firecrawl, Perplexity) through one search tool. Routes each query to the cheapest engine that clears a quality bar and caches repeats. Hosted, streamable-HTTP, BYOK supported.11MIT
- AlicenseAqualityFmaintenanceFree multi-source web search server for AI agents, with confidence scoring and token optimization.3Apache 2.0