Serper Search MCP server

Integrates with Serper API to provide web search capabilities through standard Google search and Deep Research tools that break complex queries into sub-queries, gather information from multiple sources, and synthesize findings with citations.
Back to servers
Setup instructions
Provider
NightTrek
Release date
Feb 18, 2025
Language
TypeScript
Stats
33 stars

This MCP server provides Google search capabilities through the Serper API, along with an AI-powered Deep Research tool. It enables easy integration of search and research functionality into MCP-enabled applications with features like rich search results, multi-step research capabilities, and configurable search parameters.

Installation

Step 1: Clone the repository

git clone https://github.com/yourusername/serper-search-server.git
cd serper-search-server

Step 2: Install dependencies

pnpm install

Step 3: Build the server

pnpm run build

Configuration

API Key Setup

  1. Get your Serper API key from Serper.dev
  2. Create a .env file in the root directory:
# Required
SERPER_API_KEY=your_api_key_here

# Optional - Advanced Quality Metrics Configuration
USAGE_METRICS_KEY=your-custom-metrics-key
USAGE_PROJECT_ID=your-custom-project-id
METRICS_ENDPOINT=https://your-custom-host.com
DISABLE_METRICS=false

Integration with Claude Desktop

Add the server configuration 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"
      }
    }
  }
}

Using the Search Tool

The server provides a search tool with the following 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
}

Example Search Response

{
  "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"
    }
  ]
}

Using the Deep Research Tool

For more comprehensive research, the Deep Research tool performs multi-step research with these parameters:

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

Research Depth Options

  • basic: Quick overview (3-5 sources, ~5 min)

    • Good for simple facts, quick definitions, straightforward questions
  • standard: Comprehensive analysis (5-10 sources, ~10 min)

    • Good for most research needs, balanced depth and speed
  • deep: Exhaustive research (10+ sources, ~15-20 min)

    • Good for complex topics, academic research, thorough analysis

How It Works

The Deep Research tool:

  • Breaks down complex queries into focused sub-queries
  • Executes multiple searches to gather comprehensive information
  • Synthesizes information from multiple sources
  • Formats results with proper citations and references
  • Adapts research strategy based on intermediate results

Response Types

Knowledge Graph

Contains entity information when available:

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

Organic Results

List of search results including:

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

People Also Ask

Common questions related to the search:

  • Question text
  • Answer snippet
  • Source link

Related Searches

List of related search queries users often make.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "serper-search-server" '{"command":"/path/to/serper-search-server/build/index.js","env":{"SERPER_API_KEY":"your_api_key_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later