Get the FREE Ultimate OpenClaw Setup Guide →

mcp-google-custom-search

An mcp server for searching against google custom search api

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio limklister-mcp-google-custom-search-server node /absolute/path/to/mcp-google-custom-search-server/build/index.js \
  --env GOOGLE_API_KEY="your-api-key" \
  --env GOOGLE_SEARCH_ENGINE_ID="your-search-engine-id"

How to use

This MCP server exposes a single tool named 'search' that uses Google Custom Search API to perform web queries on behalf of an LLM. The server formats results with titles, URLs, and descriptions, returning up to 10 results per query. To use it, start the server and issue a JSON-RPC call to the 'search' tool with a 'query' string and an optional 'numResults' (default is 5, maximum 10). Example: {"jsonrpc":"2.0","id":1,"method":"callTool","params":{"name":"search","arguments":{"query":"best chocolate cake recipe","numResults":5}}}. Ensure you have configured GOOGLE_API_KEY and GOOGLE_SEARCH_ENGINE_ID in the environment so the server can authenticate with Google Custom Search API. The server is compatible with MCP clients like Claude Desktop and other MCP-compliant interfaces.

How to install

Prerequisites:

  • Node.js v18 or higher
  • npm (comes with Node.js)

Steps:

  1. Clone the repository git clone https://github.com/limklister/mcp-google-custom-search-server.git cd mcp-google-custom-search-server

  2. Install dependencies npm install

  3. Create an environment file (optional; you can also export vars directly)

    .env

    GOOGLE_API_KEY=your-api-key GOOGLE_SEARCH_ENGINE_ID=your-search-engine-id

  4. Build the server npm run build

  5. Start the server npm start

  6. (Optional) Test using MCP Inspector or manual calls as shown in the README

Additional notes

Tips and caveats:

  • You must provide a valid Google API key and a Programmable Search Engine ID (GOOGLE_API_KEY and GOOGLE_SEARCH_ENGINE_ID).
  • The 'search' tool supports up to 10 results per query; if you omit numResults, the default is 5.
  • Ensure the environment variables are available to the process that runs the server (e.g., in a .env file loaded at startup or exported in your shell).
  • If you encounter API quota or billing issues, check Google Cloud Console quotas for the Custom Search API and ensure billing is enabled as required.
  • The server is designed to be compatible with Claude Desktop and other MCP clients; you can wire it into Claude via the Claude Desktop config, pointing to the built index.js when running in production.
  • Build outputs will be in the build/ folder; reference build/index.js in your production command.

Related MCP Servers

Sponsor this space

Reach thousands of developers