google-search
MCP server from gradusnikov/google-search-mcp-server
claude mcp add --transport stdio gradusnikov-google-search-mcp-server python google_search_mcp_server.py \ --env GOOGLE_CSE_ID="your_custom_search_engine_id" \ --env GOOGLE_API_KEY="your_google_api_key"
How to use
This MCP server exposes Google Custom Search capabilities through the MCP framework. It uses the Google Custom Search API (via the google-api-python-client) to fetch search results based on user queries and returns structured results that can be consumed by MCP clients. To use it, start the server either through your MCP runner (for example, mcp run google_search_mcp_server.py) or by configuring it in your client app as a wired MCP service. Once running, you can issue search requests with a query parameter, and the server will query Google Custom Search using your API key and CSE ID, returning relevant results such as titles, snippets, URLs, and snippets ready for display in your application. The server is designed to be used as part of an MCP workflow where models or agents request search results to augment their reasoning with up-to-date information from the web.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Git installed
- Internet access to install dependencies and run the server
Installation steps:
-
Clone the repository: git clone https://github.com/gradusnikov/google-search-mpc-server.git cd google-search-mpc-server
-
Create a Python virtual environment (optional but recommended): python -m venv venv source venv/bin/activate # on Unix/macOS .\venv\Scripts\activate # on Windows
-
Install dependencies: pip install fastmcp google-api-python-client python-dotenv
-
Create a .env file in the project root with your Google credentials: GOOGLE_API_KEY=your_google_api_key GOOGLE_CSE_ID=your_custom_search_engine_id
-
Run the MCP server: mcp run google_search_mcp_server.py
Notes:
- The Google API key and CSE ID you supply must be active and have the Custom Search API enabled.
- If you prefer Smithery automation, you can install via Smithery as shown in the README: npx -y @smithery/cli install @gradusnikov/google-search-mcp-server --client claude
Additional notes
Tips:
- Ensure your GOOGLE_API_KEY and GOOGLE_CSE_ID are kept secure and not checked into version control.
- Be mindful of Google API quotas and pricing; implement caching or rate limiting as needed.
- If you switch environments (e.g., from local to production), update the .env file accordingly.
- The server expects a standard MCP request for a search; ensure your client provides a query parameter compatible with the server's implementation.
Common issues:
- 401 Unauthorized: check that the GOOGLE_API_KEY is correct and has the Custom Search API enabled on the Google Cloud project.
- 403 Quotas/Access denied: verify that the associated CSE ID is valid for the given API key and that the quota is not exceeded.
- Network errors: ensure outbound network access from the host running the MCP server is allowed.
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