A Model Context Protocol (MCP) server implementation that integrates with SerpApi for comprehensive search engine results and data extraction. - Multi-Engine Search: Google, Bing, Yahoo, DuckDuckGo, YouTube, eBay, and more - Engine Resources: Per-engine parameter schemas available via MCP resources (see Search Tool) - Real-time Weather Data: Location-based weather with forecasts via search queries
Add this skill
npx mdskills install serpapi/serpapi-mcpWell-documented MCP server providing multi-engine search capabilities with comprehensive setup and authentication options
1# <img src="https://user-images.githubusercontent.com/307597/154772945-1b7dba5f-21cf-41d0-bb2e-65b6eff4aaaf.png" width="30" height="30"/> SerpApi MCP Server23A Model Context Protocol (MCP) server implementation that integrates with [SerpApi](https://serpapi.com) for comprehensive search engine results and data extraction.45[](https://www.python.org/downloads/)6[](LICENSE)7[](vscode://mcp/install?serverID=io.github.serpapi/serpapi-mcp)89## Features1011- **Multi-Engine Search**: Google, Bing, Yahoo, DuckDuckGo, YouTube, eBay, and [more](https://serpapi.com/search-engine-apis)12- **Engine Resources**: Per-engine parameter schemas available via MCP resources (see Search Tool)13- **Real-time Weather Data**: Location-based weather with forecasts via search queries14- **Stock Market Data**: Company financials and market data through search integration15- **Dynamic Result Processing**: Automatically detects and formats different result types16- **Flexible Response Modes**: Complete or compact JSON responses17- **JSON Responses**: Structured JSON output with complete or compact modes1819## Quick Start2021SerpApi MCP Server is available as a hosted service at [mcp.serpapi.com](https://mcp.serpapi.com). In order to connect to it, you need to provide an API key. You can find your API key on your [SerpApi dashboard](https://serpapi.com/dashboard).2223You can configure Claude Desktop to use the hosted server:2425```json26{27 "mcpServers": {28 "serpapi": {29 "url": "https://mcp.serpapi.com/YOUR_SERPAPI_API_KEY/mcp"30 }31 }32}33```3435### Self-Hosting36```bash37git clone https://github.com/serpapi/serpapi-mcp.git38cd serpapi-mcp39uv sync && uv run src/server.py40```4142Configure Claude Desktop:43```json44{45 "mcpServers": {46 "serpapi": {47 "url": "http://localhost:8000/YOUR_SERPAPI_API_KEY/mcp"48 }49 }50}51```5253Get your API key: [serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)5455## Authentication5657Two methods are supported:58- **Path-based**: `/YOUR_API_KEY/mcp` (recommended)59- **Header-based**: `Authorization: Bearer YOUR_API_KEY`6061**Examples:**62```bash63# Path-based64curl "https://mcp.serpapi.com/your_key/mcp" -d '...'6566# Header-based67curl "https://mcp.serpapi.com/mcp" -H "Authorization: Bearer your_key" -d '...'68```6970## Search Tool7172The MCP server has one main Search Tool that supports all SerpApi engines and result types. You can find all available parameters on the [SerpApi API reference](https://serpapi.com/search-api).73Engine parameter schemas are also exposed as MCP resources: `serpapi://engines` (index) and `serpapi://engines/<engine>`.7475The parameters you can provide are specific for each API engine. Some sample parameters are provided below:7677- `params.q` (required): Search query78- `params.engine`: Search engine (default: "google_light")79- `params.location`: Geographic filter80- `mode`: Response mode - "complete" (default) or "compact"81- ...see other parameters on the [SerpApi API reference](https://serpapi.com/search-api)8283**Examples:**8485```json86{"name": "search", "arguments": {"params": {"q": "coffee shops", "location": "Austin, TX"}}}87{"name": "search", "arguments": {"params": {"q": "weather in London"}}}88{"name": "search", "arguments": {"params": {"q": "AAPL stock"}}}89{"name": "search", "arguments": {"params": {"q": "news"}, "mode": "compact"}}90{"name": "search", "arguments": {"params": {"q": "detailed search"}, "mode": "complete"}}91```9293**Supported Engines:** Google, Bing, Yahoo, DuckDuckGo, YouTube, eBay, and more (see `serpapi://engines`).9495**Result Types:** Answer boxes, organic results, news, images, shopping - automatically detected and formatted.9697## Development9899```bash100# Local development101uv sync && uv run src/server.py102103# Docker104docker build -t serpapi-mcp . && docker run -p 8000:8000 serpapi-mcp105106# Regenerate engine resources (Playground scrape)107python build-engines.py108109# Testing with MCP Inspector110npx @modelcontextprotocol/inspector111# Configure: URL mcp.serpapi.com/YOUR_KEY/mcp, Transport "Streamable HTTP transport"112```113114## Troubleshooting115116- **"Missing API key"**: Include key in URL path `/{YOUR_KEY}/mcp` or header `Bearer YOUR_KEY`117- **"Invalid key"**: Verify at [serpapi.com/dashboard](https://serpapi.com/dashboard)118- **"Rate limit exceeded"**: Wait or upgrade your SerpApi plan119- **"No results"**: Try different query or engine120121## Contributing1221231. Fork the repository1242. Create your feature branch: `git checkout -b feature/amazing-feature`1253. Install dependencies: `uv install`1264. Make your changes1275. Commit changes: `git commit -m 'Add amazing feature'`1286. Push to branch: `git push origin feature/amazing-feature`1297. Open a Pull Request130131## License132133MIT License - see [LICENSE](LICENSE) file for details.134
Full transparency — inspect the skill content before installing.