- Home
- MCP servers
- SearchAPI
SearchAPI
- python
66
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
This MCP server provides production-ready search capabilities through SearchAPI.io, enabling AI assistants to perform Google, Maps, Flights, Hotels, and related searches with built-in caching, retry logic, and circuit breakers. It’s designed for reliable, scalable integration with your AI workflows and includes health checks, metrics, and structured configuration.
How to use
You interact with the SearchAPI MCP server through an MCP client. Start the server locally or remotely, then point your MCP client at it to execute search endpoints such as Google Search, Google Maps, Flights, Hotels, and more. Leverage the built-in caching and retry logic to improve responsiveness and resilience, and use the health and metrics endpoints to monitor performance.
How to install
Prerequisites you need before starting:
- Python 3.10 or higher
- An API key for SearchAPI.io
- A tool to run MCP servers (UV or Python directly are common options)
# Set your API key
export SEARCHAPI_API_KEY="your_api_key_here"
# Quick start using UV (recommended)
uvx --from git+https://github.com/RmMargt/searchAPI-mcp.git mcp-server-searchapi
If you prefer a Python-based run, you can start the server by running the MCP entry point directly with Python after cloning the repository and installing dependencies.
# Example in Python, after cloning and installing deps
pip install httpx fastmcp pydantic pydantic-settings
python mcp_server_refactored.py
Configuration & environment
Configure the server with environment variables to control API access, timeouts, caching, and monitoring. A typical setup includes an API key, optional API URL, timeouts, retry settings, and cache controls.
# Example .env content
SEARCHAPI_API_KEY=your_api_key_here
SEARCHAPI_API_URL=https://www.searchapi.io/api/v1/search
TIMEOUT=30.0
MAX_RETRIES=3
RETRY_BACKOFF=1.0
ENABLE_CACHE=true
CACHE_TTL=3600
CACHE_MAX_SIZE=1000
POOL_CONNECTIONS=10
POOL_MAXSIZE=10
ENABLE_METRICS=true
LOG_LEVEL=INFO
MCP client configuration examples
You can configure an MCP client to start the server either via UV with a direct Git source or by pointing to a local Python script. Choose the method you prefer and place the configuration in your MCP client profile.
{
"mcpServers": {
"searchapi": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/RmMargt/searchAPI-mcp.git",
"mcp-server-searchapi"
],
"env": {
"SEARCHAPI_API_KEY": "your_api_key_here"
}
}
}
}
{
"mcpServers": {
"searchapi": {
"command": "python",
"args": [
"/absolute/path/to/searchAPI-mcp/mcp_server_refactored.py"
],
"env": {
"SEARCHAPI_API_KEY": "your_api_key_here"
}
}
}
}
Notes and tips
- Use health_check to monitor API connectivity, cache statistics, and circuit breaker state. See request metrics and latency to ensure your integration remains responsive under load.
Available tools
health_check
Check the health and performance of the SearchAPI service, including API connectivity, latency, circuit breaker state, cache statistics, and request metrics.
get_current_time
Get current time and travel date suggestions for planning trips, with optional future date ranges.
search_google
Query Google web search and retrieve results, knowledge graphs, answer boxes, and related questions.
search_google_videos
Search Google Videos with filters for duration, source, and upload time.
search_google_ai_mode
Produce AI-generated overviews with citations and structured content blocks based on a query.
search_google_maps
Search for places, businesses, and services using map data.
search_google_maps_place
Get detailed information for a specific place using a place ID or data ID.
search_google_maps_reviews
Retrieve reviews for a specific place with sorting and rating filters.
search_google_events
Find events, concerts, and activities by location and date range.
search_google_flights
Search flights with filters for departure/arrival, dates, cabin class, and passengers.
search_google_flights_calendar
Get a price calendar for flexible travel planning.
search_google_flights_location_search
Lookup airport codes and locations for travel planning.
search_google_travel_explore
Explore travel destinations and inspiration based on interests and time frames.
search_google_hotels
Search hotels with filters for date ranges, rating, price, and amenities.
search_google_hotels_property
Get detailed hotel information for a chosen property token.