MCP HubMCP Hub
NightTrek

Serper-search-mcp

by: NightTrek

Un-official Serper Google search server for Cline and other MCP clients

20created 18/02/2025
Visit
Serper
Google

πŸ“ŒOverview

Purpose: To provide powerful Google search capabilities and AI-driven deep research tools through the Serper API for MCP-enabled applications.

Overview: The Serper Search MCP Server integrates advanced Google search functionalities with a robust AI-powered research tool, allowing developers to enhance their applications with comprehensive search and iterative research capabilities.

Key Features:

  • Powerful Google search integration: Utilizes the Serper API to fetch rich search data such as knowledge graph information, organic results, and related searches.

  • AI-powered Deep Research tool: Conducts multi-step, iterative research that generates sub-queries, synthesizes information from various sources, provides citations, and allows customizable research depths.


Serper Search MCP Server

A Model Context Protocol server that provides Google search capabilities through the Serper API, along with an AI-powered Deep Research tool. This server enables easy integration of search and research functionality into your MCP-enabled applications.

✨ Features

  • 🌐 Google search integration through Serper API
  • πŸ”„ Rich search response data including:
    • Knowledge Graph information
    • Organic search results
    • "People Also Ask" questions
    • Related searches
  • 🧠 AI-powered Deep Research tool:
    • Multi-step, iterative research
    • Generates sub-queries for thorough exploration
    • Synthesizes information from multiple sources
    • Provides citations for information
    • Adjustable research depth levels
    • Built-in quality metrics for improvement
  • πŸ›  Configurable search parameters:
    • Country targeting
    • Language selection
    • Result count customization
    • Autocorrect options
  • πŸ”’ Secure API key handling
  • ⚑️ Rate limiting and caching support
  • πŸ“ TypeScript support with full type definitions
  • πŸ“Š Integrated performance metrics for optimization

πŸš€ Installation

  1. Clone the repository:
git clone https://github.com/yourusername/serper-search-server.git
cd serper-search-server
  1. Install dependencies:
pnpm install
  1. Build the server:
pnpm run build

βš™οΈ Configuration

  1. Get your Serper API key from https://serper.dev

  2. Create a .env file in the root directory:

# Required
SERPER_API_KEY=your_api_key_here

# Optional - Advanced Quality Metrics Configuration (pre-configured by default)
USAGE_METRICS_KEY=your-custom-metrics-key     # Optional
USAGE_PROJECT_ID=your-custom-project-id       # Optional
METRICS_ENDPOINT=https://your-custom-host.com # Optional
DISABLE_METRICS=false                         # Not recommended

See TELEMETRY.md for detailed information about quality metrics collection, performance monitoring, usage analytics, dashboard setup, and continuous improvement.

πŸ”Œ Integration

Claude Desktop

Add the server config to your Claude Desktop configuration:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "serper-search-server": {
      "command": "/path/to/serper-search-server/build/index.js",
      "env": {
        "SERPER_API_KEY": "your_api_key_here"
      }
    }
  }
}

πŸ›  Usage

Search Tool

The server provides a search tool with these parameters:

{
  "query": string,          // Search query
  "numResults"?: number,    // Number of results (default: 10, max: 100)
  "gl"?: string,            // Country code (e.g., "us", "uk")
  "hl"?: string,            // Language code (e.g., "en", "es")
  "autocorrect"?: boolean,  // Enable autocorrect (default: true)
  "type"?: "search"         // Search type (more types coming soon)
}

Deep Research Tool

For comprehensive research, use the deep research tool with parameters:

{
  "query": string,                     // Research query or question
  "depth"?: "basic" | "standard" | "deep",  // Research depth (default: "standard")
  "maxSources"?: number                // Maximum sources to include (default: 10)
}

The deep research tool:

  • Breaks down complex queries into sub-queries
  • Executes multiple searches to gather information
  • Uses AI to synthesize information from multiple sources
  • Formats results with citations and references
  • Adapts research based on intermediate results
  • Collects anonymous quality metrics for improvement

Depth Levels:

  • basic: Quick overview (3-5 sources, ~5 min)
    Good for simple facts and definitions
  • standard: Comprehensive (5-10 sources, ~10 min)
    Balanced depth for most needs
  • deep: Exhaustive (10+ sources, ~15-20 min)
    For complex topics and thorough analysis

Search Tool Example Response

Includes rich data such as knowledge graph, organic results, "people also ask," and related searches.

{
  "searchParameters": {
    "q": "apple inc",
    "gl": "us",
    "hl": "en",
    "autocorrect": true,
    "type": "search"
  },
  "knowledgeGraph": {
    "title": "Apple",
    "type": "Technology company",
    "website": "http://www.apple.com/",
    "description": "Apple Inc. is an American multinational technology company...",
    "attributes": {
      "Headquarters": "Cupertino, CA",
      "CEO": "Tim Cook (Aug 24, 2011–)",
      "Founded": "April 1, 1976, Los Altos, CA"
    }
  },
  "organic": [
    {
      "title": "Apple",
      "link": "https://www.apple.com/",
      "snippet": "Discover the innovative world of Apple...",
      "position": 1
    }
  ],
  "peopleAlsoAsk": [
    {
      "question": "What does Apple Inc mean?",
      "snippet": "Apple Inc., formerly Apple Computer, Inc....",
      "link": "https://www.britannica.com/topic/Apple-Inc"
    }
  ],
  "relatedSearches": [
    {
      "query": "Who invented the iPhone"
    }
  ]
}

πŸ” Response Types

Knowledge Graph

  • Title and type
  • Website URL
  • Description
  • Key attributes

Organic Results

  • Title and URL
  • Snippet (description)
  • Position in results
  • Sitelinks when available

People Also Ask

  • Question text
  • Answer snippet
  • Source link

Related Searches

  • List of related queries

πŸ“Š Quality Metrics

The Deep Research tool includes integrated quality metrics:

  • Research process metrics
  • Performance monitoring
  • Issue tracking
  • Usage patterns
  • Result quality indicators

See TELEMETRY.md for details about metrics collection and improving search quality.

🀝 Contributing

Contributions are welcome! Please submit a Pull Request.

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Serper API for Google search capabilities
  • Model Context Protocol for the MCP framework
  • PostHog for analytics capabilities