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.
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:3Option 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_researchuses Gemini's free tier by default. SetGEMINI_API_KEYabove 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 formattingDual-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
- 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 |
|---|---|---|---|
| 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_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.
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
If this saved you time, a โญ on GitHub helps others find it.