Get the FREE Ultimate OpenClaw Setup Guide →

mcp-google-cse

A Model Context Protocol server that provides search capabilities using a Google CSE (custom search engine).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio richard-weiss-mcp-google-cse python -m mcp-google-cse \
  --env API_KEY="" \
  --env ENGINE_ID="" \
  --env RESULT_NUM="" \
  --env GEOLOCATION="" \
  --env SERVICE_NAME="" \
  --env COUNTRY_REGION="" \
  --env RESULT_LANGUAGE=""

How to use

The Google Custom Search Engine MCP Server provides a tool named google_search that lets an LLM perform Google-like searches via a Custom Search Engine (CSE). The server returns a structured list of search results including titles, links, and snippets, enabling downstream tools to fetch or summarize content as needed. This is designed to be combined with other MCP tools (for example, a fetch tool) so you can search and then retrieve or process content from the results in a controlled, modular workflow. Note that the server uses your configured Google CSE (engine) and API key, and adheres to the free quota of 100 searches per day by default.

To use it, configure your environment with API_KEY and ENGINE_ID, then invoke the google_search tool with a query term. The tool will return an array of results, each containing a title, link, and snippet. You can chain this with content extraction tools or further analysis steps to build a broader information retrieval workflow.

How to install

Prerequisites:

  • Python (3.8+)
  • Access to install Python packages via pip

Install and run via Pip (recommended):

pip install mcp-google-cse

Run as a module:

python -m mcp-google-cse

If you prefer to use uv/uvx or a different runner, you can also deploy via those tools as described in the README, but the following covers the canonical Python installation path.

Optional: Install via Smithery (automation in Claude Desktop workflows):

npx -y @smithery/cli install @Richard-Weiss/mcp-google-cse --client claude

Configure environment variables (example):

export API_KEY="your_api_key_here"
export ENGINE_ID="your_engine_id_here"
export SERVICE_NAME="your_service_name_here"  # optional

Usage example after installation:

python -m mcp-google-cse

Additional notes

Environment variables:

  • API_KEY: Your Google Custom Search API key (required).
  • ENGINE_ID: Your Custom Search Engine ID (required).
  • SERVICE_NAME: Optional; the name of the service (defaults to customsearch).
  • COUNTRY_REGION, GEOLOCATION, RESULT_LANGUAGE, RESULT_NUM: Optional query/response controls; set as needed for your use case.

Quota and billing: The server uses the Google CSE quota, typically free up to 100 searches per day by default. Each tool call counts as one search. If you exceed the quota, you’ll need to enable billing or adjust usage accordingly.

Common issues:

  • Ensure API_KEY and ENGINE_ID are valid and enabled for the Custom Search API.
  • Check that the CSE is configured to allow web search if you want broader results.
  • If you see authentication errors, verify that environment variables are exported in the shell running the MCP server.

Related MCP Servers

Sponsor this space

Reach thousands of developers