Retrieve parsed search engine results using the SerpApi API.
Build an MCP server that:
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.
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.
Save the Server Code: Place the server code in a file, e.g., server.py.
Configure the API Key: Create a .env file in the same directory with your SerpApi API key:
SERPAPI_API_KEY=your_api_key_here
python server.py
{
"mcpServers": {
"serpapi": {
"command": "python",
"args": ["path/to/server.py"]
}
}
}
Restart the client to load the server.
Supported Engines: Google, Google Light, Bing, Walmart, Yahoo, eBay, YouTube, DuckDuckGo, Yandex, Baidu
Tools:
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)
API Key: Set your SerpApi API key in the .env
file as SERPAPI_API_KEY
.
Production Mode: Launch the server with:
python server.py
Development Mode: Use the MCP Inspector for debugging:
mcp dev server.py
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.
Search and retrieve content from the Unsloth AI documentation.
An MCP agent that integrates various search tools using the SearchAPI service. Requires SearchAPI and Google API keys.
Search and fetch documentation for popular libraries like Langchain, Llama-Index, and OpenAI using the Serper API, providing updated information for LLMs.
Integrates with The Movie Database (TMDB) API, allowing AI assistants to search for movies, retrieve details, and generate related content.
Google News search capabilities with automatic topic categorization and multi-language support via SerpAPI integration.
Web search server that integrates Perplexity Sonar models via OpenRouter API for real-time, context-aware search with citations
Fetch, convert, and search AWS documentation pages, with recommendations for related content.
Semantic search for Hex package documentation. Requires local Elixir and Mix installation.
MCP server for interacting with the Ordiscan API to query Bitcoin ordinals and inscriptions. Requires an Ordiscan API key.
An automated research agent using Google Gemini models and Google Search to perform deep, multi-step web research.