mcp -template
MCP server from hoanganhpham1006/mcp-server-template
claude mcp add --transport stdio hoanganhpham1006-mcp-server-template python server.py \ --env SERPAPI_API_KEY="your_serpapi_api_key_here"
How to use
This MCP server integrates with SerpApi to perform live and archived searches across a variety of engines. The server exposes a single tool named 'search' that accepts a query, a target search engine, and optional parameters (such as location or language) to tailor results. It also provides a 'locations' resource to retrieve available Google locations, which can be used to refine searches by geography. To connect, run the server in your environment and configure your MCP client (for example Claude Desktop) to point at the server endpoint. Once connected, you can list available tools and resources and invoke the search tool to fetch results from SerpApi.
In typical usage, your MCP client will first query the 'locations' resource to understand location-oriented filters, then call the 'search' tool with a payload like {"query": "coffee", "engine": "google", "location": "Austin, TX"}. The server will return structured results from SerpApi, which your client can present or further process. The server is designed to be used with any MCP client that supports the standard read_resource and call_tool interfaces.
How to install
Prerequisites:
- Python 3.8+ installed
- pip available in PATH
- A SerpApi API key (you can obtain one from serpapi.com)
Step-by-step installation:
-
Create a project directory and navigate into it: mkdir serpapi-mcp-server && cd serpapi-mcp-server
-
Install required Python packages: pip install mcp serpapi python-dotenv
-
Create the server file (example server.py) or place your existing SerpApi MCP server code in the directory. Ensure it can be started with: python server.py
-
Create a .env file in the same directory and set your SerpApi API key: SERPAPI_API_KEY=your_serpapi_api_key_here
-
Start the server: python server.py
-
Connect your MCP client (e.g., Claude Desktop) to the server by configuring the client’s MCP server settings to point at the localhost/run path where server.py is hosted.
Additional notes
Tips:
- Ensure the SERPAPI_API_KEY is kept secret and not committed to version control.
- The 'search' tool supports parameters such as query, engine, and location. Check engine compatibility in SerpApi docs for supported parameters.
- The 'locations' resource can be used to fetch available location filters for searches.
- If upgrading or changing the server, make sure to restart your MCP client to reload the server configuration.
- For development debugging, you can run the server in verbose mode if supported by your MCP server code and use the MCP Inspector to inspect requests and responses.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP