JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 71
  • Score
    100M100P100Q90337F
  • License Apache-2.0

MCP server for Serper API โ€” Google web, image, video, news, shopping, and places search for AI agents

Package Exports

  • serper-search-mcp
  • serper-search-mcp/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (serper-search-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐Ÿ” Serper Search MCP Server

Give your AI agent real Google search โ€” web, images, videos, news, shopping, and places.

npm version npm downloads Docker Pulls License: Apache 2.0 MCP

Built by SMLabs AI ยท smjahid012


What this does

This MCP server wraps the Serper API (Google Search results) and exposes 8 search tools that any MCP-compatible AI client (Claude, Cursor, Windsurf, KiloCode, n8n, etc.) can call in real time.

Tool What you get
search_web Organic results + Knowledge Graph + Answer Box + "People Also Ask" + Related Searches
search_images Image URLs, dimensions, source pages
search_videos Titles, channels, durations, links
search_news Headlines, sources, dates โ€” freshness-filtered
search_shopping Products, prices, ratings, delivery info
search_places Local businesses & POIs with address, phone, hours, GPS coords
deep_research Multi-step research: auto sub-queries โ†’ parallel searches โ†’ LLM-synthesized cited report
search_rag_context Clean chunked text with metadata for embedding pipelines & vector DBs โ€” no LLM needed

Free to start: Serper gives you 2,500 free queries/month. No credit card required.


Quick start

Option 1 โ€” npx (zero install)

{
  "mcpServers": {
    "serper-search": {
      "command": "npx",
      "args": ["-y", "serper-search-mcp"],
      "env": {
        "SERPER_API_KEY": "${SERPER_API_KEY}",
        "GEMINI_API_KEY": "${GEMINI_API_KEY}"
      }
    }
  }
}

Add this to your MCP client config (paths listed below), then restart.

Option 2 โ€” Docker

{
  "mcpServers": {
    "serper-search": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "SERPER_API_KEY", "-e", "GEMINI_API_KEY", "smjahid/server-serper-search:3"],
      "env": {
        "SERPER_API_KEY": "your_key_here",
        "GEMINI_API_KEY": "your_gemini_key_here"
      }
    }
  }
}

Or run directly:

docker run -i --rm \
  -e SERPER_API_KEY=your_key \
  -e GEMINI_API_KEY=your_gemini_key \
  smjahid/server-serper-search:3

Option 3 โ€” Local clone

git clone https://github.com/smjahid012/serper-search-mcp-server.git
cd serper-search-mcp-server
npm install
export SERPER_API_KEY="your_key"
export GEMINI_API_KEY="your_gemini_key"
node index.js

๐Ÿ’ก AI-powered research is free. deep_research uses Gemini's free tier by default. Set GEMINI_API_KEY above to unlock it.


Config file locations

Client Config path
Claude Desktop (Mac) ~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop (Win) %APPDATA%\Claude\claude_desktop_config.json
Cursor ~/.cursor/mcp.json
Windsurf ~/.codeium/windsurf/mcp_config.json
KiloCode ~/.config/kilo/kilo.json (global) or <project>/kilo.json (project)
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
  "safesearch":  "moderate",// "off" ยท "moderate" ยท "strict"
  "autocorrect": true,
  "summary":     false,     // Serper AI summary
  "page":        1          // pagination
}

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

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
  "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"

Environment variables

Variable Required Default Description
SERPER_API_KEY โœ… โ€” Your Serper API key
SERPER_MCP_TRANSPORT โŒ stdio stdio or http
SERPER_MCP_PORT โŒ 8080 HTTP port
SERPER_MCP_HOST โŒ 0.0.0.0 HTTP host
SERPER_MCP_LOG_LEVEL โŒ info Logging verbosity
OPENROUTER_API_KEY โŒ โ€” LLM key for deep_research (free at openrouter.ai)
OPENROUTER_MODEL โŒ google/gemini-3.1-flash-lite:free OpenRouter model override
GEMINI_API_KEY โŒ โ€” LLM key for deep_research (free at ai.google.dev)
GEMINI_MODEL โŒ gemini-3.1-flash-lite Gemini model override

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
basic 3 3 Quick overviews
standard 5 5 Most use cases
deep 8 7 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 OPENROUTER_API_KEY โ€”
OPENROUTER_MODEL google/gemini-3.1-flash-lite:free
Google Gemini GEMINI_API_KEY โ€”
GEMINI_MODEL gemini-3.1-flash-lite

search_rag_context

Turns Google search results into embedding-ready chunks. No LLM needed โ€” pure text processing.

{
  "query":           "transformer architecture explained",
  "num_results":     10,
  "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)
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ index.ts                โ† TypeScript CLI entry
    โ”œโ”€โ”€ api/
    โ”‚   โ”œโ”€โ”€ SerperAPI.ts        โ† HTTP client (per-type endpoints)
    โ”‚   โ””โ”€โ”€ LLMClient.ts        โ† OpenRouter + Gemini client
    โ”œโ”€โ”€ server/
    โ”‚   โ””โ”€โ”€ SerperMCPServer.ts  โ† MCP Server + tool routing
    โ”œโ”€โ”€ tools/
    โ”‚   โ”œโ”€โ”€ SearchTools.ts      โ† All 8 tool definitions + validation
    โ”‚   โ”œโ”€โ”€ DeepResearch.ts     โ† Multi-step research orchestration
    โ”‚   โ””โ”€โ”€ RAGContext.ts       โ† Chunk + metadata formatter
    โ”œโ”€โ”€ types/
    โ”‚   โ””โ”€โ”€ index.ts            โ† Full TypeScript types
    โ””โ”€โ”€ utils/
        โ””โ”€โ”€ ResultFormatter.ts  โ† Markdown formatting

Dual-file design: index.js runs without any build step (ideal for npx and Docker). The TypeScript src/ tree is for contributors who want type safety and IDE support.


Get a Serper API key

  1. Go to serper.dev
  2. Sign up (free โ€” no credit card)
  3. Copy your API key from the dashboard
  4. You get 2,500 free queries/month

Version evolution

Feature v1.0.0 v2.0.1 v3.0.0
Total tools 5 5 8
search_web โœ… organic only โœ… organic only โœ… + Answer Box, Knowledge Graph, PAA, Related
search_images โœ… โœ… โœ… + dimensions, domain
search_videos โœ… โœ… โœ… + date field
search_news โœ… โœ… โœ… cleaner formatting
search_shopping โœ… โœ… โœ… + delivery, offers
search_places โŒ โŒ โœ… address, phone, hours, GPS, Maps link
deep_research โŒ โŒ โœ… sub-queries โ†’ parallel search โ†’ LLM report
search_rag_context โŒ โŒ โœ… chunked text + metadata, JSON/text output
API endpoints all hitting /search with tbm param all hitting /search with tbm param โœ… correct per-type endpoints
Answer Box / KG / PAA โŒ โŒ โœ… full SERP extraction
Pagination โŒ โŒ โœ… page param
Autocorrect param โŒ โŒ โœ…
LLM support โŒ โŒ โœ… OpenRouter + Gemini (user's own key)
LLM-free RAG output โŒ โŒ โœ… JSON + plain text
TypeScript types partial (heavy any) partial (heavy any) โœ… full types for every result shape
MCP SDK version ^0.5.0 ^0.5.0 or ^1.0.0 ^1.0.0
Node requirement >=16 >=16 >=18 (native fetch, no axios)
HTTP/SSE transport โŒ โœ… โœ…
Docker โŒ โœ… โœ…
npx โŒ โœ… โœ…
Client configs Claude Desktop only Claude Desktop + a few Claude Desktop + Cursor + Windsurf + KiloCode + n8n
Telemetry โŒ none โŒ none โŒ none (intentional โ€” privacy win)

Changelog

v3.0.0 โ€” Places + Deep Research + RAG

  • โž• search_places tool โ€” 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 (page param)
  • โž• autocorrect param on web search
  • ๐Ÿ”ง Corrected per-type Serper endpoints (images/videos/news/shopping now use dedicated endpoints)
  • ๐Ÿ”ง Full TypeScript types for all result shapes
  • โž• deep_research tool โ€” multi-step research with LLM synthesis (OpenRouter / Gemini)
  • โž• search_rag_context tool โ€” 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.

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 required

License

Apache 2.0 โ€” see LICENSE


Built by SMLabs AI

If this saved you time, a โญ on GitHub helps others find it.