Skip to main content
Glama

SerpApi MCP Server

SerpApi MCP Server

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.

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

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.

  1. Installation
    1. Quick Start
      1. Features
        1. Usage Examples
          1. Configuration
            1. Running the Server
          2. Testing

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              An MCP server implementation that integrates the SearxNG API, providing web search capabilities.
              Last updated 12 days ago
              2
              878
              151
              JavaScript
              MIT License
              • Linux
              • Apple
            • A
              security
              A
              license
              A
              quality
              A powerful MCP server that enables parallel Google searching with multiple keywords simultaneously, providing structured results while handling CAPTCHAs and simulating user browsing patterns.
              Last updated a month ago
              1
              540
              179
              TypeScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              An MCP server that enables interacting with Google's Indexing API, allowing agents to submit URLs to Google for indexing or removal from search results through natural language commands.
              Last updated 10 days ago
              Python
            • A
              security
              A
              license
              A
              quality
              An MCP server that allows users to efficiently search and reference user-configured documents through document listing, grep searching, semantic searching with OpenAI Embeddings, and full document retrieval.
              Last updated a month ago
              4
              3
              Python
              MIT License
              • Apple
              • Linux

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/ilyazub/serpapi-mcp-server'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server