SerpApi MCP Server

SerpApi MCP Server

An MCP server that integrates with SerpApi to retrieve search results from multiple search engines including Google, Bing, Yahoo, and others, enabling fast access to both live and archived search data.

ilyazub

Search
Browser Automation
Python
Visit Server

README

SerpApi MCP Server

Build

Build an MCP server that:

  • Get parsed search engines results pages via SerpApi using an API key, fast

This MCP (Model Context Protocol) server integrates with SerpApi to perform searches across various search engines and retrieve both live and archived results. It exposes tools and resources for seamless interaction with MCP clients or hosts, such as Grok or Claude for Desktop.


Installation

To set up the SerpApi MCP server, install the required Python libraries:

pip install mcp serpapi python-dotenv

You’ll also need a SerpApi API key. Sign up at SerpApi to get one.

Quick Start

  1. Save the Server Code: Place the server code in a file, e.g., server.py.

  2. Configure the API Key: Create a .env file in the same directory with your SerpApi API key:

SERPAPI_API_KEY=your_api_key_here
  1. Run the Server: Start the server with:
python server.py
  1. Integrate with an MCP Client: Connect the server to an MCP client or host (e.g., Claude for Desktop). For Claude, update Claude_desktop_config.json:
{
  "mcpServers": {
    "serpapi": {
      "command": "python",
      "args": ["path/to/server.py"]
    }
  }
}

Restart the client to load the server.

Features

  • Supported Engines: Google, Google Light, Bing, Walmart, Yahoo, eBay, YouTube, DuckDuckGo, Yandex, Baidu

  • Tools:

  • search: Perform a search on a specified engine with a query and optional parameters.
  • Resources:
  • locations: Find Google Locations.

Usage Examples

These examples assume an MCP client (e.g., written in Python using the MCP client SDK) is connected to the server. Listing Supported Engines Retrieve the list of supported search engines:


engines = await session.read_resource("locations")
print(engines)

Performing a Search Search for "coffee" on Google with a location filter:


result = await session.call_tool("search", {
    "query": "coffee",
    "engine": "google",
    "location": "Austin, TX"
})

print(result)

Configuration

API Key: Set your SerpApi API key in the .env file as SERPAPI_API_KEY.

Running the Server

Production Mode: Launch the server with:


python server.py

Development Mode: Use the MCP Inspector for debugging:

mcp dev server.py

Testing

Test the server using the MCP Inspector or an MCP client. For Claude for Desktop, configure the server in Claude_desktop_config.json, restart the app, and use the hammer icon to explore and test available tools.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Playwright MCP Server

Playwright MCP Server

Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.

Featured
Local
TypeScript
@kazuph/mcp-fetch

@kazuph/mcp-fetch

Model Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.

Featured
Local
JavaScript
DuckDuckGo MCP Server

DuckDuckGo MCP Server

A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.

Featured
Python
YouTube Transcript MCP Server

YouTube Transcript MCP Server

This server retrieves transcripts for given YouTube video URLs, enabling integration with Goose CLI or Goose Desktop for transcript extraction and processing.

Featured
Python
serper-search-scrape-mcp-server

serper-search-scrape-mcp-server

This Serper MCP Server supports search and webpage scraping, and all the most recent parameters introduced by the Serper API, like location.

Featured
TypeScript
The Verge News MCP Server

The Verge News MCP Server

Provides tools to fetch and search news from The Verge's RSS feed, allowing users to get today's news, retrieve random articles from the past week, and search for specific keywords in recent Verge content.

Featured
TypeScript
Google Search Console MCP Server

Google Search Console MCP Server

A server that provides access to Google Search Console data through the Model Context Protocol, allowing users to retrieve and analyze search analytics data with customizable dimensions and reporting periods.

Featured
TypeScript